- 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;
23 class CalSkeleton;
24 class CalModel;
25 class CalCoreModel;
26
27
28 class CAL3D_API CalBone
29{
30 public:
31 CalBone(CalCoreBone* coreBone);
32 ~CalBone() { }
33
34 void blendState(float weight, const CalVector& translation, const CalQuaternion& rotation);
35 void calculateState();
36 void clearState();
37 CalCoreBone *getCoreBone();
38 void setCoreState();
39 void setCoreStateRecursive();
40 void setRotation(const CalQuaternion& rotation);
41 const CalQuaternion& getRotation();
42 const CalQuaternion& getRotationAbsolute();
43 const CalQuaternion& getRotationBoneSpace();
44 void setTranslation(const CalVector& translation);
45 const CalVector& getTranslation();
46 const CalVector& getTranslationAbsolute();
47 const CalVector& getTranslationBoneSpace();
48 const CalMatrix& getTransformMatrix();
49 void lockState();
50 void setSkeleton(CalSkeleton *pSkeleton);
51 void calculateBoundingBox();
52 CalBoundingBox & getBoundingBox();
53
54 private:
55 CalCoreBone *m_pCoreBone;
56 CalSkeleton *m_pSkeleton;
57 float m_accumulatedWeight;
58 float m_accumulatedWeightAbsolute;
59 CalVector m_translation;
60 CalQuaternion m_rotation;
61 CalVector m_translationAbsolute;
62 CalQuaternion m_rotationAbsolute;
63 CalVector m_translationBoneSpace;
64 CalQuaternion m_rotationBoneSpace;
65 CalMatrix m_transformMatrix;
66 CalBoundingBox m_boundingBox;
67};
68
69#endif
70
71//****************************************************************************//
CalBone::getTranslationBoneSpace
const CalVector & getTranslationBoneSpace()
Returns the current bone space translation.
Definition bone.cpp:315
CalBone::getRotationBoneSpace
const CalQuaternion & getRotationBoneSpace()
Returns the current bone space rotation.
Definition bone.cpp:260
CalBone::lockState
void lockState()
Locks the current state.
Definition bone.cpp:342
CalBone::calculateBoundingBox
void calculateBoundingBox()
Calculates the bounding box.
Definition bone.cpp:398
CalBone::getTranslation
const CalVector & getTranslation()
Returns the current translation.
Definition bone.cpp:288
CalBone::getTransformMatrix
const CalMatrix & getTransformMatrix()
Returns the current bone space translation.
Definition bone.cpp:329
CalBone::getBoundingBox
CalBoundingBox & getBoundingBox()
Returns the current bounding box.
Definition bone.cpp:458
CalBone::clearState
void clearState()
Clears the current state.
Definition bone.cpp:139
CalBone::setTranslation
void setTranslation(const CalVector &translation)
Sets the current translation.
Definition bone.cpp:273
CalBone::getCoreBone
CalCoreBone * getCoreBone()
Provides access to the core bone.
Definition bone.cpp:156
CalBone::setSkeleton
void setSkeleton(CalSkeleton *pSkeleton)
Sets the skeleton.
Definition bone.cpp:385
CalBone::setRotation
void setRotation(const CalQuaternion &rotation)
Sets the current rotation.
Definition bone.cpp:218
CalBone::calculateState
void calculateState()
Calculates the current state.
Definition bone.cpp:77
CalBone::setCoreStateRecursive
void setCoreStateRecursive()
Resets the bone and children to core states.
Definition bone.cpp:190
CalBone::getRotationAbsolute
const CalQuaternion & getRotationAbsolute()
Returns the current absolute rotation.
Definition bone.cpp:246
CalBone::blendState
void blendState(float weight, const CalVector &translation, const CalQuaternion &rotation)
Interpolates the current state to another state.
Definition bone.cpp:46
CalBone::getTranslationAbsolute
const CalVector & getTranslationAbsolute()
Returns the current absolute translation.
Definition bone.cpp:301
CalBone::getRotation
const CalQuaternion & getRotation()
Returns the current rotation.
Definition bone.cpp:233
CalBone::setCoreState
void setCoreState()
Resets the bone to its core state.
Definition bone.cpp:169
CalBoundingBox
The bounding box class.
Definition vector.h:221
CalCoreBone
Definition corebone.h:26
CalCoreModel
Definition coremodel.h:26
CalMatrix
The matrix class.
Definition matrix.h:35
CalModel
Definition model.h:31
CalQuaternion
The quaternion class.
Definition quaternion.h:36
CalSkeleton
Definition skeleton.h:21
CalVector
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.15.0