remove unnecessary allocations

This commit is contained in:
Piotr Goszczyński committed 2025-03-19 14:08:55 +01:00
1 parent 45c357a11f
commit 282f34dce1
2 files changed
+7 -3

No files matched your search

@@ -230,7 +230,8 @@ class HUDScene implements BaseScene {
if (this.shader.uniforms && time !== undefined) {
// Update time uniform for animation
this.shader.uniforms.time.value = time
this.shader.uniforms.resolution.value = [this.canvasWidth, this.canvasHeight]
this.shader.uniforms.resolution.value[0] = this.canvasWidth
this.shader.uniforms.resolution.value[1] = this.canvasHeight
this.shader.uniforms.vignetteRadius.value = this.shader.uniforms.vignetteRadius.value +
(this.state.vignetteRaduis - this.shader.uniforms.vignetteRadius.value) * 0.1
this.shader.uniforms.vignetteSmoothness.value = this.shader.uniforms.vignetteSmoothness.value +
@@ -584,11 +584,14 @@ class TicketScene implements BaseScene {
}
}
_visibleScaleVector = new Vector3(1, 1, 1)
_invisibleScaleVector = new Vector3(0, 0, 0)
private _updateTicketSize(time?: number) {
if (this.state.visible) {
this._ticket?.scale.lerp(new Vector3(1, 1, 1), 0.01)
this._ticket?.scale.lerp(this._visibleScaleVector, 0.01)
} else {
this._ticket?.scale.lerp(new Vector3(0, 0, 0), 0.01)
this._ticket?.scale.lerp(this._invisibleScaleVector, 0.01)
}
// Update world matrices after scaling to ensure raycaster works correctly