- 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 enum CalLightType {
26  LIGHT_TYPE_NONE,
27  LIGHT_TYPE_OMNI,
28  LIGHT_TYPE_DIRECTIONAL,
29  LIGHT_TYPE_TARGET,
30  LIGHT_TYPE_AMBIENT
31 };
32 
33 
34 class CAL3D_API CalCoreBone
35 {
36 public:
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; }
50  CalCoreSkeleton *getCoreSkeleton();
51  const CalCoreSkeleton *getCoreSkeleton() const;
52  const CalQuaternion& getRotation() const;
53  const CalQuaternion& getRotationAbsolute() const;
54  const CalQuaternion& getRotationBoneSpace() const;
55  const CalVector& getTranslation() const;
56  const CalVector& getTranslationAbsolute() const;
57  const CalVector& getTranslationBoneSpace() 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);
70  CalBoundingBox & getBoundingBox();
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 
84 private:
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 //****************************************************************************//
Definition: coremodel.h:25
Definition: corebone.h:34
The bounding box class.
Definition: vector.h:222
Definition: coreskeleton.h:24
The vector class.
Definition: vector.h:36
The quaternion class.
Definition: quaternion.h:35

Generated by The Cal3D Team with Doxygen 1.8.14