Model.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef MODEL_HH
00028 #define MODEL_HH
00029
00030 #include <ode/ode.h>
00031 #include "Vector.hh"
00032
00033 #include "GL/gl.h"
00034
00035
00036 class World;
00037 class WorldFile;
00038 class WorldFileNode;
00039 class Body;
00040 class Geom;
00041 class Joint;
00042 class HingeJoint;
00043 class RenderOptions;
00044
00045
00046 class Model
00047 {
00048
00049 public: Model( World *world );
00050
00051
00052 public: virtual ~Model();
00053
00054
00055 public: int MasterLoad( WorldFile *file, WorldFileNode *node );
00056
00057
00058 public: virtual int Load( WorldFile *file, WorldFileNode *node ) = 0;
00059
00060
00061 public: virtual int Init( WorldFile *file, WorldFileNode *node ) = 0;
00062
00063
00064 public: virtual int Fini() = 0;
00065
00066
00067 public: virtual void Update( double step ) = 0;
00068
00069
00070 public: void MasterUpdate( double step );
00071
00072
00073 public: GzPose GetPose();
00074
00075
00076 public: void SetPose( GzPose pose );
00077
00078
00079 public: void LogPose();
00080
00081
00082 public: void SetParent(Model *parent, Body *parentBody);
00083
00084
00085 public: void Attach();
00086
00087
00088 public: void Detach();
00089
00090
00091
00092 protected: void AddBody(Body *body, bool canonical = false);
00093
00094
00095
00096 public: Body *GetBody(const char *bodyName = NULL);
00097
00098
00099 public: int GetNumBodies() {return this->bodyCount;}
00100 public: Body **GetBodies() {return this->bodies;}
00101
00102
00103 public: void SetId(const char* id);
00104
00105
00106 public: const char* GetId() const {return this->id;}
00107
00108
00109 public: void SetName(const char *name);
00110
00111
00112 public: const char* GetName();
00113
00114
00115 public: void SetPickId( GLuint id );
00116
00117
00118 public: GLuint GetPickId() const;
00119
00120
00121 public: int GetIntId() const;
00122
00123
00124 public: int GetParentIntId() const;
00125
00126
00127
00128 public: virtual void Render( int pass, RenderOptions *renderOpt );
00129
00130
00131 public: World *world;
00132
00133
00134 public: WorldFileNode *node;
00135
00136
00137 public: Model *parent;
00138
00139
00140 public: Body *parentBody;
00141
00143 public: GzPose initPose;
00144
00145
00146
00147 private: char *id;
00148
00149
00150 private: char *name;
00151
00152
00153 public: HingeJoint *joint;
00154
00155
00156 public: GzPose relPose;
00157
00158
00159 public: bool fixed;
00160
00161
00162 public: dSpaceID modelSpaceId;
00163
00164
00165 protected: int bodyCount, bodyMaxCount;
00166 protected: Body **bodies;
00167
00168
00169 private: Body *canonicalBody;
00170
00171
00172 private: int jointCount, jointMaxCount;
00173 private: Joint **joints;
00174
00175 private: GLuint pickId;
00176 private: static GLuint pickIdMaster;
00177
00178 private: bool gravityMode;
00179 private: bool enable;
00180
00181
00182 private: static int integerIdCounter;
00183 private: int integerId;
00184
00185
00186 public: bool logPoses;
00187 public: int poseCount, poseMaxCount;
00188 public: GzPose *poses;
00189 };
00190
00191 #endif
00192
Last updated 12 September 2005 21:38:45
|