diff --git a/assets b/assets
index 068fbb2d..5f3ab8b3 160000
--- a/assets
+++ b/assets
@@ -1 +1 @@
-Subproject commit 068fbb2d20682dd60f186c82172d7731e60ed7e9
+Subproject commit 5f3ab8b35ddce150e972445fb2894fb9e9637258
diff --git a/include/Engine/Rendering/ModelJob.h b/include/Engine/Rendering/ModelJob.h
index ccfd209c..32d89293 100644
--- a/include/Engine/Rendering/ModelJob.h
+++ b/include/Engine/Rendering/ModelJob.h
@@ -41,7 +41,7 @@ struct ModelJob : RenderJob
Skeleton = Model->m_RawModel->m_Skeleton;
- if (world->HasComponent(Entity, "Animation")) {
+ if (world->HasComponent(Entity, "Animation") && Skeleton != nullptr) {
auto animationComponent = world->GetComponent(Entity, "Animation");
Animation = model->m_RawModel->m_Skeleton->GetAnimation(animationComponent["Name"]);
AnimationTime = (double)animationComponent["Time"];
diff --git a/resources/Schema/Entities/FastWorld.xml b/resources/Schema/Entities/FastWorld.xml
index 655a9766..68d1dccb 100644
--- a/resources/Schema/Entities/FastWorld.xml
+++ b/resources/Schema/Entities/FastWorld.xml
@@ -17,25 +17,46 @@
-
+
+
+
- running
-
- 1
+ Crouch Walk
+
+ 32
- Models/Animtest.mesh
+ Models/AssaultAnimated.mesh
-
+
+
+
+
+ pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew pew
+ Fonts/DroidSans.ttf,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -46,21 +67,6 @@
-
-
-
- Got to Go FAST!!!!
- Fonts/DroidSans.ttf,60
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/Schema/Entities/RenderingWorld.xml b/resources/Schema/Entities/RenderingWorld.xml
index 2c101dc6..e860fd04 100644
--- a/resources/Schema/Entities/RenderingWorld.xml
+++ b/resources/Schema/Entities/RenderingWorld.xml
@@ -80,7 +80,7 @@
-
+
@@ -275,7 +275,9 @@
-
+ running
+
+ 1
Models/Animtest.mesh
diff --git a/src/Engine/Rendering/AnimationSystem.cpp b/src/Engine/Rendering/AnimationSystem.cpp
index e699866b..2126362f 100644
--- a/src/Engine/Rendering/AnimationSystem.cpp
+++ b/src/Engine/Rendering/AnimationSystem.cpp
@@ -6,31 +6,42 @@ void AnimationSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& a
return;
}
- Model* model = ResourceManager::Load(entity["Model"]["Resource"]);
+ Model* model;
+ try {
+ model = ResourceManager::Load<::Model, true>(entity["Model"]["Resource"]);
+ } catch (const std::exception&) {
+ return;
+ }
+
+
Skeleton* skeleton = model->m_RawModel->m_Skeleton;
const Skeleton::Animation* animation = skeleton->GetAnimation(animationComponent["Name"]);
- double animationSpeed = (double)animationComponent["Speed"];
+ if(animation != nullptr) {
+ double animationSpeed = (double)animationComponent["Speed"];
- if( animationSpeed != 0.0) {
- double nextTime = (double)animationComponent["Time"] + animationSpeed * dt;
+ if (animationSpeed != 0.0) {
+ double nextTime = (double)animationComponent["Time"] + animationSpeed * dt;
- if (!(bool)animationComponent["Loop"] && glm::abs(nextTime) > animation->Duration) {
- (double&)animationComponent["Time"] = glm::sign(nextTime) * animation->Duration;
- (double&)animationComponent["Speed"] = 0.0;
- Events::AnimationComplete e;
- e.Entity = entity;
- e.Name = (std::string)animationComponent["Name"];
- m_EventBroker->Publish(e);
- } else {
- if (glm::abs(nextTime) > animation->Duration) {
- (double&)animationComponent["Time"] = glm::abs(nextTime) - animation->Duration;
+ if (!(bool)animationComponent["Loop"] && glm::abs(nextTime) > animation->Duration) {
+ (double&)animationComponent["Time"] = glm::sign(nextTime) * animation->Duration;
+ (double&)animationComponent["Speed"] = 0.0;
+ Events::AnimationComplete e;
+ e.Entity = entity;
+ e.Name = (std::string)animationComponent["Name"];
+ m_EventBroker->Publish(e);
} else {
- (double&)animationComponent["Time"] = nextTime;
+ if (glm::abs(nextTime) > animation->Duration) {
+ (double&)animationComponent["Time"] = glm::abs(nextTime) - animation->Duration;
+ } else {
+ (double&)animationComponent["Time"] = nextTime;
+ }
}
}
}
+
+
}