pex-renderer
pex-renderer copied to clipboard
Add activeCamera to renderer
Currently all cameras are rendered all the time if enabled
cameras
.filter((camera) => camera.enabled)
Sometimes it would be useful to have 2 or more cameras and switch between them without disabling them. E.g. debug fly camera looking at main camera from 3rd person point of view to debug FoV and near/far clipping planes defining main camera's frustum.
How this could be implemented?
// render using only selected camera
renderer.activeCamera = debugMode ? debugCamera : mainCamera
// render all cameras
renderer.activeCamera = null
debugCamera.enabled = false //prevent drawing debug view
Why not simply enable / disable cameras? E.g.:
debugCamera.enabled = true
mainCamera.enabled = false
Doing this would also hide mainCamera helpers so debugging it from 3rd person point of view would be impossible.