- Cal3D 0.11 API Reference -

bone.h
1//****************************************************************************//
2// bone.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_BONE_H
12#define CAL_BONE_H
13
14
15#include "cal3d/global.h"
16#include "cal3d/vector.h"
17#include "cal3d/quaternion.h"
18#include "cal3d/matrix.h"
19#include "cal3d/corebone.h"
20
21
22//class CalCoreBone;
23class CalSkeleton;
24class CalModel;
25class CalCoreModel;
26
27
28class CAL3D_API CalBone
29{
30public:
31 CalBone(CalCoreBone *coreBone);
32 ~CalBone() { }
33
34 void blendState(float unrampedWeight, const CalVector& translation,
35 const CalQuaternion & rotation, float scale = 1.0f,
36 bool replace = false, float rampValue = 1.0f,
37 bool absoluteTranslation = true);
38 void calculateState();
39 void clearState();
41 const CalCoreBone *getCoreBone() const;
43 void setCoreState();
45 void setRotation(const CalQuaternion& rotation);
46 const CalQuaternion& getRotation() const;
49 void setTranslation(const CalVector& translation);
50 const CalVector& getTranslation() const;
51 const CalVector& getTranslationAbsolute() const;
52 inline void setMeshScaleAbsolute( CalVector const & sv ) {
53 m_meshScaleAbsolute = sv; }
54 inline const CalVector& getTranslationBoneSpace() const{
55 return m_translationBoneSpace;
56 }
57 inline const CalMatrix& getTransformMatrix() const{
58 return m_transformMatrix;
59 }
60 void lockState();
61 void setSkeleton(CalSkeleton *pSkeleton);
64 const CalBoundingBox & getBoundingBox() const;
65
66private:
67 CalCoreBone *m_pCoreBone;
68 CalSkeleton *m_pSkeleton;
69 float m_accumulatedWeight;
70 float m_accumulatedWeightAbsolute;
71 float m_accumulatedReplacementAttenuation;
72 float m_firstBlendScale;
73 CalVector m_meshScaleAbsolute; // w.r.t. absolute coord system in 3dsMax (Z up), not local coord of bone.
74 CalVector m_translation;
75 CalQuaternion m_rotation;
76 CalVector m_translationAbsolute;
77 CalQuaternion m_rotationAbsolute;
78 CalVector m_translationBoneSpace;
79 CalQuaternion m_rotationBoneSpace;
80 CalMatrix m_transformMatrix;
81 CalBoundingBox m_boundingBox;
82};
83
84#endif
85
86//****************************************************************************//
const CalQuaternion & getRotationAbsolute() const
Returns the current absolute rotation.
Definition bone.cpp:473
void setCoreTransformStateVariables()
Resets the bone transform state variables for rotation and translation.
Definition bone.cpp:383
const CalVector & getTranslationAbsolute() const
Returns the current absolute translation.
Definition bone.cpp:528
void lockState()
Returns the current bone space translation.
Definition bone.cpp:559
void calculateBoundingBox()
Calculates the bounding box.
Definition bone.cpp:615
const CalQuaternion & getRotationBoneSpace() const
Returns the current bone space rotation.
Definition bone.cpp:487
CalBoundingBox & getBoundingBox()
Returns the current bounding box.
Definition bone.cpp:675
void clearState()
Clears the current state.
Definition bone.cpp:335
void setTranslation(const CalVector &translation)
Sets the current translation.
Definition bone.cpp:500
CalCoreBone * getCoreBone()
Provides access to the core bone.
Definition bone.cpp:355
void setSkeleton(CalSkeleton *pSkeleton)
Sets the skeleton.
Definition bone.cpp:602
void setRotation(const CalQuaternion &rotation)
Sets the current rotation.
Definition bone.cpp:445
const CalVector & getTranslation() const
Returns the current translation.
Definition bone.cpp:515
void calculateState()
Calculates the current state.
Definition bone.cpp:174
const CalQuaternion & getRotation() const
Returns the current rotation.
Definition bone.cpp:460
void setCoreStateRecursive()
Resets the bone and children to core states.
Definition bone.cpp:417
void setCoreState()
Resets the bone to its core state.
Definition bone.cpp:397
void blendState(float unrampedWeight, const CalVector &translation, const CalQuaternion &rotation, float scale=1.0f, bool replace=false, float rampValue=1.0f, bool absoluteTranslation=true)
Interpolates the current state to another state.
Definition bone.cpp:50
The bounding box class.
Definition vector.h:223
Definition corebone.h:35
Definition coremodel.h:26
The matrix class.
Definition matrix.h:35
Definition model.h:31
The quaternion class.
Definition quaternion.h:36
Definition skeleton.h:21
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.13.2