Throw early if window / document is missing. SceneManager and InputHandler reach for them unconditionally, so a friendly upfront error beats a cryptic ReferenceError half-way through init for SSR or non-browser callers.
window
document
Throw early if
window/documentis missing. SceneManager and InputHandler reach for them unconditionally, so a friendly upfront error beats a cryptic ReferenceError half-way through init for SSR or non-browser callers.