SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
taoWorld.h
1 /* Copyright (c) 2005 Arachi, Inc. and Stanford University. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject
9  * to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
26 #ifndef _taoWorld_h
27 #define _taoWorld_h
28 
29 #include "taoTypes.h"
30 #include <tao/matrix/TaoDeMath.h>
31 
32 class taoDNode;
33 class taoNode;
34 class taoNodeRoot;
35 
45 class taoWorld
46 {
47 public:
48  taoWorld() : _id(-1), _isFixed(0), root_node_(NULL), _next(NULL) { _gravity.zero(); }
49  ~taoWorld();
50 
51  void setID(deInt i) { _id = i; }
52  const deInt getID() const { return _id; }
53 
54  void setIsFixed(int f) { _isFixed = f; }
55  deInt getIsFixed() { return _isFixed; }
56 
57  deVector3* gravity() { return &_gravity; }
58 
59  void setNext(taoWorld* g) { _next = g; }
60  taoWorld* getNext() { return _next; }
61 
62  taoNodeRoot* getRootList() { return root_node_; }
63  void addRoot(taoNodeRoot* r, const deInt id);
64  taoNodeRoot* removeRoot(const deInt id);
65  taoNodeRoot* findRoot(const deInt id);
66 
79  void update(const deFloat time, const deFloat dt, const deInt n);
80  void simulate(const deFloat dt);
81  void updateTransformation();
82 
83  taoNodeRoot* unlinkFixed(taoNodeRoot* root, taoNode* node);
84  taoNodeRoot* unlinkFree(taoNodeRoot* root, taoNode* node, deFloat inertia, deFloat damping);
85 
86  void sync(taoNodeRoot* root, deFloat time);
87 
88 private:
89  deInt _id;
90  deInt _isFixed;
91  deVector3 _gravity;
92  taoNodeRoot* root_node_;
93 
94  taoWorld* _next;
95 };
96 
97 #endif // _taoWorld_h
3x1 vector classThis is a C++ wrapper class of deVector3f.
Definition: TaoDeVector3.h:32
node class for articulated body dynamicsThis implements taoDNode for articulated body dynamics...
Definition: taoNode.h:42
abstract node class for articulated bodyA dynamics node = {Articulated Body Link + Set of associated ...
Definition: taoDNode.h:46
void update(const deFloat time, const deFloat dt, const deInt n)
Definition: taoWorld.cpp:42
root node class for articulated body dynamicsThis implements taoDNode for root node of a articulated ...
Definition: taoNode.h:147
container class to hold dynamics charactersA group is a container object for dynamics characters...
Definition: taoWorld.h:45
DE_MATH_API void zero()
this = 0
Definition: TaoDeVector3Inl.h:38
~taoWorld()
Definition: taoWorld.cpp:31