Use full matrices for computing the stiffness matrices. Enable/disable stiffness warping.

This commit is contained in:
Irlan
2019-05-22 12:04:04 -03:00
parent 9a14c1903c
commit e0d2f9f512
4 changed files with 380 additions and 72 deletions

View File

@ -42,7 +42,7 @@ struct b3SoftBodyRayCastSingleOutput
// Soft body tetrahedron element
struct b3SoftBodyElement
{
b3Mat33 K[16];
b3Mat33 K[16];
b3Mat33 invE;
b3Quat q;
};
@ -120,6 +120,8 @@ public:
// Debug draw the body using the associated mesh.
void Draw() const;
private:
friend class b3SoftBodySolver;
// Compute mass of each node.
void ComputeMass();

View File

@ -24,6 +24,7 @@
class b3StackAllocator;
class b3SoftBody;
class b3SoftBodyMesh;
class b3SoftBodyNode;
@ -33,10 +34,7 @@ class b3NodeBodyContact;
struct b3SoftBodySolverDef
{
b3StackAllocator* stack;
const b3SoftBodyMesh* mesh;
b3SoftBodyNode* nodes;
b3SoftBodyElement* elements;
b3SoftBody* body;
};
class b3SoftBodySolver
@ -47,6 +45,7 @@ public:
void Solve(float32 dt, const b3Vec3& gravity, u32 velocityIterations, u32 positionIterations);
private:
b3SoftBody* m_body;
b3StackAllocator* m_allocator;
const b3SoftBodyMesh* m_mesh;
b3SoftBodyNode* m_nodes;