17#ifndef _BT_SOFT_BODY_H
18#define _BT_SOFT_BODY_H
34#define btSoftBodyData btSoftBodyFloatData
35#define btSoftBodyDataName "btSoftBodyFloatData"
716 const Node* node1)
const;
743 void appendLink(
int model=-1,Material* mat=0);
747 bool bcheckexist=
false);
751 bool bcheckexist=
false);
753 void appendFace(
int model=-1,Material* mat=0);
808 bool fromfaces=
false);
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
btCollisionObject can be used to manage collision detection objects.
btTransform & getWorldTransform()
int getInternalType() const
reserved for Bullet internal usage
void activate(bool forceActivation=false) const
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
The btRigidBody is the main class for rigid body objects.
void applyTorqueImpulse(const btVector3 &torque)
btScalar getInvMass() const
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
void applyCentralImpulse(const btVector3 &impulse)
const btVector3 & getAngularVelocity() const
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
const btMatrix3x3 & getInvInertiaTensorWorld() const
const btVector3 & getLinearVelocity() const
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
static void PSolve_Links(btSoftBody *psb, btScalar kst, btScalar ti)
static void PSolve_SContacts(btSoftBody *psb, btScalar, btScalar ti)
bool checkLink(int node0, int node1) const
bool checkFace(int node0, int node1, int node2) const
btAlignedObjectArray< eVSolver::_ > tVSolverArray
void setPose(bool bvolume, bool bframe)
bool cutLink(int node0, int node1, btScalar position)
void appendFace(int model=-1, Material *mat=0)
void setMass(int node, btScalar mass)
btAlignedObjectArray< Tetra > tTetraArray
void appendLinearJoint(const LJoint::Specs &specs, Cluster *body0, Body body1)
btAlignedObjectArray< SContact > tSContactArray
void scale(const btVector3 &scl)
btAlignedObjectArray< bool > m_clusterConnectivity
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
btScalar getVolume() const
bool rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Ray casting using rayFrom and rayTo in worldspace, (not direction!)
void addVelocity(const btVector3 &velocity)
btAlignedObjectArray< RContact > tRContactArray
void predictMotion(btScalar dt)
btAlignedObjectArray< int > m_userIndexMapping
btAlignedObjectArray< Face > tFaceArray
void appendTetra(int model, Material *mat)
void setRestLengthScale(btScalar restLength)
void rotate(const btQuaternion &rot)
void applyClusters(bool drift)
static void PSolve_Anchors(btSoftBody *psb, btScalar kst, btScalar ti)
btSoftBodyWorldInfo * m_worldInfo
void setSoftBodySolver(btSoftBodySolver *softBodySolver)
void updateArea(bool averageArea=true)
void addForce(const btVector3 &force)
void prepareClusters(int iterations)
static void clusterVImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
static void VSolve_Links(btSoftBody *psb, btScalar kst)
btVector3 evaluateCom() const
void setTotalDensity(btScalar density)
btAlignedObjectArray< const class btCollisionObject * > m_collisionDisabledObjects
btAlignedObjectArray< Link > tLinkArray
static void clusterDAImpulse(Cluster *cluster, const btVector3 &impulse)
void appendNode(const btVector3 &x, btScalar m)
btTransform m_initialWorldTransform
void staticSolve(int iterations)
void setVolumeMass(btScalar mass)
btScalar m_restLengthScale
const btVector3 & getWindVelocity()
Return the wind velocity for interaction with the air.
void addAeroForceToFace(const btVector3 &windVelocity, int faceIndex)
void appendAngularJoint(const AJoint::Specs &specs, Cluster *body0, Body body1)
void setVolumeDensity(btScalar density)
static void clusterDCImpulse(Cluster *cluster, const btVector3 &impulse)
void transform(const btTransform &trs)
static void clusterVAImpulse(Cluster *cluster, const btVector3 &impulse)
btScalar getMass(int node) const
tMaterialArray m_materials
btSoftBody(btSoftBodyWorldInfo *worldInfo, int node_count, const btVector3 *x, const btScalar *m)
btSoftBody implementation by Nathanael Presson
void addAeroForceToNode(const btVector3 &windVelocity, int nodeIndex)
btAlignedObjectArray< btVector3 > tVector3Array
static btVector3 clusterCom(const Cluster *cluster)
tRContactArray m_rcontacts
void appendAnchor(int node, btRigidBody *body, bool disableCollisionBetweenLinkedBodies=false, btScalar influence=1)
btAlignedObjectArray< Node > tNodeArray
void releaseCluster(int index)
void setVelocity(const btVector3 &velocity)
btAlignedObjectArray< Joint * > tJointArray
int generateClusters(int k, int maxiterations=8192)
generateClusters with k=0 will create a convex cluster for each tetrahedron or triangle otherwise an ...
void refine(ImplicitFn *ifn, btScalar accurary, bool cut)
void setSolver(eSolverPresets::_ preset)
Material * appendMaterial()
btAlignedObjectArray< Material * > tMaterialArray
btAlignedObjectArray< Anchor > tAnchorArray
static void solveClusters(const btAlignedObjectArray< btSoftBody * > &bodies)
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)
virtual int calculateSerializeBufferSize() const
btAlignedObjectArray< btSoftBody * > tSoftBodyArray
static void PSolve_RContacts(btSoftBody *psb, btScalar kst, btScalar ti)
static void clusterImpulse(Cluster *cluster, const btVector3 &rpos, const Impulse &impulse)
static void clusterDImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
static btVector3 clusterVelocity(const Cluster *cluster, const btVector3 &rpos)
tSContactArray m_scontacts
btAlignedObjectArray< btDbvtNode * > tLeafArray
void(* psolver_t)(btSoftBody *, btScalar, btScalar)
void initializeClusters()
btSoftBodyWorldInfo * getWorldInfo()
btScalar getRestLengthScale()
btAlignedObjectArray< Note > tNoteArray
void randomizeConstraints()
virtual void setCollisionShape(btCollisionShape *collisionShape)
btScalar getTotalMass() const
btAlignedObjectArray< ePSolver::_ > tPSolverArray
void appendLink(int model=-1, Material *mat=0)
static const btSoftBody * upcast(const btCollisionObject *colObj)
void setTotalMass(btScalar mass, bool fromfaces=false)
btSoftBodySolver * getSoftBodySolver()
void updateLinkConstants()
virtual void getAabb(btVector3 &aabbMin, btVector3 &aabbMax) const
void(* vsolver_t)(btSoftBody *, btScalar)
static psolver_t getSolver(ePSolver::_ solver)
bool checkContact(const btCollisionObjectWrapper *colObjWrap, const btVector3 &x, btScalar margin, btSoftBody::sCti &cti) const
void indicesToPointers(const int *map=0)
static void solveCommonConstraints(btSoftBody **bodies, int count, int iterations)
btAlignedObjectArray< Cluster * > tClusterArray
void setWindVelocity(const btVector3 &velocity)
Set a wind velocity for interaction with the air.
btSoftBodySolver * getSoftBodySolver() const
int generateBendingConstraints(int distance, Material *mat=0)
void translate(const btVector3 &trs)
void initializeFaceTree()
btSoftBodySolver * m_softBodySolver
void resetLinkRestLengths()
btAlignedObjectArray< btScalar > tScalarArray
static void clusterAImpulse(Cluster *cluster, const Impulse &impulse)
static btSoftBody * upcast(btCollisionObject *colObj)
btVector3 can be used to represent 3D points and vectors.
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
btDispatcher * m_dispatcher
btSparseSdf< 3 > m_sparsesdf
btScalar m_maxDisplacement
btBroadphaseInterface * m_broadphase
static IControl * Default()
virtual btScalar Speed(AJoint *, btScalar current)
virtual void Prepare(AJoint *)
void Prepare(btScalar dt, int iterations)
void Solve(btScalar dt, btScalar sor)
void Terminate(btScalar dt)
const btMatrix3x3 & invWorldInertia() const
void applyVImpulse(const btVector3 &impulse, const btVector3 &rpos) const
btVector3 angularVelocity() const
btVector3 linearVelocity() const
btVector3 angularVelocity(const btVector3 &rpos) const
void applyDImpulse(const btVector3 &impulse, const btVector3 &rpos) const
Body(const btCollisionObject *colObj)
btVector3 velocity(const btVector3 &rpos) const
void applyDCImpulse(const btVector3 &impulse) const
void applyDAImpulse(const btVector3 &impulse) const
const btTransform & xform() const
void applyVAImpulse(const btVector3 &impulse) const
void applyAImpulse(const Impulse &impulse) const
void applyImpulse(const Impulse &impulse, const btVector3 &rpos) const
const btCollisionObject * m_collisionObject
void Terminate(btScalar dt)
void Prepare(btScalar dt, int iterations)
void Solve(btScalar dt, btScalar sor)
tVector3Array m_framerefs
btScalar m_maxSelfCollisionImpulse
btAlignedObjectArray< Node * > m_nodes
btScalar m_selfCollisionImpulseFactor
tPSolverArray m_psequence
tPSolverArray m_dsequence
tVSolverArray m_vsequence
virtual btScalar Eval(const btVector3 &x)=0
Impulse operator*(btScalar x) const
Impulse operator-() const
virtual void Solve(btScalar dt, btScalar sor)=0
virtual void Terminate(btScalar dt)=0
virtual void Prepare(btScalar dt, int iterations)
virtual eType::_ Type() const =0
void Solve(btScalar dt, btScalar sor)
void Prepare(btScalar dt, int iterations)
void Terminate(btScalar dt)
BT_DECLARE_ALIGNED_ALLOCATOR()
RayFromToCaster takes a ray from, ray to (instead of direction!)
RayFromToCaster(const btVector3 &rayFrom, const btVector3 &rayTo, btScalar mxt)
void Process(const btDbvtNode *leaf)
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)
btVector3 m_rayNormalizedDirection
@ V_TwoSided
Vertex normals are oriented toward velocity.
@ V_OneSided
Vertex normals are flipped to match velocity and lift and drag forces are applied.
@ END
Face normals are taken as it is
@ V_TwoSidedLiftDrag
Vertex normals are flipped to match velocity
@ F_OneSided
Face normals are flipped to match velocity and lift and drag forces are applied.
@ F_TwoSided
Vertex normals are taken as it is
@ F_TwoSidedLiftDrag
Face normals are flipped to match velocity.
ePSolver : positions solvers
@ RContacts
Anchor solver.
@ SContacts
Rigid contacts solver.
@ END
Soft contacts solver.
eVSolver : velocities solvers
@ VF_SS
Rigid versus soft mask
@ Default
Cluster soft body self collision.
@ CL_SS
Vertex vs face soft vs soft handling.
@ CL_SELF
Cluster vs cluster soft vs soft handling.
@ SVSmask
Cluster vs convex rigid vs soft.
@ SDF_RS
Rigid versus soft mask.
@ CL_RS
SDF based rigid vs soft.
@ Default
Enable debug draw.
const btCollisionObject * m_colObj
eFeature::_ feature
soft body
btScalar fraction
feature index