Rotation3D

View source

ExtendsVector3

Represents an entity’s angular motion in 3D as an ECS component.

Use it to describe how an entity rotates around each axis over time. It extends Vector3 and starts at (0, 0, 0). Pair it with Orientation3D when an entity needs both angular motion and a current 3D orientation.

Examples

import { Query, World } from '@wimaengine/ecs'
import { Rotation3D } from '@wimaengine/movable'

const world = new World()
world.spawn([new Rotation3D(0, 0.25, 0)])

const rotations = new Query(world, [Rotation3D])
rotations.each(([rotation]) => {
  rotation.y += 0.1
})

Constructor


Methods


staticserialize(value: Rotation3D): Vector3Like

View source

Parameters

NameDescriptionDefault
value——
  • @inheritDoc