Blender V4.3
btSimulationIslandManager.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
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
24class btCollisionObject;
26class btDispatcher;
28
31{
32 btUnionFind m_unionFind;
33
36
37 bool m_splitIslands;
38
39public:
42
43 void initUnionFind(int n);
44
45 btUnionFind& getUnionFind() { return m_unionFind; }
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
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
btPersistentManifold()
btSequentialImpulseConstraintSolverMt int numBodies
btSequentialImpulseConstraintSolverMt int btPersistentManifold int numManifolds
CollisionWorld is interface and container for the collision detection.
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)
void buildAndProcessIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
void buildIslands(btDispatcher *dispatcher, btCollisionWorld *colWorld)
UnionFind calculates connected subsets.
Definition btUnionFind.h:36
DEGForeachIDComponentCallback callback
virtual void processIsland(btCollisionObject **bodies, int numBodies, class btPersistentManifold **manifolds, int numManifolds, int islandId)=0