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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btSimulationIslandManager.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_SIMULATION_ISLAND_MANAGER_H
17#define BT_SIMULATION_ISLAND_MANAGER_H
18
19#include "BulletCollision/CollisionDispatch/btUnionFind.h"
20#include "btCollisionCreateFunc.h"
21#include "LinearMath/btAlignedObjectArray.h"
22#include "btCollisionObject.h"
23
24class btCollisionObject;
25class btCollisionWorld;
26class btDispatcher;
27class btPersistentManifold;
28
30 class btSimulationIslandManager
31{
32 btUnionFind m_unionFind;
33
34 btAlignedObjectArray<btPersistentManifold*> m_islandmanifold;
35 btAlignedObjectArray<btCollisionObject*> m_islandBodies;
36
37 bool m_splitIslands;
38
39public:
40 btSimulationIslandManager();
41 virtual ~btSimulationIslandManager();
42
43 void initUnionFind(int n);
44
45 btUnionFind& getUnionFind() { return m_unionFind; }
46
47 virtual void updateActivationState(btCollisionWorld* colWorld, btDispatcher* dispatcher);
48 virtual void storeIslandActivationState(btCollisionWorld* world);
49
50 void findUnions(btDispatcher* dispatcher, btCollisionWorld* colWorld);
51
52 struct IslandCallback
53 {
54 virtual ~IslandCallback(){};
55
56 virtual void processIsland(btCollisionObject** bodies, int numBodies, class btPersistentManifold** manifolds, int numManifolds, int islandId) = 0;
57 };
58
59 void buildAndProcessIslands(btDispatcher* dispatcher, btCollisionWorld* collisionWorld, IslandCallback* callback);
60
61 void buildIslands(btDispatcher* dispatcher, btCollisionWorld* colWorld);
62
63 void processIslands(btDispatcher* dispatcher, btCollisionWorld* collisionWorld, IslandCallback* callback);
64
65 bool getSplitIslands()
66 {
67 return m_splitIslands;
68 }
69 void setSplitIslands(bool doSplitIslands)
70 {
71 m_splitIslands = doSplitIslands;
72 }
73};
74
75#endif //BT_SIMULATION_ISLAND_MANAGER_H
btAlignedObjectArray.h
btCollisionCreateFunc.h
btCollisionObject.h
btUnionFind.h
btAlignedObjectArray
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
Definition btAlignedObjectArray.h:46
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition btCollisionObject.h:51
btCollisionWorld
CollisionWorld is interface and container for the collision detection.
Definition btCollisionWorld.h:86
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition btDispatcher.h:77
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition btPersistentManifold.h:65
btSimulationIslandManager
SimulationIslandManager creates and handles simulation islands, using btUnionFind.
Definition btSimulationIslandManager.h:31
btSimulationIslandManager::storeIslandActivationState
virtual void storeIslandActivationState(btCollisionWorld *world)
Definition btSimulationIslandManager.cpp:92
btSimulationIslandManager::m_unionFind
btUnionFind m_unionFind
Definition btSimulationIslandManager.h:32
btSimulationIslandManager::findUnions
void findUnions(btDispatcher *dispatcher, btCollisionWorld *colWorld)
Definition btSimulationIslandManager.cpp:40
btSimulationIslandManager::processIslands
void processIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
Definition btSimulationIslandManager.cpp:349
btSimulationIslandManager::updateActivationState
virtual void updateActivationState(btCollisionWorld *colWorld, btDispatcher *dispatcher)
Definition btSimulationIslandManager.cpp:67
btSimulationIslandManager::m_splitIslands
bool m_splitIslands
Definition btSimulationIslandManager.h:37
btSimulationIslandManager::setSplitIslands
void setSplitIslands(bool doSplitIslands)
Definition btSimulationIslandManager.h:69
btSimulationIslandManager::m_islandBodies
btAlignedObjectArray< btCollisionObject * > m_islandBodies
Definition btSimulationIslandManager.h:35
btSimulationIslandManager::buildAndProcessIslands
void buildAndProcessIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
Definition btSimulationIslandManager.cpp:343
btSimulationIslandManager::getUnionFind
btUnionFind & getUnionFind()
Definition btSimulationIslandManager.h:45
btSimulationIslandManager::initUnionFind
void initUnionFind(int n)
Definition btSimulationIslandManager.cpp:35
btSimulationIslandManager::m_islandmanifold
btAlignedObjectArray< btPersistentManifold * > m_islandmanifold
Definition btSimulationIslandManager.h:34
btSimulationIslandManager::btSimulationIslandManager
btSimulationIslandManager()
Definition btSimulationIslandManager.cpp:27
btSimulationIslandManager::getSplitIslands
bool getSplitIslands()
Definition btSimulationIslandManager.h:65
btSimulationIslandManager::buildIslands
void buildIslands(btDispatcher *dispatcher, btCollisionWorld *colWorld)
Definition btSimulationIslandManager.cpp:196
btSimulationIslandManager::~btSimulationIslandManager
virtual ~btSimulationIslandManager()
Definition btSimulationIslandManager.cpp:31
btUnionFind
UnionFind calculates connected subsets.
Definition btUnionFind.h:36
btSimulationIslandManager::IslandCallback
Definition btSimulationIslandManager.h:53
btSimulationIslandManager::IslandCallback::processIsland
virtual void processIsland(btCollisionObject **bodies, int numBodies, class btPersistentManifold **manifolds, int numManifolds, int islandId)=0
btSimulationIslandManager::IslandCallback::~IslandCallback
virtual ~IslandCallback()
Definition btSimulationIslandManager.h:54