7 #ifndef NAZARA_SKELETALMODEL_HPP 8 #define NAZARA_SKELETALMODEL_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/ResourceLoader.hpp> 12 #include <Nazara/Core/Updatable.hpp> 13 #include <Nazara/Graphics/Model.hpp> 14 #include <Nazara/Utility/Animation.hpp> 15 #include <Nazara/Utility/Skeleton.hpp> 19 struct NAZARA_GRAPHICS_API SkeletalModelParameters : ModelParameters
21 bool loadAnimation =
true;
22 AnimationParams animation;
29 using SkeletalModelLoader = ResourceLoader<SkeletalModel, SkeletalModelParameters>;
41 void AddToRenderQueue(
AbstractRenderQueue* renderQueue,
const InstanceData& instanceData)
const override;
42 void AdvanceAnimation(
float elapsedTime);
47 void EnableAnimation(
bool animation);
49 Animation* GetAnimation()
const;
50 Skeleton* GetSkeleton();
51 const Skeleton* GetSkeleton()
const;
53 bool HasAnimation()
const;
55 bool IsAnimated()
const override;
56 bool IsAnimationEnabled()
const;
58 bool LoadFromFile(
const String& filePath,
const SkeletalModelParameters& params = SkeletalModelParameters());
59 bool LoadFromMemory(
const void* data, std::size_t size,
const SkeletalModelParameters& params = SkeletalModelParameters());
60 bool LoadFromStream(
Stream& stream,
const SkeletalModelParameters& params = SkeletalModelParameters());
62 bool SetAnimation(Animation* animation);
63 void SetMesh(Mesh* mesh)
override;
64 bool SetSequence(
const String& sequenceName);
65 void SetSequence(
unsigned int sequenceIndex);
71 void MakeBoundingVolume()
const override;
74 void Update()
override;
78 const Sequence* m_currentSequence;
79 bool m_animationEnabled;
80 float m_interpolation;
81 unsigned int m_currentFrame;
82 unsigned int m_nextFrame;
84 static SkeletalModelLoader::LoaderList s_loaders;
88 #endif // NAZARA_SKELETALMODEL_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents a model.
Definition: Model.hpp:37
Graphics class that represents a model with a skeleton.
Definition: SkeletalModel.hpp:31
Core class that represents a string.
Definition: String.hpp:22
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
Core class that represents a loader of resources.
Definition: ResourceLoader.hpp:23
Core class that represents a stream.
Definition: Stream.hpp:19