4 #include <ThirdParty/EASTL-master/include/EASTL/string.h> 11 name = name + std::to_string(
Engine::GetEngine().lock()->GetResourceManager().lock()->loadedModels_.size()).c_str();
45 return eastl::vector<eastl::string>();
51 size_t index =
skeleton->GetAnimationIndex(animation);
168 if (
name != other.
name)
return false;
170 size_t thisMeshCount =
meshes.size();
171 size_t otherMeshCount = other.
meshes.size();
173 if (thisMeshCount != otherMeshCount)
return false;
175 for (
size_t i = 0; i < thisMeshCount; ++i)
180 for each (eastl::pair<eastl::shared_ptr<Mesh>, eastl::shared_ptr<Material>> mat
in meshMaterialMap)
182 if (other.meshMaterialMap[mat.first] != mat.second)
return false;
185 if (other.skeleton !=
skeleton)
return false;
192 if (
name != other.
name)
return true;
194 size_t thisMeshCount =
meshes.size();
195 size_t otherMeshCount = other.
meshes.size();
197 if (thisMeshCount != otherMeshCount)
return true;
199 for (
size_t i = 0; i < thisMeshCount; ++i)
204 for each (eastl::pair<eastl::shared_ptr<Mesh>, eastl::shared_ptr<Material>> mat
in meshMaterialMap)
206 if (other.meshMaterialMap[mat.first] != mat.second)
return true;
209 if (other.skeleton !=
skeleton)
return true;
216 meshes.push_back(meshToAdd);
eastl::vector< eastl::string > GetAnimations()
Returns a list of the loaded animations as a vector of names. Use these names to load a specific anim...
eastl::shared_ptr< Skeleton > GetSkeleton() const
Returns the animation data of the model. The animation data contains the skeleton of the model...
eastl::string currentAnimationName
eastl::string GetCurrentAnimationName() const
Returns the name of the currently selected animation.
void SetPaused(bool paused)
Pauses or unpauses the animation.
void SetAnimation(eastl::string animation, bool resetTime)
Sets the current animation of the mesh.
void SetLooping(bool looping)
Whether or not the animation should loop after finishing.
float GetAnimationTime() const
Returns the current progress of the animation.
eastl::vector< eastl::shared_ptr< Mesh > > & GetModelMeshes()
This method allows you to get a reference of all the meshes in this model.
bool IsPaused() const
Tells if the animation is paused or not.
void SetSkeleton(eastl::shared_ptr< Skeleton > skeleton)
Model(const aiScene *scene, eastl::string name="")
void SetSpeed(float speed)
Set the speed modifier of the animation. Default is 1.f.
float GetAnimationDuration() const
Returns the duration of a single loop of the animation.
size_t GetCurrentAnimationIndex() const
Returns the index of the currently selected animation.
This object is a storage container for meshes.
void UpdateAnimation(float deltaTime)
Updates animation related values, such as the progress of the animation.
void Update(float deltaTime)
Updates the model (doesn't do anything right now).
eastl::string GetName()
This method allows you to get the name of this model.
void SetMeshMaterial(eastl::shared_ptr< Mesh > mesh, eastl::shared_ptr< Material > material)
Associates a material with the given mesh. Warning: If building for vulkan, make sure that the specif...
eastl::shared_ptr< Skeleton > skeleton
bool operator==(Model &other)
This method allows you to compare a model against another model.
bool IsLooping() const
Returns a boolean indicating if the animation is looping or not.
eastl::vector< eastl::shared_ptr< Mesh > > meshes
eastl::map< eastl::shared_ptr< Mesh >, eastl::shared_ptr< Material > > meshMaterialMap
eastl::shared_ptr< Material > GetMeshMaterial(eastl::shared_ptr< Mesh > mesh)
Returns the material used by this model for the specified mesh. If the model doesn't contain a materi...
void SetAnimationTime(float time)
Sets the point in the animation the model is in. Set to 0 to reset the animation. Animation automatic...
bool operator!=(Model &other)
This method allows you to compare a model against another model.
void ResetAnimation()
Sets the current animation to 0, returning the model to the default pose.
void AddMesh(eastl::shared_ptr< Mesh > meshToAdd)
bool HasAnimations() const
Whether or not any animations have been loaded.
static eastl::weak_ptr< Engine > GetEngine() noexcept
This method allows you to get the instance of the Engine. This method will automatically initialize t...
float GetSpeed() const
Returns the speed modifier of the current animation.