- 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
21 class CalCoreSkeleton;
22 class CalCoreModel;
23
24
25 class CAL3D_API CalCoreBone
26{
27 public:
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();
36 CalCoreSkeleton *getCoreSkeleton();
37 const CalQuaternion& getRotation();
38 const CalQuaternion& getRotationAbsolute();
39 const CalQuaternion& getRotationBoneSpace();
40 const CalVector& getTranslation();
41 const CalVector& getTranslationAbsolute();
42 const CalVector& getTranslationBoneSpace();
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);
53 CalBoundingBox & getBoundingBox();
54 void getBoundingData(int planeId,CalVector & position);
55 bool isBoundingBoxPrecomputed();
56 void scale(float factor);
57
58 private:
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//****************************************************************************//
CalBoundingBox
The bounding box class.
Definition vector.h:221
CalCoreBone::setRotation
void setRotation(const CalQuaternion &rotation)
Sets the rotation.
Definition corebone.cpp:286
CalCoreBone::getTranslation
const CalVector & getTranslation()
Returns the translation.
Definition corebone.cpp:190
CalCoreBone::setCoreSkeleton
void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton)
Sets the core skeleton.
Definition corebone.cpp:245
CalCoreBone::calculateBoundingBox
void calculateBoundingBox(CalCoreModel *pCoreModel)
Calculates the bounding box.
Definition corebone.cpp:352
CalCoreBone::setTranslation
void setTranslation(const CalVector &translation)
Sets the translation.
Definition corebone.cpp:313
CalCoreBone::addChildId
bool addChildId(int childId)
Adds a child ID.
Definition corebone.cpp:55
CalCoreBone::getUserData
Cal::UserData getUserData()
Provides access to the user data.
Definition corebone.cpp:230
CalCoreBone::getTranslationAbsolute
const CalVector & getTranslationAbsolute()
Returns the absolute translation.
Definition corebone.cpp:203
CalCoreBone::getTranslationBoneSpace
const CalVector & getTranslationBoneSpace()
Returns the bone space translation.
Definition corebone.cpp:217
CalCoreBone::getRotationAbsolute
const CalQuaternion & getRotationAbsolute()
Returns the absolute rotation.
Definition corebone.cpp:163
CalCoreBone::scale
void scale(float factor)
Scale the core bone.
Definition corebone.cpp:473
CalCoreBone::setRotationBoneSpace
void setRotationBoneSpace(const CalQuaternion &rotation)
Sets the bone space rotation.
Definition corebone.cpp:300
CalCoreBone::calculateState
void calculateState()
Calculates the current state.
Definition corebone.cpp:69
CalCoreBone::getRotation
const CalQuaternion & getRotation()
Returns the rotation.
Definition corebone.cpp:150
CalCoreBone::getListChildId
std::list< int > & getListChildId()
Returns the child ID list.
Definition corebone.cpp:109
CalCoreBone::setParentId
void setParentId(int parentId)
Sets the parent ID.
Definition corebone.cpp:258
CalCoreBone::getName
const std::string & getName()
Returns the name.
Definition corebone.cpp:122
CalCoreBone::setUserData
void setUserData(Cal::UserData userData)
Stores user data.
Definition corebone.cpp:340
CalCoreBone::CalCoreBone
CalCoreBone(const std::string &name)
Constructs the core bone instance.
Definition corebone.cpp:32
CalCoreBone::getBoundingBox
CalBoundingBox & getBoundingBox()
Returns the current bounding box.
Definition corebone.cpp:445
CalCoreBone::getParentId
int getParentId()
Returns the parent ID.
Definition corebone.cpp:137
CalCoreBone::setTranslationBoneSpace
void setTranslationBoneSpace(const CalVector &translation)
Sets the bone space translation.
Definition corebone.cpp:327
CalCoreBone::getCoreSkeleton
CalCoreSkeleton * getCoreSkeleton()
Provides access to the core skeleton.
Definition corebone.cpp:273
CalCoreBone::getRotationBoneSpace
const CalQuaternion & getRotationBoneSpace()
Returns the bone space rotation.
Definition corebone.cpp:177
CalCoreModel
Definition coremodel.h:26
CalCoreSkeleton
Definition coreskeleton.h:24
CalQuaternion
The quaternion class.
Definition quaternion.h:36
CalVector
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.15.0