Skip to main content

Class: RotationComponent

Defined in: common/components/rotation-component.ts:7

Component to represent the rotation of an entity in 2D space.

Extends

Constructors

Constructor

new RotationComponent(radians): RotationComponent

Defined in: common/components/rotation-component.ts:21

Creates an instance of RotationComponent.

Parameters

radians

number = 0

The rotation angle in radians.

Returns

RotationComponent

Overrides

Component.constructor

Properties

local

local: number

Defined in: common/components/rotation-component.ts:11

The local rotation angle in radians.


world

world: number

Defined in: common/components/rotation-component.ts:15

The world rotation angle in radians.

Accessors

id

Get Signature

get static id(): symbol

Defined in: ecs/types/Component.ts:12

The unique id of the component.

Returns

symbol

Inherited from

Component.id

Methods

fromDegrees()

static fromDegrees(degrees): RotationComponent

Defined in: common/components/rotation-component.ts:33

Creates a RotationComponent from an angle in degrees.

Parameters

degrees

number

The rotation angle in degrees.

Returns

RotationComponent

A new instance of RotationComponent.