PixelLightAPI  .
Public Member Functions
PLMesh::SkeletonHandler Class Reference

Skeleton handler code. More...

#include <SkeletonHandler.h>

Inheritance diagram for PLMesh::SkeletonHandler:
Inheritance graph
[legend]

List of all members.

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 JointHandlerGetJointHandler (const PLCore::String &sJointName) const
 Returns a joint handler by name.
PLMESH_API PLCore::Array
< JointHandler > & 
GetBaseJointHandlers ()
 Returns the base joint handlers.
PLMESH_API JointHandlerGetBaseJointHandler (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

Detailed Description

Skeleton handler code.

Remarks:
*    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
*  

Constructor & Destructor Documentation

Constructor.

virtual PLMESH_API PLMesh::SkeletonHandler::~SkeletonHandler ( ) [virtual]

Destructor.


Member Function Documentation

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.

Parameters:
[in]cRendererRenderer to use
[in]cColorColor to use
[in]mWorldViewProjectionWorld view projection matrix to use
[in]fPointSizePoint size
PLMESH_API void PLMesh::SkeletonHandler::DrawJointNames ( PLRenderer::Font cFont,
const PLGraphics::Color4 cColor,
const PLMath::Matrix4x4 mWorldViewProjection 
) const

Draws the joint names.

Parameters:
[in]cFontFont to use
[in]cColorColor to use
[in]mWorldViewProjectionWorld 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.

Parameters:
[in]cRendererRenderer to use
[in]cColorColor to use
[in]mWorldViewProjectionWorld view projection matrix to use
[in]fLineWidthLine width

Returns the current joint handlers.

Returns:
Current joint handlers
PLMESH_API JointHandler* PLMesh::SkeletonHandler::GetJointHandler ( const PLCore::String sJointName) const

Returns a joint handler by name.

Parameters:
[in]sJointNameName of the joint to return the handler from
Returns:
Joint handler, a null pointer on error

Returns the base joint handlers.

Returns:
Base joint handlers

Returns a base joint handler by name.

Parameters:
[in]sJointNameName of the base joint to return the handler from
Returns:
Base joint handler, a null pointer on error
PLMESH_API bool PLMesh::SkeletonHandler::ResetJointStates ( bool  bForceAll = false)

Resets all current joint states.

Parameters:
[in]bForceAllIf 'true', user controlled joints are reset, too
Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)

Resets all base joint states to the skeleton 'orginal' base joint states.

Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)
PLMESH_API bool PLMesh::SkeletonHandler::ApplyJointStates ( PLCore::uint32  nFrame,
float  fWeight = 1.0f 
)

Applies the joint states from the given skeleton animation frame to the current joint states.

Parameters:
[in]nFrameSkeleton animation frame
[in]fWeightWeight (0.0-1.0)
Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)
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.

Parameters:
[in]nFrame1Skeleton animation frame 1
[in]nFrame2Skeleton animation frame 2
[in]fTimeSkeleton animation time (0.0-1.0)
[in]fWeightWeight (0.0-1.0)
Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)
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.

Parameters:
[in]cSkeletonHandlerSkeleton handler to use
[in]fWeightWeight (0.0-1.0)
Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)
Note:
  • In order to apply the pSkeletonHandler joint states correctly, it should only consist of deltas. (ApplyBaseJointStates() not done...)

Applies the base joint states to the current joint states.

Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)

Calculates all current absolute joint states.

Returns:
'true' if all went fine, else 'false' (maybe no skeleton set?)
Note:
  • Before applying this skeleton handler on for instance a mesh you have to call this function to calculate all current absolute joint states!
virtual PLMESH_API bool PLMesh::SkeletonHandler::SetResource ( Skeleton pResource = nullptr) [override, virtual]

The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:21
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported