Bullet Collision Detection & Physics Library: btSimpleDynamicsWorld.h Source File

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btSimpleDynamicsWorld.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. 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
21class btDispatcher;
22class btOverlappingPairCache;
23class btConstraintSolver;
24
27 class btSimpleDynamicsWorld : public btDynamicsWorld
28{
29protected:
30 btConstraintSolver* m_constraintSolver;
31
32 bool m_ownsConstraintSolver;
33
34 void predictUnconstraintMotion(btScalar timeStep);
35
36 void integrateTransforms(btScalar timeStep);
37
38 btVector3 m_gravity;
39
40public:
42 btSimpleDynamicsWorld(btDispatcher* dispatcher, btBroadphaseInterface* pairCache, btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration);
43
44 virtual ~btSimpleDynamicsWorld();
45
47 virtual int stepSimulation(btScalar timeStep, int maxSubSteps = 1, btScalar fixedTimeStep = btScalar(1.) / btScalar(60.));
48
49 virtual void setGravity(const btVector3& gravity);
50
51 virtual btVector3 getGravity() const;
52
53 virtual void addRigidBody(btRigidBody* body);
54
55 virtual void addRigidBody(btRigidBody* body, int group, int mask);
56
57 virtual void removeRigidBody(btRigidBody* body);
58
59 virtual void debugDrawWorld();
60
61 virtual void addAction(btActionInterface* action);
62
63 virtual void removeAction(btActionInterface* action);
64
66 virtual void removeCollisionObject(btCollisionObject* collisionObject);
67
68 virtual void updateAabbs();
69
70 virtual void synchronizeMotionStates();
71
72 virtual void setConstraintSolver(btConstraintSolver* solver);
73
74 virtual btConstraintSolver* getConstraintSolver();
75
76 virtual btDynamicsWorldType getWorldType() const
77 {
78 return BT_SIMPLE_DYNAMICS_WORLD;
79 }
80
81 virtual void clearForces();
82};
83
84#endif //BT_SIMPLE_DYNAMICS_WORLD_H
btDynamicsWorld.h
btDynamicsWorldType
btDynamicsWorldType
Definition: btDynamicsWorld.h:31
BT_SIMPLE_DYNAMICS_WORLD
@ BT_SIMPLE_DYNAMICS_WORLD
Definition: btDynamicsWorld.h:32
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
btActionInterface
Basic interface to allow actions such as vehicles and characters to be updated inside a btDynamicsWor...
Definition: btActionInterface.h:27
btBroadphaseInterface
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
Definition: btBroadphaseInterface.h:50
btCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
Definition: btCollisionConfiguration.h:27
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:51
btConstraintSolver
Definition: btConstraintSolver.h:42
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
btDynamicsWorld
The btDynamicsWorld is the interface class for several dynamics implementation, basic,...
Definition: btDynamicsWorld.h:43
btOverlappingPairCache
The btOverlappingPairCache provides an interface for overlapping pair management (add,...
Definition: btOverlappingPairCache.h:51
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:60
btSimpleDynamicsWorld
The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics w...
Definition: btSimpleDynamicsWorld.h:28
btSimpleDynamicsWorld::m_ownsConstraintSolver
bool m_ownsConstraintSolver
Definition: btSimpleDynamicsWorld.h:32
btSimpleDynamicsWorld::m_constraintSolver
btConstraintSolver * m_constraintSolver
Definition: btSimpleDynamicsWorld.h:30
btSimpleDynamicsWorld::getConstraintSolver
virtual btConstraintSolver * getConstraintSolver()
Definition: btSimpleDynamicsWorld.cpp:257
btSimpleDynamicsWorld::addRigidBody
virtual void addRigidBody(btRigidBody *body)
Definition: btSimpleDynamicsWorld.cpp:138
btSimpleDynamicsWorld::removeCollisionObject
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
Definition: btSimpleDynamicsWorld.cpp:129
btSimpleDynamicsWorld::updateAabbs
virtual void updateAabbs()
Definition: btSimpleDynamicsWorld.cpp:170
btSimpleDynamicsWorld::setConstraintSolver
virtual void setConstraintSolver(btConstraintSolver *solver)
Definition: btSimpleDynamicsWorld.cpp:247
btSimpleDynamicsWorld::synchronizeMotionStates
virtual void synchronizeMotionStates()
Definition: btSimpleDynamicsWorld.cpp:230
btSimpleDynamicsWorld::removeAction
virtual void removeAction(btActionInterface *action)
Definition: btSimpleDynamicsWorld.cpp:166
btSimpleDynamicsWorld::integrateTransforms
void integrateTransforms(btScalar timeStep)
Definition: btSimpleDynamicsWorld.cpp:190
btSimpleDynamicsWorld::debugDrawWorld
virtual void debugDrawWorld()
Definition: btSimpleDynamicsWorld.cpp:158
btSimpleDynamicsWorld::removeRigidBody
virtual void removeRigidBody(btRigidBody *body)
Definition: btSimpleDynamicsWorld.cpp:124
btSimpleDynamicsWorld::getGravity
virtual btVector3 getGravity() const
Definition: btSimpleDynamicsWorld.cpp:119
btSimpleDynamicsWorld::clearForces
virtual void clearForces()
Definition: btSimpleDynamicsWorld.cpp:90
btSimpleDynamicsWorld::predictUnconstraintMotion
void predictUnconstraintMotion(btScalar timeStep)
Definition: btSimpleDynamicsWorld.cpp:208
btSimpleDynamicsWorld::setGravity
virtual void setGravity(const btVector3 &gravity)
Definition: btSimpleDynamicsWorld.cpp:105
btSimpleDynamicsWorld::addAction
virtual void addAction(btActionInterface *action)
Definition: btSimpleDynamicsWorld.cpp:162
btSimpleDynamicsWorld::~btSimpleDynamicsWorld
virtual ~btSimpleDynamicsWorld()
Definition: btSimpleDynamicsWorld.cpp:43
btSimpleDynamicsWorld::getWorldType
virtual btDynamicsWorldType getWorldType() const
Definition: btSimpleDynamicsWorld.h:76
btSimpleDynamicsWorld::stepSimulation
virtual int stepSimulation(btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))
maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld,...
Definition: btSimpleDynamicsWorld.cpp:49
btSimpleDynamicsWorld::m_gravity
btVector3 m_gravity
Definition: btSimpleDynamicsWorld.h:38
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82