PixelLightAPI
.
|
Skeleton handler code. More...
#include <SkeletonHandler.h>
Public Member Functions | |
PLMESH_API | SkeletonHandler () |
Constructor. | |
virtual PLMESH_API | ~SkeletonHandler () |
Destructor. | |
PLMESH_API void | DrawJoints (PLRenderer::Renderer &cRenderer, const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection, float fPointSize=1.0f) const |
Draws the joints. | |
PLMESH_API void | DrawJointNames (PLRenderer::Font &cFont, const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection) const |
Draws the joint names. | |
PLMESH_API void | DrawSkeleton (PLRenderer::Renderer &cRenderer, const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection, float fLineWidth=1.0f) const |
Draws the skeleton. | |
PLMESH_API PLCore::Array < JointHandler > & | GetJointHandlers () |
Returns the current joint handlers. | |
PLMESH_API const PLCore::Array < JointHandler > & | GetJointHandlers () const |
PLMESH_API JointHandler * | GetJointHandler (const PLCore::String &sJointName) const |
Returns a joint handler by name. | |
PLMESH_API PLCore::Array < JointHandler > & | GetBaseJointHandlers () |
Returns the base joint handlers. | |
PLMESH_API JointHandler * | GetBaseJointHandler (const PLCore::String &sJointName) const |
Returns a base joint handler by name. | |
PLMESH_API bool | ResetJointStates (bool bForceAll=false) |
Resets all current joint states. | |
PLMESH_API bool | ResetBaseJointStates () |
Resets all base joint states to the skeleton 'orginal' base joint states. | |
PLMESH_API bool | ApplyJointStates (PLCore::uint32 nFrame, float fWeight=1.0f) |
Applies the joint states from the given skeleton animation frame to the current joint states. | |
PLMESH_API bool | ApplyJointStates (PLCore::uint32 nFrame1, PLCore::uint32 nFrame2, float fTime, float fWeight=1.0f) |
Applies the blended joint states from the given joint animation frames to the current joint states. | |
PLMESH_API bool | ApplyJointStates (SkeletonHandler &cSkeletonHandler, float fWeight=1.0f) |
Applies the current joint states from the given joint handler to the current joint states. | |
PLMESH_API bool | ApplyBaseJointStates () |
Applies the base joint states to the current joint states. | |
PLMESH_API bool | CalculateStates () |
Calculates all current absolute joint states. | |
virtual PLMESH_API bool | SetResource (Skeleton *pResource=nullptr) override |
Skeleton handler code.
* Skeleton handler animation example:\n * ResetJointStates(); // Reset current joint states\n * ApplyJointStates(2, 3, 0.5f); // Apply frame 2.5 of the skeleton animation to the current joint states\n * ApplyJointStates(cRun); // Apply the current joint states of the skeleton animation handler\n * // cRun to the current joint states. Note that we want to add the delta \n * // values from cRun, so, within this handler the base joint states are NOT added!\n * ApplyBaseJointStates(); // Apply base joint states to get the final pose\n * CalculateStates(); // Complete the current joint states *
PLMESH_API PLMesh::SkeletonHandler::SkeletonHandler | ( | ) |
Constructor.
virtual PLMESH_API PLMesh::SkeletonHandler::~SkeletonHandler | ( | ) | [virtual] |
Destructor.
PLMESH_API void PLMesh::SkeletonHandler::DrawJoints | ( | PLRenderer::Renderer & | cRenderer, |
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Matrix4x4 & | mWorldViewProjection, | ||
float | fPointSize = 1.0f |
||
) | const |
Draws the joints.
[in] | cRenderer | Renderer to use |
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
[in] | fPointSize | Point size |
PLMESH_API void PLMesh::SkeletonHandler::DrawJointNames | ( | PLRenderer::Font & | cFont, |
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Matrix4x4 & | mWorldViewProjection | ||
) | const |
Draws the joint names.
[in] | cFont | Font to use |
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
PLMESH_API void PLMesh::SkeletonHandler::DrawSkeleton | ( | PLRenderer::Renderer & | cRenderer, |
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Matrix4x4 & | mWorldViewProjection, | ||
float | fLineWidth = 1.0f |
||
) | const |
Draws the skeleton.
[in] | cRenderer | Renderer to use |
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
[in] | fLineWidth | Line width |
PLMESH_API PLCore::Array<JointHandler>& PLMesh::SkeletonHandler::GetJointHandlers | ( | ) |
Returns the current joint handlers.
PLMESH_API const PLCore::Array<JointHandler>& PLMesh::SkeletonHandler::GetJointHandlers | ( | ) | const |
PLMESH_API JointHandler* PLMesh::SkeletonHandler::GetJointHandler | ( | const PLCore::String & | sJointName | ) | const |
Returns a joint handler by name.
[in] | sJointName | Name of the joint to return the handler from |
PLMESH_API PLCore::Array<JointHandler>& PLMesh::SkeletonHandler::GetBaseJointHandlers | ( | ) |
Returns the base joint handlers.
PLMESH_API JointHandler* PLMesh::SkeletonHandler::GetBaseJointHandler | ( | const PLCore::String & | sJointName | ) | const |
Returns a base joint handler by name.
[in] | sJointName | Name of the base joint to return the handler from |
PLMESH_API bool PLMesh::SkeletonHandler::ResetJointStates | ( | bool | bForceAll = false | ) |
Resets all current joint states.
[in] | bForceAll | If 'true', user controlled joints are reset, too |
PLMESH_API bool PLMesh::SkeletonHandler::ResetBaseJointStates | ( | ) |
Resets all base joint states to the skeleton 'orginal' base joint states.
PLMESH_API bool PLMesh::SkeletonHandler::ApplyJointStates | ( | PLCore::uint32 | nFrame, |
float | fWeight = 1.0f |
||
) |
PLMESH_API bool PLMesh::SkeletonHandler::ApplyJointStates | ( | PLCore::uint32 | nFrame1, |
PLCore::uint32 | nFrame2, | ||
float | fTime, | ||
float | fWeight = 1.0f |
||
) |
Applies the blended joint states from the given joint animation frames to the current joint states.
[in] | nFrame1 | Skeleton animation frame 1 |
[in] | nFrame2 | Skeleton animation frame 2 |
[in] | fTime | Skeleton animation time (0.0-1.0) |
[in] | fWeight | Weight (0.0-1.0) |
PLMESH_API bool PLMesh::SkeletonHandler::ApplyJointStates | ( | SkeletonHandler & | cSkeletonHandler, |
float | fWeight = 1.0f |
||
) |
Applies the current joint states from the given joint handler to the current joint states.
PLMESH_API bool PLMesh::SkeletonHandler::ApplyBaseJointStates | ( | ) |
Applies the base joint states to the current joint states.
PLMESH_API bool PLMesh::SkeletonHandler::CalculateStates | ( | ) |
Calculates all current absolute joint states.
virtual PLMESH_API bool PLMesh::SkeletonHandler::SetResource | ( | Skeleton * | pResource = nullptr | ) | [override, virtual] |
|