diff --git a/web/src/main/kotlin/world/phantasmal/web/core/rendering/RenderContext.kt b/web/src/main/kotlin/world/phantasmal/web/core/rendering/RenderContext.kt index 87e2f678..0474705b 100644 --- a/web/src/main/kotlin/world/phantasmal/web/core/rendering/RenderContext.kt +++ b/web/src/main/kotlin/world/phantasmal/web/core/rendering/RenderContext.kt @@ -13,7 +13,8 @@ open class RenderContext( groundColor = 0x505050, intensity = 1.0 ) - private val lightHolder = Group().add(light) + + val lightHolder = Group().add(light) var width: Int = 0 var height: Int = 0 diff --git a/web/src/main/kotlin/world/phantasmal/web/externals/three/three.kt b/web/src/main/kotlin/world/phantasmal/web/externals/three/three.kt index 228141ec..f3b34e43 100644 --- a/web/src/main/kotlin/world/phantasmal/web/externals/three/three.kt +++ b/web/src/main/kotlin/world/phantasmal/web/externals/three/three.kt @@ -119,6 +119,8 @@ external class Quaternion( var z: Double var w: Double + fun copy(q: Quaternion): Quaternion + fun setFromEuler(euler: Euler): Quaternion /** diff --git a/web/src/main/kotlin/world/phantasmal/web/viewer/rendering/MeshRenderer.kt b/web/src/main/kotlin/world/phantasmal/web/viewer/rendering/MeshRenderer.kt index 2627ab01..a87fb588 100644 --- a/web/src/main/kotlin/world/phantasmal/web/viewer/rendering/MeshRenderer.kt +++ b/web/src/main/kotlin/world/phantasmal/web/viewer/rendering/MeshRenderer.kt @@ -52,6 +52,8 @@ class MeshRenderer( override fun render() { animation?.mixer?.update(clock.getDelta()) + context.lightHolder.quaternion.copy(context.camera.quaternion) + super.render() animation?.let {