- 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
25enum CalLightType {
26 LIGHT_TYPE_NONE,
27 LIGHT_TYPE_OMNI,
28 LIGHT_TYPE_DIRECTIONAL,
29 LIGHT_TYPE_TARGET,
30 LIGHT_TYPE_AMBIENT
31};
32
33
34class CAL3D_API CalCoreBone
35{
36public:
37 CalCoreBone(const std::string& name);
38 ~CalCoreBone() { }
39
40 bool addChildId(int childId);
41 void calculateState();
42 std::list<int>& getListChildId();
43 const std::string& getNameInternal();
44 void setNameInternal( std::string& str ) { m_strName = str; }
45 const std::list<int>& getListChildId() const;
46 const std::string& getName() const;
47 void setName( const std::string& name );
48 int getParentId() const;
49 void setName( char const * str ) { m_strName = str; }
51 const CalCoreSkeleton *getCoreSkeleton() const;
52 const CalQuaternion& getRotation() const;
55 const CalVector& getTranslation() const;
56 const CalVector& getTranslationAbsolute() const;
58 Cal::UserData getUserData();
59 const Cal::UserData getUserData() const;
60 void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton);
61 void setParentId(int parentId);
62 void setRotation(const CalQuaternion& rotation);
63 void setRotationBoneSpace(const CalQuaternion& rotation);
64 void setTranslation(const CalVector& translation);
65 void setTranslationBoneSpace(const CalVector& translation);
66 void setUserData(Cal::UserData userData);
67
68 void initBoundingBox();
69 void calculateBoundingBox(CalCoreModel * pCoreModel);
71 const CalBoundingBox & getBoundingBox() const;
72 void getBoundingData(int planeId,CalVector & position) const;
73 bool isBoundingBoxPrecomputed() const;
74 void setBoundingBoxPrecomputed( bool inComputed );
75 bool updateBoundingBox(const CalVector &position);
76 void scale(float factor);
77
78 bool hasLightingData();
79 void getLightColor( CalVector & );
80 void setLightColor( CalVector const & );
81 CalLightType getLightType();
82 void setLightType( CalLightType );
83
84private:
85 std::string m_strName;
86 CalCoreSkeleton *m_pCoreSkeleton;
87 int m_parentId;
88 std::list<int> m_listChildId;
89 CalVector m_translation;
90 CalQuaternion m_rotation;
91 CalVector m_translationAbsolute;
92 CalQuaternion m_rotationAbsolute;
93 CalVector m_translationBoneSpace;
94 CalQuaternion m_rotationBoneSpace;
95 Cal::UserData m_userData;
96
97 CalBoundingBox m_boundingBox;
98 CalVector m_boundingPosition[6];
99 bool m_boundingBoxPrecomputed;
100 CalVector m_lightColor;
101 CalLightType m_lightType;
102
103};
104
105#endif
106
107//****************************************************************************//
The bounding box class.
Definition vector.h:223
void setRotation(const CalQuaternion &rotation)
Sets the rotation.
Definition corebone.cpp:345
void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton)
Sets the core skeleton.
Definition corebone.cpp:289
void calculateBoundingBox(CalCoreModel *pCoreModel)
Calculates the bounding box.
Definition corebone.cpp:412
void setTranslation(const CalVector &translation)
Sets the translation.
Definition corebone.cpp:372
bool addChildId(int childId)
Adds a child ID.
Definition corebone.cpp:55
Cal::UserData getUserData()
Provides access to the user data.
Definition corebone.cpp:261
bool updateBoundingBox(const CalVector &position)
Updates the bounding box to include the given position.
Definition corebone.cpp:502
const CalQuaternion & getRotationAbsolute() const
Returns the absolute rotation.
Definition corebone.cpp:194
const CalQuaternion & getRotation() const
Returns the rotation.
Definition corebone.cpp:181
void scale(float factor)
Scale the core bone.
Definition corebone.cpp:573
void setRotationBoneSpace(const CalQuaternion &rotation)
Sets the bone space rotation.
Definition corebone.cpp:359
void calculateState()
Calculates the current state.
Definition corebone.cpp:69
const CalVector & getTranslationAbsolute() const
Returns the absolute translation.
Definition corebone.cpp:234
const CalQuaternion & getRotationBoneSpace() const
Returns the bone space rotation.
Definition corebone.cpp:208
std::list< int > & getListChildId()
Returns the child ID list.
Definition corebone.cpp:109
void setParentId(int parentId)
Sets the parent ID.
Definition corebone.cpp:302
void setUserData(Cal::UserData userData)
Stores user data.
Definition corebone.cpp:399
CalCoreBone(const std::string &name)
Constructs the core bone instance.
Definition corebone.cpp:32
const CalVector & getTranslationBoneSpace() const
Returns the bone space translation.
Definition corebone.cpp:248
const std::string & getName() const
Returns the name.
Definition corebone.cpp:137
int getParentId() const
Returns the parent ID.
Definition corebone.cpp:168
void setName(const std::string &name)
Sets the name.
Definition corebone.cpp:152
CalBoundingBox & getBoundingBox()
Returns the current bounding box.
Definition corebone.cpp:528
void setTranslationBoneSpace(const CalVector &translation)
Sets the bone space translation.
Definition corebone.cpp:386
CalCoreSkeleton * getCoreSkeleton()
Provides access to the core skeleton.
Definition corebone.cpp:317
const CalVector & getTranslation() const
Returns the translation.
Definition corebone.cpp:221
Definition coremodel.h:26
Definition coreskeleton.h:25
The quaternion class.
Definition quaternion.h:36
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.13.2