added initial support for per-triangle material properties in a non-convex mesh. needs testing.
This commit is contained in:
@@ -45,7 +45,7 @@ struct CollisionObject
|
||||
{
|
||||
isStatic = 1,
|
||||
noContactResponse = 2,
|
||||
|
||||
customMaterialCallback = 4,//this allows per-triangle material (friction/restitution)
|
||||
};
|
||||
|
||||
int m_collisionFlags;
|
||||
@@ -54,6 +54,9 @@ struct CollisionObject
|
||||
int m_activationState1;
|
||||
float m_deactivationTime;
|
||||
|
||||
SimdScalar m_friction;
|
||||
SimdScalar m_restitution;
|
||||
|
||||
BroadphaseProxy* m_broadphaseHandle;
|
||||
CollisionShape* m_collisionShape;
|
||||
|
||||
@@ -102,6 +105,23 @@ struct CollisionObject
|
||||
return ((GetActivationState() != ISLAND_SLEEPING) && (GetActivationState() != DISABLE_SIMULATION));
|
||||
}
|
||||
|
||||
void setRestitution(float rest)
|
||||
{
|
||||
m_restitution = rest;
|
||||
}
|
||||
float getRestitution() const
|
||||
{
|
||||
return m_restitution;
|
||||
}
|
||||
void setFriction(float frict)
|
||||
{
|
||||
m_friction = frict;
|
||||
}
|
||||
float getFriction() const
|
||||
{
|
||||
return m_friction;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user