Plasma Engine  2.0
Loading...
Searching...
No Matches
SkeletonBuilder.h
1#pragma once
2
3#include <Foundation/Types/UniquePtr.h>
4#include <RendererCore/AnimationSystem/Skeleton.h>
5#include <RendererCore/RendererCoreDLL.h>
6
9class PL_RENDERERCORE_DLL plSkeletonBuilder
10{
11
12public:
15
19 plUInt16 AddJoint(plStringView sName, const plTransform& localRestPose, plUInt16 uiParentIndex = plInvalidJointIndex);
20
21 void SetJointLimit(plUInt16 uiJointIndex, const plQuat& qLocalOrientation, plSkeletonJointType::Enum jointType, plAngle halfSwingLimitY, plAngle halfSwingLimitZ, plAngle twistLimitHalfAngle, plAngle twistLimitCenterAngle, float fStiffness);
22
23 void SetJointSurface(plUInt16 uiJointIndex, plStringView sSurface);
24 void SetJointCollisionLayer(plUInt16 uiJointIndex, plUInt8 uiCollsionLayer);
25
27 void BuildSkeleton(plSkeleton& ref_skeleton) const;
28
30 bool HasJoints() const;
31
32protected:
34 {
35 plTransform m_RestPoseLocal;
36 plTransform m_RestPoseGlobal; // this one is temporary and not stored in the final plSkeleton
37 plTransform m_InverseRestPoseGlobal;
38 plUInt16 m_uiParentIndex = plInvalidJointIndex;
39 plHashedString m_sName;
41 plQuat m_qLocalJointOrientation = plQuat::MakeIdentity();
42 plAngle m_HalfSwingLimitZ;
43 plAngle m_HalfSwingLimitY;
44 plAngle m_TwistLimitHalfAngle;
45 plAngle m_TwistLimitCenterAngle;
46 float m_fStiffness = 0.0f;
47
48 plString m_sSurface;
49 plUInt8 m_uiCollisionLayer = 0;
50 };
51
52 plDeque<BuilderJoint> m_Joints;
53};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
Definition Deque.h:270
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
static const plQuatTemplate< float > MakeIdentity()
Definition Quat_inl.h:29
The skeleton builder class provides the means to build skeleton instances from scratch....
Definition SkeletonBuilder.h:10
The skeleton class encapsulates the information about the joint structure for a model.
Definition Skeleton.h:75
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition SkeletonBuilder.h:34
Enum
Definition Declarations.h:135