- Cal3D 0.11 API Reference -

corebone.h
1//****************************************************************************//
2// corebone.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_COREBONE_H
12#define CAL_COREBONE_H
13
14
15#include "cal3d/global.h"
16#include "cal3d/matrix.h"
17#include "cal3d/vector.h"
18#include "cal3d/quaternion.h"
19
20
21class CalCoreSkeleton;
22class CalCoreModel;
23
24
25class CAL3D_API CalCoreBone
26{
27public:
28 CalCoreBone(const std::string& name);
29 ~CalCoreBone() { }
30
31 bool addChildId(int childId);
32 void calculateState();
33 std::list<int>& getListChildId();
34 const std::string& getName();
35 int getParentId();
43 Cal::UserData getUserData();
44 void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton);
45 void setParentId(int parentId);
46 void setRotation(const CalQuaternion& rotation);
47 void setRotationBoneSpace(const CalQuaternion& rotation);
48 void setTranslation(const CalVector& translation);
49 void setTranslationBoneSpace(const CalVector& translation);
50 void setUserData(Cal::UserData userData);
51
52 void calculateBoundingBox(CalCoreModel * pCoreModel);
54 void getBoundingData(int planeId,CalVector & position);
55 bool isBoundingBoxPrecomputed();
56 void scale(float factor);
57
58private:
59 std::string m_strName;
60 CalCoreSkeleton *m_pCoreSkeleton;
61 int m_parentId;
62 std::list<int> m_listChildId;
63 CalVector m_translation;
64 CalQuaternion m_rotation;
65 CalVector m_translationAbsolute;
66 CalQuaternion m_rotationAbsolute;
67 CalVector m_translationBoneSpace;
68 CalQuaternion m_rotationBoneSpace;
69 Cal::UserData m_userData;
70
71 CalBoundingBox m_boundingBox;
72 CalVector m_boundingPosition[6];
73 bool m_boundingBoxPrecomputed;
74};
75
76#endif
77
78//****************************************************************************//
The bounding box class.
Definition vector.h:221
void setRotation(const CalQuaternion &rotation)
Sets the rotation.
Definition corebone.cpp:286
const CalVector & getTranslation()
Returns the translation.
Definition corebone.cpp:190
void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton)
Sets the core skeleton.
Definition corebone.cpp:245
void calculateBoundingBox(CalCoreModel *pCoreModel)
Calculates the bounding box.
Definition corebone.cpp:352
void setTranslation(const CalVector &translation)
Sets the translation.
Definition corebone.cpp:313
bool addChildId(int childId)
Adds a child ID.
Definition corebone.cpp:55
Cal::UserData getUserData()
Provides access to the user data.
Definition corebone.cpp:230
const CalVector & getTranslationAbsolute()
Returns the absolute translation.
Definition corebone.cpp:203
const CalVector & getTranslationBoneSpace()
Returns the bone space translation.
Definition corebone.cpp:217
const CalQuaternion & getRotationAbsolute()
Returns the absolute rotation.
Definition corebone.cpp:163
void scale(float factor)
Scale the core bone.
Definition corebone.cpp:473
void setRotationBoneSpace(const CalQuaternion &rotation)
Sets the bone space rotation.
Definition corebone.cpp:300
void calculateState()
Calculates the current state.
Definition corebone.cpp:69
const CalQuaternion & getRotation()
Returns the rotation.
Definition corebone.cpp:150
std::list< int > & getListChildId()
Returns the child ID list.
Definition corebone.cpp:109
void setParentId(int parentId)
Sets the parent ID.
Definition corebone.cpp:258
const std::string & getName()
Returns the name.
Definition corebone.cpp:122
void setUserData(Cal::UserData userData)
Stores user data.
Definition corebone.cpp:340
CalCoreBone(const std::string &name)
Constructs the core bone instance.
Definition corebone.cpp:32
CalBoundingBox & getBoundingBox()
Returns the current bounding box.
Definition corebone.cpp:445
int getParentId()
Returns the parent ID.
Definition corebone.cpp:137
void setTranslationBoneSpace(const CalVector &translation)
Sets the bone space translation.
Definition corebone.cpp:327
CalCoreSkeleton * getCoreSkeleton()
Provides access to the core skeleton.
Definition corebone.cpp:273
const CalQuaternion & getRotationBoneSpace()
Returns the bone space rotation.
Definition corebone.cpp:177
Definition coremodel.h:26
Definition coreskeleton.h:24
The quaternion class.
Definition quaternion.h:36
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.15.0