- Cal3D 0.11 API Reference -

corebone.h

00001 //****************************************************************************//
00002 // corebone.h                                                                 //
00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger                       //
00004 //****************************************************************************//
00005 // This library is free software; you can redistribute it and/or modify it    //
00006 // under the terms of the GNU Lesser General Public License as published by   //
00007 // the Free Software Foundation; either version 2.1 of the License, or (at    //
00008 // your option) any later version.                                            //
00009 //****************************************************************************//
00010 
00011 #ifndef CAL_COREBONE_H
00012 #define CAL_COREBONE_H
00013 
00014 
00015 #include "cal3d/global.h"
00016 #include "cal3d/matrix.h"
00017 #include "cal3d/vector.h"
00018 #include "cal3d/quaternion.h"
00019 
00020 
00021 class CalCoreSkeleton;
00022 class CalCoreModel;
00023 
00024 
00025 enum CalLightType {
00026   LIGHT_TYPE_NONE,
00027   LIGHT_TYPE_OMNI,
00028   LIGHT_TYPE_DIRECTIONAL,
00029   LIGHT_TYPE_TARGET,
00030   LIGHT_TYPE_AMBIENT
00031 };
00032 
00033 
00034 class CAL3D_API CalCoreBone
00035 {
00036 public:
00037   CalCoreBone(const std::string& name);
00038   ~CalCoreBone() { }
00039 
00040   bool addChildId(int childId);
00041   void calculateState();
00042   std::list<int>& getListChildId();
00043   const std::string& getNameInternal();
00044   void setNameInternal( std::string& str ) { m_strName = str; }
00045   const std::list<int>& getListChildId() const;
00046   const std::string& getName() const;
00047   void setName( const std::string& name );
00048   int getParentId() const;
00049   void setName( char const * str ) { m_strName = str; }
00050   CalCoreSkeleton *getCoreSkeleton();
00051   const CalCoreSkeleton *getCoreSkeleton() const;
00052   const CalQuaternion& getRotation() const;
00053   const CalQuaternion& getRotationAbsolute() const;
00054   const CalQuaternion& getRotationBoneSpace() const;
00055   const CalVector& getTranslation() const;
00056   const CalVector& getTranslationAbsolute() const;
00057   const CalVector& getTranslationBoneSpace() const;
00058   Cal::UserData getUserData();
00059   const Cal::UserData getUserData() const;
00060   void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton);
00061   void setParentId(int parentId);
00062   void setRotation(const CalQuaternion& rotation);
00063   void setRotationBoneSpace(const CalQuaternion& rotation);
00064   void setTranslation(const CalVector& translation);
00065   void setTranslationBoneSpace(const CalVector& translation);
00066   void setUserData(Cal::UserData userData);
00067 
00068   void initBoundingBox();
00069   void calculateBoundingBox(CalCoreModel * pCoreModel);
00070   CalBoundingBox & getBoundingBox();
00071   const CalBoundingBox & getBoundingBox() const;
00072   void getBoundingData(int planeId,CalVector & position) const;
00073   bool isBoundingBoxPrecomputed() const;
00074   void setBoundingBoxPrecomputed( bool inComputed );
00075   bool updateBoundingBox(const CalVector &position);
00076   void scale(float factor);
00077 
00078   bool hasLightingData();
00079   void getLightColor( CalVector & );
00080   void setLightColor( CalVector const & );
00081   CalLightType  getLightType();
00082   void setLightType( CalLightType );
00083 
00084 private:
00085   std::string      m_strName;
00086   CalCoreSkeleton *m_pCoreSkeleton;
00087   int              m_parentId;
00088   std::list<int>   m_listChildId;
00089   CalVector        m_translation;
00090   CalQuaternion    m_rotation;
00091   CalVector        m_translationAbsolute;
00092   CalQuaternion    m_rotationAbsolute;
00093   CalVector        m_translationBoneSpace;
00094   CalQuaternion    m_rotationBoneSpace;
00095   Cal::UserData    m_userData;
00096 
00097   CalBoundingBox   m_boundingBox;
00098   CalVector        m_boundingPosition[6];
00099   bool             m_boundingBoxPrecomputed;
00100   CalVector m_lightColor;
00101   CalLightType m_lightType;
00102 
00103 };
00104 
00105 #endif
00106 
00107 //****************************************************************************//

Generated by The Cal3D Team with Doxygen 1.7.3