Examples
import { World } from '@wimaengine/ecs'
import { createCamera3D } from '@wimaengine/render-core'
const world = new World()
const cameraEntity = world.spawn(createCamera3D(0, 0, 5))Function
createCamera3D(x?: number, y?: number, z?: number, ox?: number, oy?: number, oz?: number, sx?: number, sy?: number, sz?: number): [Position3D, Orientation3D, Scale3D, GlobalTransform3D, Camera, RenderLists3D]Creates the ordered component tuple for a 3D camera entity.
The returned tuple contains Position3D, Orientation3D,
Scale3D, GlobalTransform3D, Camera, and
RenderLists3D, in that order. The transform components are created
by createTransform3D; x, y, and z set position, ox, oy, and
oz set Euler orientation, and sx, sy, and sz set scale. The camera
is created with new Camera(), so it uses its default
PerspectiveProjection; the final component is a new
RenderLists3D.
Pass the returned tuple directly to
World#spawn to create the camera entity.
import { World } from '@wimaengine/ecs'
import { createCamera3D } from '@wimaengine/render-core'
const world = new World()
const cameraEntity = world.spawn(createCamera3D(0, 0, 5))