From 1e08a1a661f8900f7f66fe10208a0e79a2ea5e9d Mon Sep 17 00:00:00 2001 From: luboslenco Date: Fri, 29 Nov 2024 12:15:46 +0100 Subject: [PATCH] Cleanup --- armorcore/sources/ts/transform.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/armorcore/sources/ts/transform.ts b/armorcore/sources/ts/transform.ts index 87258f69..6f3d0697 100644 --- a/armorcore/sources/ts/transform.ts +++ b/armorcore/sources/ts/transform.ts @@ -171,15 +171,11 @@ function transform_compute_radius(raw: transform_t) { } function transform_compute_dim(raw: transform_t) { - if (raw.object.raw == null) { - transform_compute_radius(raw); - return; - } - let d: f32_array_t = raw.object.raw.dimensions; - if (d == null) { + if (raw.object.raw == null || raw.object.raw.dimensions == null) { raw.dim = vec4_create(2 * raw.scale.x, 2 * raw.scale.y, 2 * raw.scale.z); } else { + let d: f32_array_t = raw.object.raw.dimensions; raw.dim = vec4_create(d[0] * raw.scale.x, d[1] * raw.scale.y, d[2] * raw.scale.z); } transform_compute_radius(raw);