Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
SkeletalMeshActor.h
Go to the documentation of this file.
1#pragma once
6
7#include <glm/gtc/quaternion.hpp>
8#include <string>
9#include <vector>
10
11namespace Engine::Entities
12{
16 class SkeletalMeshActor : public Actor
17 {
18 public:
20 const std::shared_ptr<SceneNode> &node,
21 Scene * owningScene,
22 Asset::Path meshPath
23 );
24
28 glm::vec3 getBonePosition(const std::string& boneName) const;
29
33 glm::quat getBoneRotation(const std::string& boneName) const;
34
38 glm::vec3 getBoneScale(const std::string& boneName) const;
39
43 void setBonePosition(const std::string& boneName, const glm::vec3& position);
44
48 void setBoneRotation(const std::string& boneName, const glm::quat& rotation);
49
53 void setBoneScale(const std::string& boneName, const glm::vec3& scale);
54
59
64
65 private:
66 int32_t resolveBone(const std::string& boneName) const;
69
71 std::vector<Animation::AnimationEvaluator::JointPose> currentPoses_;
72 bool posesInitialized_ = false;
73 };
74} // namespace EngineCore
Skeleton definition loaded from glTF skin data.
Definition SkinAsset.h:27
A component which can be attached as many times to an actor as one wants. It makes it possible to ren...
friend class Scene
Definition Actor.h:21
Actor(std::shared_ptr< SceneNode > sceneNode, Scene *owningScene)
void setBonePosition(const std::string &boneName, const glm::vec3 &position)
Setter.
SkeletalMeshActor(const std::shared_ptr< SceneNode > &node, Scene *owningScene, Asset::Path meshPath)
std::vector< Animation::AnimationEvaluator::JointPose > currentPoses_
int32_t resolveBone(const std::string &boneName) const
glm::quat getBoneRotation(const std::string &boneName) const
Getter.
void setBoneScale(const std::string &boneName, const glm::vec3 &scale)
Setter.
Assets::Skin * getSkin() const
void resetPosesToRest()
Resets all bone poses to their rest positions.
void setBoneRotation(const std::string &boneName, const glm::quat &rotation)
Setter.
glm::vec3 getBoneScale(const std::string &boneName) const
Getter.
void applyBoneTransforms()
Applies current poses to the mesh component.
glm::vec3 getBonePosition(const std::string &boneName) const
Getter.