PeriDyno 1.2.1
Loading...
Searching...
No Matches
dyno::JointAnimationInfo Class Reference

#include <JointInfo.h>

Inheritance diagram for dyno::JointAnimationInfo:
Collaboration diagram for dyno::JointAnimationInfo:

Public Member Functions

 JointAnimationInfo ()
 
 ~JointAnimationInfo ()
 
void setGLTFAnimationData (std::map< joint, std::vector< Vec3f > > &jointTranslation, std::map< joint, std::vector< Real > > &jointTimeCodeTranslation, std::map< joint, std::vector< Vec3f > > &jointScale, std::map< joint, std::vector< Real > > &jointIndexTimeCodeScale, std::map< joint, std::vector< Quat1f > > &jointRotation, std::map< joint, std::vector< Real > > &jointIndexRotation, std::shared_ptr< JointInfo > skeleton, bool loop=true)
 
void clear ()
 
bool isValid ()
 
bool isGltfAnimation ()
 
void resizeJointsData (int size)
 
std::vector< Vec3fgetJointsTranslation (float time)
 
std::vector< Quat1fgetJointsRotation (float time)
 
std::vector< Vec3fgetJointsScale (float time)
 
float getTotalTime ()
 
int findMaxSmallerIndex (const std::vector< float > &arr, float v)
 
Vec3f lerp (Vec3f v0, Vec3f v1, float weight)
 
Quat< Realnormalize (const Quat< Real > &q)
 
Quat< Realslerp (const Quat< Real > &q1, const Quat< Real > &q2, float weight)
 
Real lerp (Real v0, Real v1, float weight)
 
Quat< Realnlerp (const Quat< Real > &q1, const Quat< Real > &q2, float weight)
 
std::vector< int > getJointDir (int Index, std::map< int, std::vector< int > > joint_Dir)
 
void setLoop (bool loop)
 
Pose getPose (float inTime)
 
void updateAnimationPose (float inTime)
 
float getCurrentAnimationTime ()
 
float & getBlendInTime ()
 
float & getBlendOutTime ()
 
float & getPlayRate ()
 
void updateTotalTime ()
 
std::shared_ptr< JointInfo > & getSkeleton ()
 
void setSkeleton (std::shared_ptr< JointInfo > sk)
 
- Public Member Functions inherited from dyno::OBase
 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
virtual std::string getName ()
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
virtual bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true)
 Attach a field to Base.
 
template<typename T>
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Public Attributes

std::shared_ptr< JointInfomSkeleton = NULL
 
std::map< joint, std::vector< Quat1f > > mJoint_KeyId_QuatRotation
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tQuatRotation
 
std::map< joint, std::vector< Real > > mJoint_KeyId_T_X
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tT_X
 
std::map< joint, std::vector< Real > > mJoint_KeyId_T_Y
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tT_Y
 
std::map< joint, std::vector< Real > > mJoint_KeyId_T_Z
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tT_Z
 
std::map< joint, std::vector< Real > > mJoint_KeyId_R_X
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tR_X
 
std::map< joint, std::vector< Real > > mJoint_KeyId_R_Y
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tR_Y
 
std::map< joint, std::vector< Real > > mJoint_KeyId_R_Z
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tR_Z
 
std::map< joint, std::vector< Real > > mJoint_KeyId_S_X
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tS_X
 
std::map< joint, std::vector< Real > > mJoint_KeyId_S_Y
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tS_Y
 
std::map< joint, std::vector< Real > > mJoint_KeyId_S_Z
 
std::map< joint, std::vector< Real > > mJoint_KeyId_tS_Z
 

Private Types

typedef int joint
 

Private Member Functions

void updateJointsTransform (float time)
 
Transform3f updateTransform (joint jId, float time)
 
Real calculateMinTime (const std::map< joint, std::vector< Real > > &timeCodes)
 
Real calculateMaxTime (const std::map< joint, std::vector< Real > > &timeCodes)
 
void offsetTimeCodes (std::map< joint, std::vector< Real > > &timeCodes, Real offset)
 
void updateGLTFRotation (int select, Real time)
 
void updateCurrentPose (int select, Real time, std::vector< Vec3f > &currentData, std::vector< Vec3f > &bindPoseData, std::map< joint, std::vector< Real > > &animationData, std::map< joint, std::vector< Real > > &TimeCode, int channel)
 

Private Attributes

std::vector< Vec3fmTranslation
 
std::vector< Vec3fmScale
 
std::vector< Quat1fmQuatRotation
 
std::vector< Vec3fmRotator
 
DArray< Mat4fmJointWorldMatrix
 
Real mTotalTime = 0
 
Real currentTime = -1
 
bool mLoop = true
 
Real mBlendInTime = 0.0f
 
Real mBlendOutTime = 0.0f
 
Real mPlayRate = 1.0f
 
Real mAnimationTime = 0.0f
 

Additional Inherited Members

- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 
- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 
- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Detailed Description

Definition at line 211 of file JointInfo.h.

Member Typedef Documentation

◆ joint

typedef int dyno::JointAnimationInfo::joint
private

Definition at line 213 of file JointInfo.h.

Constructor & Destructor Documentation

◆ JointAnimationInfo()

dyno::JointAnimationInfo::JointAnimationInfo ( )
inline

Definition at line 217 of file JointInfo.h.

◆ ~JointAnimationInfo()

dyno::JointAnimationInfo::~JointAnimationInfo ( )

Member Function Documentation

◆ calculateMaxTime()

Real dyno::JointAnimationInfo::calculateMaxTime ( const std::map< joint, std::vector< Real > > & timeCodes)
private

◆ calculateMinTime()

Real dyno::JointAnimationInfo::calculateMinTime ( const std::map< joint, std::vector< Real > > & timeCodes)
private

◆ clear()

void dyno::JointAnimationInfo::clear ( )
inline

Definition at line 233 of file JointInfo.h.

◆ findMaxSmallerIndex()

int dyno::JointAnimationInfo::findMaxSmallerIndex ( const std::vector< float > & arr,
float v )
Here is the caller graph for this function:

◆ getBlendInTime()

float & dyno::JointAnimationInfo::getBlendInTime ( )
inline

Definition at line 331 of file JointInfo.h.

◆ getBlendOutTime()

float & dyno::JointAnimationInfo::getBlendOutTime ( )
inline

Definition at line 333 of file JointInfo.h.

◆ getCurrentAnimationTime()

float dyno::JointAnimationInfo::getCurrentAnimationTime ( )
inline

Definition at line 329 of file JointInfo.h.

◆ getJointDir()

std::vector< int > dyno::JointAnimationInfo::getJointDir ( int Index,
std::map< int, std::vector< int > > joint_Dir )

◆ getJointsRotation()

std::vector< Quat1f > dyno::JointAnimationInfo::getJointsRotation ( float time)

◆ getJointsScale()

std::vector< Vec3f > dyno::JointAnimationInfo::getJointsScale ( float time)

◆ getJointsTranslation()

std::vector< Vec3f > dyno::JointAnimationInfo::getJointsTranslation ( float time)

◆ getPlayRate()

float & dyno::JointAnimationInfo::getPlayRate ( )
inline

Definition at line 335 of file JointInfo.h.

◆ getPose()

Pose dyno::JointAnimationInfo::getPose ( float inTime)
Here is the caller graph for this function:

◆ getSkeleton()

std::shared_ptr< JointInfo > & dyno::JointAnimationInfo::getSkeleton ( )
inline

Definition at line 339 of file JointInfo.h.

◆ getTotalTime()

float dyno::JointAnimationInfo::getTotalTime ( )
inline

Definition at line 303 of file JointInfo.h.

◆ isGltfAnimation()

bool dyno::JointAnimationInfo::isGltfAnimation ( )
inline

Definition at line 282 of file JointInfo.h.

◆ isValid()

bool dyno::JointAnimationInfo::isValid ( )
inline

Definition at line 278 of file JointInfo.h.

◆ lerp() [1/2]

Real dyno::JointAnimationInfo::lerp ( Real v0,
Real v1,
float weight )

◆ lerp() [2/2]

Vec3f dyno::JointAnimationInfo::lerp ( Vec3f v0,
Vec3f v1,
float weight )
Here is the caller graph for this function:

◆ nlerp()

Quat< Real > dyno::JointAnimationInfo::nlerp ( const Quat< Real > & q1,
const Quat< Real > & q2,
float weight )
Here is the caller graph for this function:

◆ normalize()

Quat< Real > dyno::JointAnimationInfo::normalize ( const Quat< Real > & q)

◆ offsetTimeCodes()

void dyno::JointAnimationInfo::offsetTimeCodes ( std::map< joint, std::vector< Real > > & timeCodes,
Real offset )
inlineprivate

Definition at line 351 of file JointInfo.h.

◆ resizeJointsData()

void dyno::JointAnimationInfo::resizeJointsData ( int size)
inline

Definition at line 287 of file JointInfo.h.

◆ setGLTFAnimationData()

void dyno::JointAnimationInfo::setGLTFAnimationData ( std::map< joint, std::vector< Vec3f > > & jointTranslation,
std::map< joint, std::vector< Real > > & jointTimeCodeTranslation,
std::map< joint, std::vector< Vec3f > > & jointScale,
std::map< joint, std::vector< Real > > & jointIndexTimeCodeScale,
std::map< joint, std::vector< Quat1f > > & jointRotation,
std::map< joint, std::vector< Real > > & jointIndexRotation,
std::shared_ptr< JointInfo > skeleton,
bool loop = true )

◆ setLoop()

void dyno::JointAnimationInfo::setLoop ( bool loop)
inline

Definition at line 318 of file JointInfo.h.

◆ setSkeleton()

void dyno::JointAnimationInfo::setSkeleton ( std::shared_ptr< JointInfo > sk)
inline

Definition at line 341 of file JointInfo.h.

◆ slerp()

Quat< Real > dyno::JointAnimationInfo::slerp ( const Quat< Real > & q1,
const Quat< Real > & q2,
float weight )

◆ updateAnimationPose()

void dyno::JointAnimationInfo::updateAnimationPose ( float inTime)
inline

Definition at line 322 of file JointInfo.h.

Here is the call graph for this function:

◆ updateCurrentPose()

void dyno::JointAnimationInfo::updateCurrentPose ( int select,
Real time,
std::vector< Vec3f > & currentData,
std::vector< Vec3f > & bindPoseData,
std::map< joint, std::vector< Real > > & animationData,
std::map< joint, std::vector< Real > > & TimeCode,
int channel )
inlineprivate

Definition at line 387 of file JointInfo.h.

Here is the call graph for this function:

◆ updateGLTFRotation()

void dyno::JointAnimationInfo::updateGLTFRotation ( int select,
Real time )
inlineprivate

Definition at line 359 of file JointInfo.h.

Here is the call graph for this function:

◆ updateJointsTransform()

void dyno::JointAnimationInfo::updateJointsTransform ( float time)
private

◆ updateTotalTime()

void dyno::JointAnimationInfo::updateTotalTime ( )

◆ updateTransform()

Transform3f dyno::JointAnimationInfo::updateTransform ( joint jId,
float time )
private

Member Data Documentation

◆ currentTime

Real dyno::JointAnimationInfo::currentTime = -1
private

Definition at line 455 of file JointInfo.h.

◆ mAnimationTime

Real dyno::JointAnimationInfo::mAnimationTime = 0.0f
private

Definition at line 462 of file JointInfo.h.

◆ mBlendInTime

Real dyno::JointAnimationInfo::mBlendInTime = 0.0f
private

Definition at line 458 of file JointInfo.h.

◆ mBlendOutTime

Real dyno::JointAnimationInfo::mBlendOutTime = 0.0f
private

Definition at line 459 of file JointInfo.h.

◆ mJoint_KeyId_QuatRotation

std::map<joint, std::vector<Quat1f> > dyno::JointAnimationInfo::mJoint_KeyId_QuatRotation

Definition at line 419 of file JointInfo.h.

◆ mJoint_KeyId_R_X

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_R_X

Definition at line 430 of file JointInfo.h.

◆ mJoint_KeyId_R_Y

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_R_Y

Definition at line 432 of file JointInfo.h.

◆ mJoint_KeyId_R_Z

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_R_Z

Definition at line 434 of file JointInfo.h.

◆ mJoint_KeyId_S_X

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_S_X

Definition at line 437 of file JointInfo.h.

◆ mJoint_KeyId_S_Y

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_S_Y

Definition at line 439 of file JointInfo.h.

◆ mJoint_KeyId_S_Z

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_S_Z

Definition at line 441 of file JointInfo.h.

◆ mJoint_KeyId_T_X

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_T_X

Definition at line 423 of file JointInfo.h.

◆ mJoint_KeyId_T_Y

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_T_Y

Definition at line 425 of file JointInfo.h.

◆ mJoint_KeyId_T_Z

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_T_Z

Definition at line 427 of file JointInfo.h.

◆ mJoint_KeyId_tQuatRotation

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tQuatRotation

Definition at line 420 of file JointInfo.h.

◆ mJoint_KeyId_tR_X

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tR_X

Definition at line 431 of file JointInfo.h.

◆ mJoint_KeyId_tR_Y

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tR_Y

Definition at line 433 of file JointInfo.h.

◆ mJoint_KeyId_tR_Z

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tR_Z

Definition at line 435 of file JointInfo.h.

◆ mJoint_KeyId_tS_X

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tS_X

Definition at line 438 of file JointInfo.h.

◆ mJoint_KeyId_tS_Y

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tS_Y

Definition at line 440 of file JointInfo.h.

◆ mJoint_KeyId_tS_Z

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tS_Z

Definition at line 442 of file JointInfo.h.

◆ mJoint_KeyId_tT_X

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tT_X

Definition at line 424 of file JointInfo.h.

◆ mJoint_KeyId_tT_Y

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tT_Y

Definition at line 426 of file JointInfo.h.

◆ mJoint_KeyId_tT_Z

std::map<joint, std::vector<Real> > dyno::JointAnimationInfo::mJoint_KeyId_tT_Z

Definition at line 428 of file JointInfo.h.

◆ mJointWorldMatrix

DArray<Mat4f> dyno::JointAnimationInfo::mJointWorldMatrix
private

Definition at line 451 of file JointInfo.h.

◆ mLoop

bool dyno::JointAnimationInfo::mLoop = true
private

Definition at line 457 of file JointInfo.h.

◆ mPlayRate

Real dyno::JointAnimationInfo::mPlayRate = 1.0f
private

Definition at line 460 of file JointInfo.h.

◆ mQuatRotation

std::vector<Quat1f> dyno::JointAnimationInfo::mQuatRotation
private

Definition at line 448 of file JointInfo.h.

◆ mRotator

std::vector<Vec3f> dyno::JointAnimationInfo::mRotator
private

Definition at line 449 of file JointInfo.h.

◆ mScale

std::vector<Vec3f> dyno::JointAnimationInfo::mScale
private

Definition at line 447 of file JointInfo.h.

◆ mSkeleton

std::shared_ptr<JointInfo> dyno::JointAnimationInfo::mSkeleton = NULL

Definition at line 416 of file JointInfo.h.

◆ mTotalTime

Real dyno::JointAnimationInfo::mTotalTime = 0
private

Definition at line 453 of file JointInfo.h.

◆ mTranslation

std::vector<Vec3f> dyno::JointAnimationInfo::mTranslation
private

Definition at line 446 of file JointInfo.h.


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