Include Rayleigh damping. Use struct instead of class. Update PinnedSoftBody test

This commit is contained in:
Irlan
2019-05-24 13:04:42 -03:00
parent 5e044795df
commit b6f504b371
7 changed files with 44 additions and 15 deletions

View File

@ -26,7 +26,8 @@ class b3World;
struct b3SoftBodyMesh;
class b3SoftBodyNode;
struct b3SoftBodyNode;
struct b3SoftBodyElement;
struct b3RayCastInput;
struct b3RayCastOutput;

View File

@ -24,10 +24,10 @@
class b3StackAllocator;
class b3SoftBodyNode;
struct b3SoftBodyNode;
class b3Body;
class b3NodeBodyContact;
struct b3NodeBodyContact;
struct b3DenseVec3;

View File

@ -25,15 +25,11 @@
class b3Shape;
class b3SoftBody;
class b3SoftBodyNode;
struct b3SoftBodyNode;
// A contact between a node and a body
class b3NodeBodyContact
struct b3NodeBodyContact
{
public:
b3NodeBodyContact() { }
~b3NodeBodyContact() { }
b3SoftBodyNode* n1;
b3Shape* s2;
@ -81,7 +77,7 @@ enum b3SoftBodyNodeType
};
// A soft body node.
class b3SoftBodyNode
struct b3SoftBodyNode
{
public:
// Set the node type.
@ -110,6 +106,12 @@ public:
// Get the node mass.
float32 GetMass() const;
// Set the node damping.
void SetDamping(float32 damping);
// Get the node damping.
float32 GetDamping() const;
// Set the node radius.
void SetRadius(float32 radius);
@ -151,6 +153,9 @@ private:
// Inverse mass
float32 m_invMass;
// Damping
float32 m_damping;
// Radius
float32 m_radius;
@ -227,6 +232,16 @@ inline float32 b3SoftBodyNode::GetMass() const
return m_mass;
}
inline void b3SoftBodyNode::SetDamping(float32 damping)
{
m_damping = damping;
}
inline float32 b3SoftBodyNode::GetDamping() const
{
return m_damping;
}
inline void b3SoftBodyNode::SetRadius(float32 radius)
{
m_radius = radius;

View File

@ -27,10 +27,10 @@ class b3StackAllocator;
class b3SoftBody;
class b3SoftBodyMesh;
class b3SoftBodyNode;
struct b3SoftBodyNode;
struct b3SoftBodyElement;
class b3NodeBodyContact;
struct b3NodeBodyContact;
struct b3SoftBodySolverDef
{