NTRT Simulator
 All Classes Files Functions Variables Typedefs Friends Pages
tgWorldBulletPhysicsImpl.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
19 
20 #ifndef TG_WORLDBULLETPHYSICSIMPL_H
21 #define TG_WORLDBULLETPHYSICSIMPL_H
22 
30 // This application
31 #include "tgWorld.h"
32 #include "tgWorldImpl.h"
33 #include "LinearMath/btAlignedObjectArray.h"
34 
35 // Forward declarations
36 class btCollisionShape;
37 class btSoftRigidDynamicsWorld;
38 class btRigidBody;
40 class tgBulletGround;
41 
47 {
48  public:
49 
55  tgBulletGround* ground);
56 
59 
65  virtual void step(double dt);
66 
71  btSoftRigidDynamicsWorld& dynamicsWorld() const
72  {
73  return *m_pDynamicsWorld;
74  }
75 
81  void addCollisionShape(btCollisionShape* pShape);
82 
83  private:
84 
90  btSoftRigidDynamicsWorld* createDynamicsWorld() const;
91 
96  btRigidBody* createGroundRigidBody();
97 
99  bool invariant() const;
100 
101  private:
102 
104  IntermediateBuildProducts * const m_pIntermediateBuildProducts;
105 
107  btSoftRigidDynamicsWorld* m_pDynamicsWorld;
108 
109  /*
110  * A vector of collision shapes for easy reference. Does not affect
111  * physics or rendering unles the shape is placed into the dynamics
112  * world. Bullet encourages reuse of collision shapes when possible
113  * for efficiency.
114  */
115  btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
116 };
117 
118 #endif // TG_WORLDBULLETPHYSICSIMPL_H
Contains the definition of class tgWorldImpl.
btSoftRigidDynamicsWorld & dynamicsWorld() const
tgWorldBulletPhysicsImpl(const tgWorld::Config &config, tgBulletGround *ground)
Contains the definition of class tgWorld $Id$.
void addCollisionShape(btCollisionShape *pShape)