Package jsim.material
Class MaterialCombiner
java.lang.Object
jsim.material.MaterialCombiner
Combines two surface materials into a single contact response.
Friction is combined geometrically (sqrt product), restitution by the minimum, matching common game-engine conventions that produce stable, physically plausible results.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MaterialConvenience: produce a newMaterialfrom two surfaces.static doublecombineFriction(Material a, Material b) Combined coefficient of kinetic friction for a pair of surfaces.static doubleCombined coefficient of restitution for a pair of surfaces.
-
Method Details
-
combineFriction
Combined coefficient of kinetic friction for a pair of surfaces.Uses the geometric mean so that a zero-friction surface always produces zero friction, while two high-friction surfaces produce high combined friction.
- Parameters:
a- first surface materialb- second surface material- Returns:
- combined friction coefficient
-
combineRestitution
Combined coefficient of restitution for a pair of surfaces.Uses the minimum so that a fully inelastic body always absorbs all energy at the contact, regardless of the other body's restitution.
- Parameters:
a- first surface materialb- second surface material- Returns:
- combined restitution coefficient
-
combine
Convenience: produce a newMaterialfrom two surfaces.- Parameters:
a- first surface materialb- second surface material- Returns:
- combined material
-