Velocity3D

View source

ExtendsVector3

Stores an entity’s linear velocity in 3D as an ECS component.

A new component starts at (0, 0, 0) and extends Vector3. Use it with Position3D and Acceleration3D.

Examples

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

const world = new World()
world.spawn([new Velocity3D(2, 0, -1)])

new Query(world, [Velocity3D]).each(([velocity]) => {
  velocity.x = 3
  velocity.z = 0
})

Constructor


Methods


staticserialize(value: Velocity3D): Vector3Like

View source

Parameters

NameDescriptionDefault
value——
  • @inheritDoc