Skip to content

Class: Motion

Motion is a component that represents an entity with motion values. Holds info such as velocity, acceleration, angular velocity and angular acceleration.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

+ new Motion(velocity?: Vector, acceleration?: Vector, angularVelocity?: number, angularAcceleration?: number): Motion

Parameters:

Name Type Default value
velocity Vector -
acceleration Vector -
angularVelocity number 0
angularAcceleration number 0

Returns: Motion

Inherited from: Component

Properties

acceleration

acceleration: Vector

Acceleration of the entity.


angularAcceleration

angularAcceleration: number

Angular acceleration of the entity around the Z axis, scalar value.


angularVelocity

angularVelocity: number

Angular velocity of the entity around the Z axis, scalar value.


key

key: string

Inherited from: Component.key


velocity

velocity: Vector

Velocity of the entity.


KEY

Readonly Static KEY: motion= "motion"

Key of the motion component.


MESSAGE_ADD

Readonly Static MESSAGE_ADD: component_add= "component_add"

Inherited from: Component.MESSAGE_ADD


MESSAGE_REMOVE

Readonly Static MESSAGE_REMOVE: component_remove= "component_remove"

Inherited from: Component.MESSAGE_REMOVE

Methods

Free

Free(): void

Returns: void

Overrides: Component