Skip to content

@modoki/engine / rendering / syncCamera

Function: syncCamera()

syncCamera(world, scene, persp, ortho?): OrthographicCamera | PerspectiveCamera

Drive the perspective + orthographic cameras from the ECS Camera entity and return whichever one Camera.projection selects (the active render camera). Transform (pos/rot) is written to BOTH so a live projection toggle is seamless.

Parameters

world

World

scene

Scene

persp

PerspectiveCamera

ortho?

OrthographicCamera

Returns

OrthographicCamera | PerspectiveCamera

Built with Modoki.