PhysicsMaterial

@ConfigSerializable
data class PhysicsMaterial(val friction: Double = DEFAULT_FRICTION, val restitution: Double = DEFAULT_RESTITUTION, val frictionCombine: CoeffCombineRule = CoeffCombineRule.AVERAGE, val restitutionCombine: CoeffCombineRule = CoeffCombineRule.AVERAGE)

A set of physical properties that can be applied to a Collider.

Parameters

friction

A coefficient representing the static + dynamic friction, which is a force that opposes motion between two bodies. Minimum 0, typically between 0 and 1. 0 implies no friction, 1 implies very strong friction.

restitution

A coefficient representing how elastic ("bouncy") a contact is. Minimum 0, typically between 0 and 1. 0 implies that the exit velocity after a contact is 0, 1 implies that the exit velocity is the same as entry velocity.

frictionCombine

Which rule is used to combine the friction coefficients of two colliding bodies.

restitutionCombine

Which rule is used to combine the restitution coefficients of two colliding bodies.

Constructors

Link copied to clipboard
constructor(friction: Double = DEFAULT_FRICTION, restitution: Double = DEFAULT_RESTITUTION, frictionCombine: CoeffCombineRule = CoeffCombineRule.AVERAGE, restitutionCombine: CoeffCombineRule = CoeffCombineRule.AVERAGE)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard