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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

DeformableBodyInplaceSolverIslandCallback.h
Go to the documentation of this file.
1//
2// DeformableBodyInplaceSolverIslandCallback.h
3// BulletSoftBody
4//
5// Created by Xuchen Han on 12/16/19.
6//
7
8#ifndef DeformableBodyInplaceSolverIslandCallback_h
9#define DeformableBodyInplaceSolverIslandCallback_h
10
11 struct DeformableBodyInplaceSolverIslandCallback : public MultiBodyInplaceSolverIslandCallback
12{
13 btDeformableMultiBodyConstraintSolver* m_deformableSolver;
14
15 DeformableBodyInplaceSolverIslandCallback(btDeformableMultiBodyConstraintSolver* solver,
16 btDispatcher* dispatcher)
17 : MultiBodyInplaceSolverIslandCallback(solver, dispatcher), m_deformableSolver(solver)
18 {
19 }
20
21 virtual void processConstraints(int islandId = -1)
22 {
23 btCollisionObject** bodies = m_bodies.size() ? &m_bodies[0] : 0;
24 btCollisionObject** softBodies = m_softBodies.size() ? &m_softBodies[0] : 0;
25 btPersistentManifold** manifold = m_manifolds.size() ? &m_manifolds[0] : 0;
26 btTypedConstraint** constraints = m_constraints.size() ? &m_constraints[0] : 0;
27 btMultiBodyConstraint** multiBodyConstraints = m_multiBodyConstraints.size() ? &m_multiBodyConstraints[0] : 0;
28
29 //printf("mb contacts = %d, mb constraints = %d\n", mbContacts, m_multiBodyConstraints.size());
30
31 m_deformableSolver->solveDeformableBodyGroup(bodies, m_bodies.size(), softBodies, m_softBodies.size(), manifold, m_manifolds.size(), constraints, m_constraints.size(), multiBodyConstraints, m_multiBodyConstraints.size(), *m_solverInfo, m_debugDrawer, m_dispatcher);
32 if (m_bodies.size() && (m_solverInfo->m_reportSolverAnalytics & 1))
33 {
34 m_deformableSolver->m_analyticsData.m_islandId = islandId;
35 m_islandAnalyticsData.push_back(m_solver->m_analyticsData);
36 }
37 m_bodies.resize(0);
38 m_softBodies.resize(0);
39 m_manifolds.resize(0);
40 m_constraints.resize(0);
41 m_multiBodyConstraints.resize(0);
42 }
43};
44
45#endif /* DeformableBodyInplaceSolverIslandCallback_h */
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:142
btAlignedObjectArray::resize
void resize(int newsize, const T &fillData=T())
Definition: btAlignedObjectArray.h:203
btAlignedObjectArray::push_back
void push_back(const T &_Val)
Definition: btAlignedObjectArray.h:257
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:51
btDeformableMultiBodyConstraintSolver
Definition: btDeformableMultiBodyConstraintSolver.h:33
btDeformableMultiBodyConstraintSolver::solveDeformableBodyGroup
virtual void solveDeformableBodyGroup(btCollisionObject **bodies, int numBodies, btCollisionObject **deformableBodies, int numDeformableBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, btMultiBodyConstraint **multiBodyConstraints, int numMultiBodyConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btDispatcher *dispatcher)
Definition: btDeformableMultiBodyConstraintSolver.cpp:73
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
btMultiBodyConstraint
Definition: btMultiBodyConstraint.h:57
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition: btPersistentManifold.h:65
btSequentialImpulseConstraintSolver::m_analyticsData
btSolverAnalyticsData m_analyticsData
Definition: btSequentialImpulseConstraintSolver.h:212
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:76
DeformableBodyInplaceSolverIslandCallback
Definition: DeformableBodyInplaceSolverIslandCallback.h:12
DeformableBodyInplaceSolverIslandCallback::m_deformableSolver
btDeformableMultiBodyConstraintSolver * m_deformableSolver
Definition: DeformableBodyInplaceSolverIslandCallback.h:13
DeformableBodyInplaceSolverIslandCallback::DeformableBodyInplaceSolverIslandCallback
DeformableBodyInplaceSolverIslandCallback(btDeformableMultiBodyConstraintSolver *solver, btDispatcher *dispatcher)
Definition: DeformableBodyInplaceSolverIslandCallback.h:15
DeformableBodyInplaceSolverIslandCallback::processConstraints
virtual void processConstraints(int islandId=-1)
Definition: DeformableBodyInplaceSolverIslandCallback.h:21
MultiBodyInplaceSolverIslandCallback
Definition: btMultiBodyInplaceSolverIslandCallback.h:66
MultiBodyInplaceSolverIslandCallback::m_constraints
btAlignedObjectArray< btTypedConstraint * > m_constraints
Definition: btMultiBodyInplaceSolverIslandCallback.h:81
MultiBodyInplaceSolverIslandCallback::m_multiBodyConstraints
btAlignedObjectArray< btMultiBodyConstraint * > m_multiBodyConstraints
Definition: btMultiBodyInplaceSolverIslandCallback.h:82
MultiBodyInplaceSolverIslandCallback::m_solverInfo
btContactSolverInfo * m_solverInfo
Definition: btMultiBodyInplaceSolverIslandCallback.h:68
MultiBodyInplaceSolverIslandCallback::m_manifolds
btAlignedObjectArray< btPersistentManifold * > m_manifolds
Definition: btMultiBodyInplaceSolverIslandCallback.h:80
MultiBodyInplaceSolverIslandCallback::m_dispatcher
btDispatcher * m_dispatcher
Definition: btMultiBodyInplaceSolverIslandCallback.h:76
MultiBodyInplaceSolverIslandCallback::m_debugDrawer
btIDebugDraw * m_debugDrawer
Definition: btMultiBodyInplaceSolverIslandCallback.h:75
MultiBodyInplaceSolverIslandCallback::m_bodies
btAlignedObjectArray< btCollisionObject * > m_bodies
Definition: btMultiBodyInplaceSolverIslandCallback.h:78
MultiBodyInplaceSolverIslandCallback::m_islandAnalyticsData
btAlignedObjectArray< btSolverAnalyticsData > m_islandAnalyticsData
Definition: btMultiBodyInplaceSolverIslandCallback.h:84
MultiBodyInplaceSolverIslandCallback::m_softBodies
btAlignedObjectArray< btCollisionObject * > m_softBodies
Definition: btMultiBodyInplaceSolverIslandCallback.h:79
MultiBodyInplaceSolverIslandCallback::m_solver
btMultiBodyConstraintSolver * m_solver
Definition: btMultiBodyInplaceSolverIslandCallback.h:69
btContactSolverInfoData::m_reportSolverAnalytics
int m_reportSolverAnalytics
Definition: btContactSolverInfo.h:71
btSolverAnalyticsData::m_islandId
int m_islandId
Definition: btSequentialImpulseConstraintSolver.h:41