Physical substance definition, used for collision detection/treatment What we need is mu, slip and kp,kd parameter for the collision Definition of substance parameters:
More...
|
| Substance () |
|
| Substance (float roughness, float slip, float hardness, float elasticity) |
|
void | setCollisionCallback (CollisionCallback func, void *userdata) |
|
void | toDefaultSubstance () |
|
void | toMetal (float roughness) |
| very hard and elastic with slip roughness [0.1-1] More...
|
|
void | toRubber (float hardness) |
| high roughness, no slip, very elastic, hardness : [5-50] More...
|
|
void | toPlastic (float roughness) |
| medium slip, a bit elastic, medium hardness, roughness [0.5-2] More...
|
|
void | toFoam (float _hardness) |
| large slip, not elastic, low hardness [1-30], high roughness More...
|
|
void | toSnow (float _slip) |
| variable slip and roughness, not elastic, high hardness for solid snow slip = 1 <–> roughness=0.0, slip = 0 <–> roughnes=1.0 More...
|
|
void | toNoContact () |
| set the collsion callback to ignores everything Usually it is better to use the "ignorePairs" from odeHandle but if this particular one substance should not collide with any other, this is easier. More...
|
|
void | toAnisotropFriction (double ratio, const Axis &axis) |
| enables anisotrop friction. More...
|
|
|
static void | getSurfaceParams (dSurfaceParameters &sp, const Substance &s1, const Substance &s2, double stepsize) |
| Combination of two surfaces. More...
|
|
static void | printSurfaceParams (const dSurfaceParameters &surfParams) |
|
static Substance | getDefaultSubstance () |
| default substance is plastic with roughness=0.8 More...
|
|
static Substance | getMetal (float roughness) |
| very hard and elastic with slip roughness [0.1-1] More...
|
|
static Substance | getRubber (float hardness) |
| high roughness, no slip, very elastic, hardness : [5-50] More...
|
|
static Substance | getPlastic (float roughness) |
| medium slip, a bit elastic, medium hardness, roughness [0.5-2] More...
|
|
static Substance | getFoam (float _hardness) |
| large slip, not elastic, low hardness [1-30], high roughness More...
|
|
static Substance | getSnow (float _slip) |
| variable slip and roughness [0-1], not elastic, high hardness for solid snow slip = 1 <–> roughness=0.0, slip = 0 <–> roughnes=1.0 More...
|
|
static Substance | getNoContact () |
|
Physical substance definition, used for collision detection/treatment What we need is mu, slip and kp,kd parameter for the collision Definition of substance parameters:
Parameter interval collision_parameter
roughness: [0-] mu = roughness1*roughness2
slip: [0-] slip = slip1+slip2
hardness: [0-] kp = hardness1 * hardness2 / (hardness1 + hardness2) (two springs serial)
elasticity: [0-1] kd = (1-elasticity1) * s2.hardness + (1-elasticity2) * s1.hardness) /
(s1.hardness + s2.hardness);
For the calculation of the spring/damping constant we use the following schema: The collision can be considered as 2 springs serially connected. The spring constant of each collision side is given by hardness (here kp). The spring constant of the entire spring is given by
. The damping (kd) is derived from the elasticity (e), but it is more difficult to compute. Consider the damping in form of energy lost. We can write the energy or work done by each spring as:
with
. The energy lost though damping is
. The final damping is now:
.
Note that you cannot add any member variables to derived classes since they do not fit into the substance object in OdeHandle!