Bullet Collision Detection & Physics Library
btSimpleDynamicsWorld.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
16 #ifndef BT_SIMPLE_DYNAMICS_WORLD_H
17 #define BT_SIMPLE_DYNAMICS_WORLD_H
18 
19 #include "btDynamicsWorld.h"
20 
21 class btDispatcher;
23 class btConstraintSolver;
24 
28 {
29 protected:
30 
32 
34 
35  void predictUnconstraintMotion(btScalar timeStep);
36 
37  void integrateTransforms(btScalar timeStep);
38 
40 
41 public:
42 
43 
44 
46  btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
47 
48  virtual ~btSimpleDynamicsWorld();
49 
51  virtual int stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));
52 
53  virtual void setGravity(const btVector3& gravity);
54 
55  virtual btVector3 getGravity () const;
56 
57  virtual void addRigidBody(btRigidBody* body);
58 
59  virtual void addRigidBody(btRigidBody* body, short group, short mask);
60 
61  virtual void removeRigidBody(btRigidBody* body);
62 
63  virtual void debugDrawWorld();
64 
65  virtual void addAction(btActionInterface* action);
66 
67  virtual void removeAction(btActionInterface* action);
68 
70  virtual void removeCollisionObject(btCollisionObject* collisionObject);
71 
72  virtual void updateAabbs();
73 
74  virtual void synchronizeMotionStates();
75 
76  virtual void setConstraintSolver(btConstraintSolver* solver);
77 
79 
81  {
83  }
84 
85  virtual void clearForces();
86 
87 };
88 
89 #endif //BT_SIMPLE_DYNAMICS_WORLD_H
virtual int stepSimulation(btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))
maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead
void integrateTransforms(btScalar timeStep)
The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics w...
The btDynamicsWorld is the interface class for several dynamics implementation, basic, discrete, parallel, and continuous etc.
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size...
virtual void removeRigidBody(btRigidBody *body)
Basic interface to allow actions such as vehicles and characters to be updated inside a btDynamicsWor...
virtual btVector3 getGravity() const
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
virtual void synchronizeMotionStates()
The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.
virtual void removeAction(btActionInterface *action)
btCollisionObject can be used to manage collision detection objects.
void predictUnconstraintMotion(btScalar timeStep)
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:59
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs...
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
virtual btConstraintSolver * getConstraintSolver()
virtual void setConstraintSolver(btConstraintSolver *solver)
btDynamicsWorldType
virtual void setGravity(const btVector3 &gravity)
btSimpleDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration)
this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver ...
virtual void addRigidBody(btRigidBody *body)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:69
btConstraintSolver * m_constraintSolver
virtual btDynamicsWorldType getWorldType() const
virtual void addAction(btActionInterface *action)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:266