00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _taoGroup_h
00024 #define _taoGroup_h
00025
00026 #include "taoTypes.h"
00027 #include "deMath.h"
00028
00029 class taoDNode;
00030 class taoNode;
00031 class taoNodeRoot;
00032
00042 class taoGroup
00043 {
00044 public:
00045 taoGroup() : _id(-1), _isFixed(0), _rootList(NULL), _next(NULL) { _gravity.zero(); }
00046 ~taoGroup();
00047
00048 void setID(deInt i) { _id = i; }
00049 const deInt getID() const { return _id; }
00050
00051 void setIsFixed(int f) { _isFixed = f; }
00052 deInt getIsFixed() { return _isFixed; }
00053
00054 deVector3* gravity() { return &_gravity; }
00055
00056 void setNext(taoGroup* g) { _next = g; }
00057 taoGroup* getNext() { return _next; }
00058
00059 taoNodeRoot* getRootList() { return _rootList; }
00060 void addRoot(taoNodeRoot* r, const deInt id);
00061 taoNodeRoot* removeRoot(const deInt id);
00062 taoNodeRoot* findRoot(const deInt id);
00063
00064 void update(const deFloat time, const deFloat dt, const deInt n);
00065 void control(const deFloat time);
00066 void simulate(const deFloat dt);
00067 void updateTransformation();
00068
00069 taoNodeRoot* unlinkFixed(taoNodeRoot* root, taoNode* node);
00070 taoNodeRoot* unlinkFree(taoNodeRoot* root, taoNode* node, deFloat inertia, deFloat damping);
00071
00072 void sync(taoNodeRoot* root, deFloat time);
00073
00074 private:
00075 deInt _id;
00076 deInt _isFixed;
00077 deVector3 _gravity;
00078 taoNodeRoot* _rootList;
00079 taoGroup* _next;
00080 };
00081
00082 #endif // _taoGroup_h