Blender  V3.3
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"
21 
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.
32 btDeformableMultiBodyConstraintSolver : public btMultiBodyConstraintSolver
33 {
34  btDeformableBodySolver* m_deformableSolver;
35 
36 protected:
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
42 
43  // write the velocity of the underlying rigid body to the the the solver body
45 
47 
49 
50 public:
52 
54  {
55  m_deformableSolver = deformableSolver;
56  }
57 
58  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);
59 };
60 
61 #endif /* BT_DEFORMABLE_MULTIBODY_CONSTRAINT_SOLVER_H */
btCollisionObject
BT_DECLARE_ALIGNED_ALLOCATOR()
void writeToSolverBody(btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal)
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)
void setDeformableSolver(btDeformableBodySolver *deformableSolver)
virtual void solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject **bodies, int numBodies, btCollisionObject **deformableBodies, int numDeformableBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
virtual btScalar solveDeformableGroupIterations(btCollisionObject **bodies, int numBodies, btCollisionObject **deformableBodies, int numDeformableBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
void solverBodyWriteBack(const btContactSolverInfo &infoGlobal)
btMultiBodyConstraint
btPersistentManifold()
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:285
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint ** constraints
btSequentialImpulseConstraintSolverMt int btPersistentManifold ** manifoldPtr
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint int numConstraints
btSequentialImpulseConstraintSolverMt int numBodies
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint int const btContactSolverInfo & infoGlobal
btSequentialImpulseConstraintSolverMt int btPersistentManifold int numManifolds
btTypedConstraint(btTypedConstraintType type, btRigidBody &rbA)