Blender  V3.3
btSimulationIslandManager.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_SIMULATION_ISLAND_MANAGER_H
17 #define BT_SIMULATION_ISLAND_MANAGER_H
18 
20 #include "btCollisionCreateFunc.h"
22 #include "btCollisionObject.h"
23 
24 class btCollisionObject;
25 class btCollisionWorld;
26 class btDispatcher;
28 
31 {
32  btUnionFind m_unionFind;
33 
36 
37  bool m_splitIslands;
38 
39 public:
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 
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
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
World world
DEGForeachIDComponentCallback callback
virtual void processIsland(btCollisionObject **bodies, int numBodies, class btPersistentManifold **manifolds, int numManifolds, int islandId)=0