Examples
import { World } from '@wimaengine/ecs'
import { createTransform3D } from '@wimaengine/transform'
const world = new World()
world.spawn(createTransform3D(0, 1, 0, 0, Math.PI / 2, 0))Function
createTransform3D(x?: number, y?: number, z?: number, ox?: number, oy?: number, oz?: number, sx?: number, sy?: number, sz?: number): [Position3D, Orientation3D, Scale3D, GlobalTransform3D]Creates the standard 3D transform component bundle for an entity.
The returned tuple contains Position3D, Orientation3D,
Scale3D, and GlobalTransform3D in insertion order.
Position defaults to (0, 0, 0), Euler orientation defaults to (0, 0, 0),
and scale defaults to (1, 1, 1). The three orientation arguments are
converted to a quaternion through Quaternion.fromEuler before
they are copied into Orientation3D.
import { World } from '@wimaengine/ecs'
import { createTransform3D } from '@wimaengine/transform'
const world = new World()
world.spawn(createTransform3D(0, 1, 0, 0, Math.PI / 2, 0))