Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
17 #ifndef _BT_SOFT_BODY_H
18 #define _BT_SOFT_BODY_H
36 #define btSoftBodyData btSoftBodyFloatData
37 #define btSoftBodyDataName "btSoftBodyFloatData"
510 static const btMatrix3x3 iwi(0, 0, 0, 0, 0, 0, 0, 0, 0);
860 const Node* node1)
const;
887 void appendLink(
int model = -1, Material* mat = 0);
891 bool bcheckexist =
false);
895 bool bcheckexist =
false);
897 void appendFace(
int model = -1, Material* mat = 0);
914 btRigidBody* body,
bool disableCollisionBetweenLinkedBodies =
false,
btScalar influence = 1);
953 bool fromfaces =
false);
1002 static void clusterAImpulse(Cluster* cluster,
const Impulse& impulse);
1020 bool cutLink(
const Node* node0,
const Node* node1,
btScalar position);
1162 #endif //_BT_SOFT_BODY_H
virtual int calculateSerializeBufferSize() const
btScalar m_restLengthScale
void applyVAImpulse(const btVector3 &impulse) const
btMultiBodyJacobianData jacobianData_t2
void updateDeactivation(btScalar timeStep)
void Solve(btScalar dt, btScalar sor)
void addVelocity(const btVector3 &velocity)
const btTransform & xform() const
btCollisionObject can be used to manage collision detection objects.
bool checkLink(int node0, int node1) const
virtual void Terminate(btScalar dt)=0
btAlignedObjectArray< Anchor > tAnchorArray
static void PSolve_Links(btSoftBody *psb, btScalar kst, btScalar ti)
tVSolverArray m_vsequence
static void solveClusters(const btAlignedObjectArray< btSoftBody * > &bodies)
btVector3 angularVelocity(const btVector3 &rpos) const
The btRigidBody is the main class for rigid body objects.
Cluster soft body self collision.
void setDampingCoefficient(btScalar damping_coeff)
void(* vsolver_t)(btSoftBody *, btScalar)
void appendLink(int model=-1, Material *mat=0)
static btSoftBody * upcast(btCollisionObject *colObj)
void Terminate(btScalar dt)
btAlignedObjectArray< bool > m_clusterConnectivity
btAlignedObjectArray< Link > tLinkArray
void indicesToPointers(const int *map=0)
btAlignedObjectArray< Cluster * > tClusterArray
Face normals are flipped to match velocity and lift and drag forces are applied.
ePSolver : positions solvers
const btCollisionObject * m_collisionObject
btAlignedObjectArray< ePSolver::_ > tPSolverArray
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
void appendFace(int model=-1, Material *mat=0)
void(* psolver_t)(btSoftBody *, btScalar, btScalar)
btAlignedObjectArray< btVector3 > m_quads
const btVector3 & getAngularVelocity() const
btAlignedObjectArray< DeformableFaceNodeContact > m_faceNodeContacts
void Prepare(btScalar dt, int iterations)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void refine(ImplicitFn *ifn, btScalar accurary, bool cut)
void prepareClusters(int iterations)
btScalar m_sleepingThreshold
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
bool checkDeformableContact(const btCollisionObjectWrapper *colObjWrap, const btVector3 &x, btScalar margin, btSoftBody::sCti &cti, bool predict=false) const
virtual eType::_ Type() const =0
Cluster vs convex rigid vs soft.
btVector3 getCenterOfMass() const
void appendNote(const char *text, const btVector3 &o, const btVector4 &c=btVector4(1, 0, 0, 0), Node *n0=0, Node *n1=0, Node *n2=0, Node *n3=0)
btDispatcher * m_dispatcher
const btVector3 & getWindVelocity()
Return the wind velocity for interaction with the air.
void Terminate(btScalar dt)
static const btSoftBody * upcast(const btCollisionObject *colObj)
void appendAnchor(int node, btRigidBody *body, bool disableCollisionBetweenLinkedBodies=false, btScalar influence=1)
void staticSolve(int iterations)
void applyDAImpulse(const btVector3 &impulse) const
Material * appendMaterial()
btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
void resetLinkRestLengths()
static btVector3 clusterCom(const Cluster *cluster)
void applyTorqueImpulse(const btVector3 &torque)
btAlignedObjectArray< Note > tNoteArray
void setVolumeDensity(btScalar density)
void setSelfCollision(bool useSelfCollision)
void setWindVelocity(const btVector3 &velocity)
Set a wind velocity for interaction with the air.
btAlignedObjectArray< Tetra > tTetraArray
static btVector3 clusterVelocity(const Cluster *cluster, const btVector3 &rpos)
btVector3 velocity(const btVector3 &rpos) const
void addAeroForceToFace(const btVector3 &windVelocity, int faceIndex)
Body(const btCollisionObject *colObj)
btAlignedObjectArray< SContact > tSContactArray
void applyDImpulse(const btVector3 &impulse, const btVector3 &rpos) const
tVector3Array m_framerefs
bool checkFace(int node0, int node1, int node2) const
const btMatrix3x3 & invWorldInertia() const
void randomizeConstraints()
void applyImpulse(const Impulse &impulse, const btVector3 &rpos) const
tMaterialArray m_materials
void Solve(btScalar dt, btScalar sor)
btMultiBodyJacobianData jacobianData_t1
int generateClusters(int k, int maxiterations=8192)
generateClusters with k=0 will create a convex cluster for each tetrahedron or triangle otherwise an ...
Face normals are flipped to match velocity.
void setUseFaceContact(bool useFaceContact)
btAlignedObjectArray< TetraScratch > m_tetraScratches
btAlignedObjectArray< btVector4 > m_renderNodesInterpolationWeights
static void PSolve_RContacts(btSoftBody *psb, btScalar kst, btScalar ti)
static IControl * Default()
virtual void Prepare(AJoint *)
btScalar getVolume() const
Face normals are taken as it is.
btAlignedObjectArray< btAlignedObjectArray< const btSoftBody::Node * > > m_renderNodesParents
btTransform & getWorldTransform()
tSContactArray m_scontacts
btAlignedObjectArray< RContact > tRContactArray
btAlignedObjectArray< int > m_userIndexMapping
btAlignedObjectArray< Node * > m_nodes
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btAlignedObjectArray< DeformableFaceRigidContact > m_faceRigidContacts
btScalar fraction
feature index
const btCollisionObject * m_colObj
btScalar m_element_measure
btSoftBodyWorldInfo * m_worldInfo
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
void Process(const btDbvtNode *leaf)
Vertex vs face soft vs soft handling.
btVector3 angularVelocity() const
virtual btScalar Speed(AJoint *, btScalar current)
RayFromToCaster(const btVector3 &rayFrom, const btVector3 &rayTo, btScalar mxt)
btMultiBodyJacobianData jacobianData_normal
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
btAlignedObjectArray< btVector3 > tVector3Array
btMultiBodyJacobianData jacobianData_t2
btTransform m_initialWorldTransform
void activate(bool forceActivation=false) const
static void PSolve_SContacts(btSoftBody *psb, btScalar, btScalar ti)
void Prepare(btScalar dt, int iterations)
void transform(const btTransform &trs)
btSoftBodyWorldInfo * getWorldInfo()
btAlignedObjectArray< TetraScratch > m_tetraScratchesTn
void setSpringStiffness(btScalar k)
void addAeroForceToNode(const btVector3 &windVelocity, int nodeIndex)
void setSoftBodySolver(btSoftBodySolver *softBodySolver)
btAlignedObjectArray< Material * > tMaterialArray
tPSolverArray m_psequence
static void clusterAImpulse(Cluster *cluster, const Impulse &impulse)
btVector3 linearVelocity() const
static void clusterVAImpulse(Cluster *cluster, const btVector3 &impulse)
btScalar m_maxSpeedSquared
void appendNode(const btVector3 &x, btScalar m)
btAlignedObjectArray< Face > tFaceArray
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
static void solveCommonConstraints(btSoftBody **bodies, int count, int iterations)
btScalar getInvMass() const
btScalar m_maxSelfCollisionImpulse
static psolver_t getSolver(ePSolver::_ solver)
btSoftBodySolver * getSoftBodySolver()
void predictMotion(btScalar dt)
void initializeFaceTree()
static void clusterDCImpulse(Cluster *cluster, const btVector3 &impulse)
btScalar m_maxDisplacement
void setPose(bool bvolume, bool bframe)
btVector3 can be used to represent 3D points and vectors.
void setMaxStress(btScalar maxStress)
static btScalar rayFromToTriangle(const btVector3 &rayFrom, const btVector3 &rayTo, const btVector3 &rayNormalizedDirection, const btVector3 &a, const btVector3 &b, const btVector3 &c, btScalar maxt=SIMD_INFINITY)
void setRestLengthScale(btScalar restLength)
btSoftBodySolver * m_softBodySolver
const btVector3 & getLinearVelocity() const
DF based rigid vs deformable faces.
void appendAngularJoint(const AJoint::Specs &specs, Cluster *body0, Body body1)
virtual void getAabb(btVector3 &aabbMin, btVector3 &aabbMax) const
DF based rigid vs deformable.
btScalar getMass(int node) const
#define ATTRIBUTE_ALIGNED16(a)
void appendLinearJoint(const LJoint::Specs &specs, Cluster *body0, Body body1)
void scale(const btVector3 &scl)
btSoftBodySolver * getSoftBodySolver() const
btAlignedObjectArray< eVSolver::_ > tVSolverArray
virtual btScalar Eval(const btVector3 &x)=0
btAlignedObjectArray< Joint * > tJointArray
tRContactArray m_rcontacts
btVector3 evaluateCom() const
btSoftBody(btSoftBodyWorldInfo *worldInfo, int node_count, const btVector3 *x, const btScalar *m)
btSoftBody implementation by Nathanael Presson
btScalar getRestLengthScale()
btScalar m_selfCollisionImpulseFactor
void setTotalMass(btScalar mass, bool fromfaces=false)
void initializeClusters()
bool rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Ray casting using rayFrom and rayTo in worldspace, (not direction!)
void applyAImpulse(const Impulse &impulse) const
tPSolverArray m_dsequence
void rotate(const btQuaternion &rot)
void updateLinkConstants()
Vertex normals are oriented toward velocity.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
virtual void Solve(btScalar dt, btScalar sor)=0
void setTotalDensity(btScalar density)
void applyCentralImpulse(const btVector3 &impulse)
void applyVImpulse(const btVector3 &impulse, const btVector3 &rpos) const
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
void Prepare(btScalar dt, int iterations)
void appendDeformableAnchor(int node, btRigidBody *body)
bool checkContact(const btCollisionObjectWrapper *colObjWrap, const btVector3 &x, btScalar margin, btSoftBody::sCti &cti) const
btAlignedObjectArray< DeformableNodeRigidContact > m_nodeRigidContacts
virtual void setCollisionShape(btCollisionShape *collisionShape)
int getInternalType() const
reserved for Bullet internal usage
void appendTetra(int model, Material *mat)
void releaseCluster(int index)
RayFromToCaster takes a ray from, ray to (instead of direction!)
Vertex normals are flipped to match velocity.
const btMatrix3x3 & getInvInertiaTensorWorld() const
virtual void Prepare(btScalar dt, int iterations)
void setVolumeMass(btScalar mass)
Vertex normals are flipped to match velocity and lift and drag forces are applied.
static void clusterDImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
void setSolver(eSolverPresets::_ preset)
void setCollisionQuadrature(int N)
void updateArea(bool averageArea=true)
btAlignedObjectArray< DeformableNodeRigidAnchor > m_deformableAnchors
void applyClusters(bool drift)
btMultiBodyJacobianData jacobianData_t1
bool cutLink(int node0, int node1, btScalar position)
bool checkDeformableFaceContact(const btCollisionObjectWrapper *colObjWrap, Face &f, btVector3 &contact_point, btVector3 &bary, btScalar margin, btSoftBody::sCti &cti, bool predict=false) const
Impulse operator-() const
void setMass(int node, btScalar mass)
btAlignedObjectArray< const class btCollisionObject * > m_collisionDisabledObjects
static void PSolve_Anchors(btSoftBody *psb, btScalar kst, btScalar ti)
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
Cluster vs cluster soft vs soft handling.
btBroadphaseInterface * m_broadphase
int generateBendingConstraints(int distance, Material *mat=0)
void interpolateRenderMesh()
eFeature::_ feature
soft body
btSparseSdf< 3 > m_sparsesdf
static void VSolve_Links(btSoftBody *psb, btScalar kst)
void Solve(btScalar dt, btScalar sor)
btAlignedObjectArray< Node > tNodeArray
btAlignedObjectArray< btSoftBody * > tSoftBodyArray
void advanceDeformation()
static void clusterImpulse(Cluster *cluster, const btVector3 &rpos, const Impulse &impulse)
Vertex vs face soft vs soft handling.
eVSolver : velocities solvers
void addForce(const btVector3 &force)
Vertex normals are taken as it is.
void translate(const btVector3 &trs)
static void clusterVImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
btAlignedObjectArray< btScalar > tScalarArray
btMultiBodyJacobianData jacobianData_normal
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
void initializeDmInverse()
BT_DECLARE_ALIGNED_ALLOCATOR()
btScalar getTotalMass() const
static void clusterDAImpulse(Cluster *cluster, const btVector3 &impulse)
Impulse operator*(btScalar x) const
btVector3 m_rayNormalizedDirection
int size() const
return the number of elements in the array
void setVelocity(const btVector3 &velocity)
btScalar m_dampingCoefficient
void Terminate(btScalar dt)
void applyDCImpulse(const btVector3 &impulse) const
btAlignedObjectArray< btDbvtNode * > tLeafArray