Blender
V3.3
|
#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
#include "btMultiBodySolverConstraint.h"
#include "btMultiBodyConstraint.h"
Go to the source code of this file.
Macros | |
#define | DIRECTLY_UPDATE_VELOCITY_DURING_SOLVER_ITERATIONS |
#define DIRECTLY_UPDATE_VELOCITY_DURING_SOLVER_ITERATIONS |
Definition at line 22 of file btMultiBodyConstraintSolver.h.
btMultiBodySolverConstraint & btMultiBodyConstraintSolver::addMultiBodyFrictionConstraint | ( | const btVector3 & | normalAxis, |
const btScalar & | appliedImpulse, | ||
btPersistentManifold * | manifold, | ||
int | frictionIndex, | ||
btManifoldPoint & | cp, | ||
btCollisionObject * | colObj0, | ||
btCollisionObject * | colObj1, | ||
btScalar | relaxation, | ||
const btContactSolverInfo & | infoGlobal, | ||
btScalar | desiredVelocity = 0 , |
||
btScalar | cfmSlip = 0 |
||
) |
Definition at line 1142 of file btMultiBodyConstraintSolver.cpp.
References BT_PROFILE, btMultiBody, btMultiBodySolverConstraint, btAlignedObjectArray< T >::expandNonInitializing(), getOrInitSolverBody(), infoGlobal, btMultiBodyLinkCollider::m_link, btMultiBodyLinkCollider::m_multiBody, m_multiBodyFrictionContactConstraints, btContactSolverInfoData::m_timeStep, setupMultiBodyContactConstraint(), and btMultiBodyLinkCollider::upcast().
Referenced by convertMultiBodyContact().
btMultiBodySolverConstraint & btMultiBodyConstraintSolver::addMultiBodySpinningFrictionConstraint | ( | const btVector3 & | normalAxis, |
btPersistentManifold * | manifold, | ||
int | frictionIndex, | ||
btManifoldPoint & | cp, | ||
btScalar | combinedTorsionalFriction, | ||
btCollisionObject * | colObj0, | ||
btCollisionObject * | colObj1, | ||
btScalar | relaxation, | ||
const btContactSolverInfo & | infoGlobal, | ||
btScalar | desiredVelocity = 0 , |
||
btScalar | cfmSlip = 0 |
||
) |
Definition at line 1217 of file btMultiBodyConstraintSolver.cpp.
References BT_PROFILE, btMultiBody, btMultiBodySolverConstraint, btAlignedObjectArray< T >::expandNonInitializing(), getOrInitSolverBody(), infoGlobal, btMultiBodyLinkCollider::m_link, btMultiBodyLinkCollider::m_multiBody, m_multiBodySpinningFrictionContactConstraints, btContactSolverInfoData::m_timeStep, setupMultiBodyTorsionalFrictionConstraint(), and btMultiBodyLinkCollider::upcast().
Referenced by convertMultiBodyContact().
btMultiBodySolverConstraint & btMultiBodyConstraintSolver::addMultiBodyTorsionalFrictionConstraint | ( | const btVector3 & | normalAxis, |
btPersistentManifold * | manifold, | ||
int | frictionIndex, | ||
btManifoldPoint & | cp, | ||
btScalar | combinedTorsionalFriction, | ||
btCollisionObject * | colObj0, | ||
btCollisionObject * | colObj1, | ||
btScalar | relaxation, | ||
const btContactSolverInfo & | infoGlobal, | ||
btScalar | desiredVelocity = 0 , |
||
btScalar | cfmSlip = 0 |
||
) |
Definition at line 1177 of file btMultiBodyConstraintSolver.cpp.
References BT_PROFILE, btMultiBody, btMultiBodySolverConstraint, btAlignedObjectArray< T >::expandNonInitializing(), getOrInitSolverBody(), infoGlobal, btMultiBodyLinkCollider::m_link, btMultiBodyLinkCollider::m_multiBody, m_multiBodyFrictionContactConstraints, m_multiBodyTorsionalFrictionContactConstraints, btContactSolverInfoData::m_solverMode, btContactSolverInfoData::m_timeStep, setupMultiBodyTorsionalFrictionConstraint(), SOLVER_DISABLE_IMPLICIT_CONE_FRICTION, SOLVER_USE_2_FRICTION_DIRECTIONS, and btMultiBodyLinkCollider::upcast().
Referenced by convertMultiBodyContact().
void btMultiBodyConstraintSolver::applyDeltaVee | ( | btScalar * | deltaV, |
btScalar | impulse, | ||
int | velocityIndex, | ||
int | ndof | ||
) |
Definition at line 229 of file btMultiBodyConstraintSolver.cpp.
References m_data.
BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
void convertContacts | ( | btPersistentManifold ** | manifoldPtr, |
int | numManifolds, | ||
const btContactSolverInfo & | infoGlobal | ||
) |
void btMultiBodyConstraintSolver::convertMultiBodyContact | ( | btPersistentManifold * | manifold, |
const btContactSolverInfo & | infoGlobal | ||
) |
avoid collision response between two static objects
Bullet has several options to set the friction directions By default, each contact has only a single friction direction that is recomputed automatically every frame based on the relative linear velocity. If the relative velocity is zero, it will automatically compute a friction direction.
You can also enable two friction directions, using the SOLVER_USE_2_FRICTION_DIRECTIONS. In that case, the second friction direction will be orthogonal to both contact normal and first friction direction.
If you choose SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION, then the friction will be independent from the relative projected velocity.
The user can manually override the friction directions for certain contacts using a contact callback, and set the cp.m_lateralFrictionInitialized to true In that case, you can set the target relative motion in each friction direction (cp.m_contactMotion1 and cp.m_contactMotion2) this will give a conveyor belt effect
Definition at line 1254 of file btMultiBodyConstraintSolver.cpp.
References addMultiBodyFrictionConstraint(), addMultiBodySpinningFrictionConstraint(), addMultiBodyTorsionalFrictionConstraint(), applyAnisotropicFriction(), BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED, btCollisionObject, btMultiBody, btMultiBodySolverConstraint, btPlaneSpace1(), CF_ANISOTROPIC_FRICTION, CF_ANISOTROPIC_ROLLING_FRICTION, btAlignedObjectArray< T >::expandNonInitializing(), btManifoldPoint::getDistance(), getOrInitSolverBody(), infoGlobal, btManifoldPoint::m_appliedImpulse, btManifoldPoint::m_appliedImpulseLateral1, btManifoldPoint::m_appliedImpulseLateral2, btManifoldPoint::m_combinedRollingFriction, btManifoldPoint::m_combinedSpinningFriction, btManifoldPoint::m_contactMotion1, btManifoldPoint::m_contactMotion2, btManifoldPoint::m_contactPointFlags, btManifoldPoint::m_frictionCFM, btManifoldPoint::m_lateralFrictionDir1, btManifoldPoint::m_lateralFrictionDir2, btMultiBodyLinkCollider::m_link, btMultiBodyLinkCollider::m_multiBody, m_multiBodyFrictionContactConstraints, m_multiBodyNormalContactConstraints, btManifoldPoint::m_normalWorldOnB, btManifoldPoint::m_prevRHS, btContactSolverInfoData::m_solverMode, btContactSolverInfoData::m_timeStep, setupMultiBodyContactConstraint(), btAlignedObjectArray< T >::size(), SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION, SOLVER_ENABLE_FRICTION_DIRECTION_CACHING, SOLVER_USE_2_FRICTION_DIRECTIONS, and btMultiBodyLinkCollider::upcast().
btScalar btMultiBodyConstraintSolver::resolveConeFrictionConstraintRows | ( | const btMultiBodySolverConstraint & | cA1, |
const btMultiBodySolverConstraint & | cB | ||
) |
Definition at line 318 of file btMultiBodyConstraintSolver.cpp.
References angle(), applyDeltaVee(), btAtan2(), btCos(), btFabs(), btMultiBodySolverConstraint, btSin(), btSolverBody, and m_data.
btScalar btMultiBodyConstraintSolver::resolveSingleConstraintRowGeneric | ( | const btMultiBodySolverConstraint & | c | ) |
Definition at line 235 of file btMultiBodyConstraintSolver.cpp.
References applyDeltaVee(), btSolverBody, Freestyle::c, m_data, and sum().
void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint | ( | btMultiBodySolverConstraint & | solverConstraint, |
const btVector3 & | contactNormal, | ||
const btScalar & | appliedImpulse, | ||
btManifoldPoint & | cp, | ||
const btContactSolverInfo & | infoGlobal, | ||
btScalar & | relaxation, | ||
bool | isFriction, | ||
btScalar | desiredVelocity = 0 , |
||
btScalar | cfmSlip = 0 |
||
) |
Definition at line 501 of file btMultiBodyConstraintSolver.cpp.
References applyDeltaVee(), BT_CONTACT_FLAG_CONTACT_STIFFNESS_DAMPING, BT_CONTACT_FLAG_FRICTION_ANCHOR, BT_CONTACT_FLAG_HAS_CONTACT_CFM, BT_CONTACT_FLAG_HAS_CONTACT_ERP, BT_PROFILE, btAssert, btFabs(), btMultiBody, btSolverBody, btVector3, blender::math::cross(), blender::math::distance(), blender::math::dot(), e, btRigidBody::getAngularFactor(), btManifoldPoint::getDistance(), btRigidBody::getInvInertiaTensorWorld(), btRigidBody::getInvMass(), btRigidBody::getLinearFactor(), btManifoldPoint::getPositionWorldOnA(), btManifoldPoint::getPositionWorldOnB(), btRigidBody::getTotalForce(), btRigidBody::getTotalTorque(), btRigidBody::getVelocityInLocalPoint(), infoGlobal, l, btManifoldPoint::m_appliedImpulse, btContactSolverInfoData::m_articulatedWarmstartingFactor, btManifoldPoint::m_combinedContactDamping1, btManifoldPoint::m_combinedContactStiffness1, btManifoldPoint::m_combinedFriction, btManifoldPoint::m_combinedRestitution, btManifoldPoint::m_contactCFM, btManifoldPoint::m_contactERP, btManifoldPoint::m_contactPointFlags, m_data, btContactSolverInfoData::m_erp2, btContactSolverInfoData::m_frictionCFM, btContactSolverInfoData::m_frictionERP, btContactSolverInfoData::m_globalCfm, btContactSolverInfoData::m_linearSlop, btManifoldPoint::m_prevRHS, btContactSolverInfoData::m_restitutionVelocityThreshold, btContactSolverInfoData::m_solverMode, btContactSolverInfoData::m_sor, btContactSolverInfoData::m_timeStep, btAlignedObjectArray< T >::resize(), restitutionCurve(), SIMD_EPSILON, btAlignedObjectArray< T >::size(), and SOLVER_USE_ARTICULATED_WARMSTARTING.
Referenced by addMultiBodyFrictionConstraint(), and convertMultiBodyContact().
void setupMultiBodyJointLimitConstraint | ( | btMultiBodySolverConstraint & | constraintRow, |
btScalar * | jacA, | ||
btScalar * | jacB, | ||
btScalar | penetration, | ||
btScalar | combinedFrictionCoeff, | ||
btScalar | combinedRestitutionCoeff, | ||
const btContactSolverInfo & | infoGlobal | ||
) |
void btMultiBodyConstraintSolver::setupMultiBodyTorsionalFrictionConstraint | ( | btMultiBodySolverConstraint & | solverConstraint, |
const btVector3 & | contactNormal, | ||
btManifoldPoint & | cp, | ||
btScalar | combinedTorsionalFriction, | ||
const btContactSolverInfo & | infoGlobal, | ||
btScalar & | relaxation, | ||
bool | isFriction, | ||
btScalar | desiredVelocity = 0 , |
||
btScalar | cfmSlip = 0 |
||
) |
Definition at line 888 of file btMultiBodyConstraintSolver.cpp.
References BT_PROFILE, btAssert, btMultiBody, btSolverBody, btVector3, btRigidBody::getAngularFactor(), btManifoldPoint::getDistance(), btRigidBody::getInvInertiaTensorWorld(), btManifoldPoint::getPositionWorldOnA(), btManifoldPoint::getPositionWorldOnB(), infoGlobal, l, btManifoldPoint::m_combinedRestitution, m_data, btContactSolverInfoData::m_globalCfm, btContactSolverInfoData::m_restitutionVelocityThreshold, btContactSolverInfoData::m_sor, btAlignedObjectArray< T >::resize(), restitutionCurve(), SIMD_EPSILON, and btAlignedObjectArray< T >::size().
Referenced by addMultiBodySpinningFrictionConstraint(), and addMultiBodyTorsionalFrictionConstraint().
|
virtual |
this method should not be called, it was just used during porting/integration of Featherstone btMultiBody, providing backwards compatibility but no support for btMultiBodyConstraint (only contact constraints)
|
virtual |
|
virtual |
|
virtual |
Definition at line 1740 of file btMultiBodyConstraintSolver.cpp.
References constraints, m_tmpMultiBodyConstraints, m_tmpNumMultiBodyConstraints, numBodies, numConstraints, numManifolds, and solveGroup().
|
virtual |
void btMultiBodyConstraintSolver::writeBackSolverBodyToMultiBody | ( | btMultiBodySolverConstraint & | constraint, |
btScalar | deltaTime | ||
) |
Definition at line 1521 of file btMultiBodyConstraintSolver.cpp.
References btVector3, Freestyle::c, and m_data.
btMultiBodyConstraintSolver __pad0__ |
Definition at line 29 of file btMultiBodyConstraintSolver.h.
btMultiBodyJacobianData m_data |
Definition at line 39 of file btMultiBodyConstraintSolver.h.
btMultiBodyConstraintArray m_multiBodyFrictionContactConstraints |
Definition at line 35 of file btMultiBodyConstraintSolver.h.
Referenced by addMultiBodyFrictionConstraint(), addMultiBodyTorsionalFrictionConstraint(), convertMultiBodyContact(), and btMultiBodyMLCPConstraintSolver::solveGroupCacheFriendlySetup().
btMultiBodyConstraintArray m_multiBodyNormalContactConstraints |
Definition at line 34 of file btMultiBodyConstraintSolver.h.
Referenced by convertMultiBodyContact(), and btMultiBodyMLCPConstraintSolver::solveGroupCacheFriendlySetup().
btMultiBodyConstraintArray m_multiBodySpinningFrictionContactConstraints |
Definition at line 37 of file btMultiBodyConstraintSolver.h.
Referenced by addMultiBodySpinningFrictionConstraint().
btMultiBodyConstraintArray m_multiBodyTorsionalFrictionContactConstraints |
Definition at line 36 of file btMultiBodyConstraintSolver.h.
Referenced by addMultiBodyTorsionalFrictionConstraint().
btMultiBodyConstraint** m_tmpMultiBodyConstraints |
Definition at line 42 of file btMultiBodyConstraintSolver.h.
Referenced by solveDeformableBodyGroup(), and solveMultiBodyGroup().
int m_tmpNumMultiBodyConstraints |
Definition at line 43 of file btMultiBodyConstraintSolver.h.
Referenced by solveDeformableBodyGroup(), and solveMultiBodyGroup().