PhysicsComponent - acrimi/Raven GitHub Wiki

PhysicsComponent encapsulates the state of an entity as a dynamic physics object, including its mass, speed, acceleration, and any forces currently being exerted up on it.

Configuration

When used inside the components block, the initial state of the component can be configured with the following parameters:

Key Type Description
mass float The mass, in kilograms, of the entity. Defaults to 60.
coefficientOfFriction float The coefficient used to calculate both traction for thrust and kinetic friction for movement. Defaults to 1.

Example:

"PhysicsComponent": {
  "mass": 30,
  "coefficientOfFriction": 0.75
}

Properties

The following properties are readable by property accessors (eg render state and persistence definitions):

Key Type Description
speed float The current scalar speed of the entity, in gl units per second.