* Refresh the cached camera position from the active stage. Falls back * to (0, 0, 0) when no camera exists yet (e.g. early init, before any * stage has been set). Called just-in-time before `sortOn === "depth"` * runs its sort. The camera is a `Renderable` (Camera2d/Camera3d), so * `pos.z` is g
()
| 53 | * @ignore |
| 54 | */ |
| 55 | function captureDepthCamera() { |
| 56 | const stage = state.current(); |
| 57 | const cam = stage?.cameras?.get("default"); |
| 58 | if (cam) { |
| 59 | _depthCamX = cam.pos.x; |
| 60 | _depthCamY = cam.pos.y; |
| 61 | _depthCamZ = cam.pos.z; |
| 62 | } else { |
| 63 | _depthCamX = 0; |
| 64 | _depthCamY = 0; |
| 65 | _depthCamZ = 0; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Capture the world-space position of the given container into the |