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