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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btDeformableMultiBodyConstraintSolver.h
Go to the documentation of this file.
1/*
2 Written by Xuchen Han <xuchenhan2015@u.northwestern.edu>
3
4 Bullet Continuous Collision Detection and Physics Library
5 Copyright (c) 2019 Google Inc. http://bulletphysics.org
6 This software is provided 'as-is', without any express or implied warranty.
7 In no event will the authors be held liable for any damages arising from the use of this software.
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it freely,
10 subject to the following restrictions:
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_DEFORMABLE_MULTIBODY_CONSTRAINT_SOLVER_H
17#define BT_DEFORMABLE_MULTIBODY_CONSTRAINT_SOLVER_H
18
19#include "btDeformableBodySolver.h"
20#include "BulletDynamics/Featherstone/btMultiBodyConstraintSolver.h"
21
22class btDeformableBodySolver;
23
24// btDeformableMultiBodyConstraintSolver extendsn btMultiBodyConstraintSolver to solve for the contact among rigid/multibody and deformable bodies. Notice that the following constraints
25// 1. rigid/multibody against rigid/multibody
26// 2. rigid/multibody against deforamble
27// 3. deformable against deformable
28// 4. deformable self collision
29// 5. joint constraints
30// are all coupled in this solve.
31 ATTRIBUTE_ALIGNED16(class)
32 btDeformableMultiBodyConstraintSolver : public btMultiBodyConstraintSolver
33{
34 btDeformableBodySolver* m_deformableSolver;
35
36protected:
37 // override the iterations method to include deformable/multibody contact
38 // virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
39
40 // write the velocity of the the solver body to the underlying rigid body
41 void solverBodyWriteBack(const btContactSolverInfo& infoGlobal);
42
43 // write the velocity of the underlying rigid body to the the the solver body
44 void writeToSolverBody(btCollisionObject * *bodies, int numBodies, const btContactSolverInfo& infoGlobal);
45
46 // let each deformable body knows which solver body is in constact
47 void pairDeformableAndSolverBody(btCollisionObject** bodies, int numBodies, int numDeformableBodies, const btContactSolverInfo& infoGlobal);
48
49 virtual void solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject * *bodies, int numBodies, btCollisionObject** deformableBodies, int numDeformableBodies, btPersistentManifold** manifoldPtr, int numManifolds, btTypedConstraint** constraints, int numConstraints, const btContactSolverInfo& infoGlobal, btIDebugDraw* debugDrawer);
50
51 virtual btScalar solveDeformableGroupIterations(btCollisionObject * *bodies, int numBodies, btCollisionObject** deformableBodies, int numDeformableBodies, btPersistentManifold** manifoldPtr, int numManifolds, btTypedConstraint** constraints, int numConstraints, const btContactSolverInfo& infoGlobal, btIDebugDraw* debugDrawer);
52
53public:
54 BT_DECLARE_ALIGNED_ALLOCATOR();
55
56 void setDeformableSolver(btDeformableBodySolver * deformableSolver)
57 {
58 m_deformableSolver = deformableSolver;
59 }
60
61 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);
62};
63
64#endif /* BT_DEFORMABLE_MULTIBODY_CONSTRAINT_SOLVER_H */
btDeformableBodySolver.h
btMultiBodyConstraintSolver.h
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:99
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:51
btDeformableBodySolver
Definition: btDeformableBodySolver.h:31
btDeformableMultiBodyConstraintSolver
Definition: btDeformableMultiBodyConstraintSolver.h:33
btDeformableMultiBodyConstraintSolver::m_deformableSolver
btDeformableBodySolver * m_deformableSolver
Definition: btDeformableMultiBodyConstraintSolver.h:34
btDeformableMultiBodyConstraintSolver::BT_DECLARE_ALIGNED_ALLOCATOR
BT_DECLARE_ALIGNED_ALLOCATOR()
btDeformableMultiBodyConstraintSolver::setDeformableSolver
void setDeformableSolver(btDeformableBodySolver *deformableSolver)
Definition: btDeformableMultiBodyConstraintSolver.h:56
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
Definition: btIDebugDraw.h:27
btMultiBodyConstraintSolver
Definition: btMultiBodyConstraintSolver.h:30
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
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:76
btContactSolverInfo
Definition: btContactSolverInfo.h:76