Bullet Collision Detection & Physics Library
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
22#include "btCollisionObject.h"
23
26class btDispatcher;
28
31{
33
36
38
39public:
42
43 void initUnionFind(int n);
44
46
47 virtual void updateActivationState(btCollisionWorld* colWorld, btDispatcher* dispatcher);
49
50 void findUnions(btDispatcher* dispatcher, btCollisionWorld* colWorld);
51
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
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
btCollisionObject can be used to manage collision detection objects.
CollisionWorld is interface and container for the collision detection.
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
SimulationIslandManager creates and handles simulation islands, using btUnionFind.
virtual void storeIslandActivationState(btCollisionWorld *world)
void findUnions(btDispatcher *dispatcher, btCollisionWorld *colWorld)
void processIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
virtual void updateActivationState(btCollisionWorld *colWorld, btDispatcher *dispatcher)
void setSplitIslands(bool doSplitIslands)
btAlignedObjectArray< btCollisionObject * > m_islandBodies
void buildAndProcessIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
btAlignedObjectArray< btPersistentManifold * > m_islandmanifold
void buildIslands(btDispatcher *dispatcher, btCollisionWorld *colWorld)
UnionFind calculates connected subsets.
Definition: btUnionFind.h:36
virtual void processIsland(btCollisionObject **bodies, int numBodies, class btPersistentManifold **manifolds, int numManifolds, int islandId)=0