From 4ed78c14857d4f248b84cda93afa41e042c0a854 Mon Sep 17 00:00:00 2001 From: LeXXik Date: Tue, 29 Oct 2024 17:10:58 +0200 Subject: [PATCH 1/2] minor --- src/physics/jolt/back/motion-state.mjs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/physics/jolt/back/motion-state.mjs b/src/physics/jolt/back/motion-state.mjs index 0cf1073..2f44459 100644 --- a/src/physics/jolt/back/motion-state.mjs +++ b/src/physics/jolt/back/motion-state.mjs @@ -23,21 +23,9 @@ class MotionState { cp.x = bp.GetX(); cp.y = bp.GetY(); cp.z = bp.GetZ(); } - v1.x = cp.x * alpha; - v1.y = cp.y * alpha; - v1.z = cp.z * alpha; - - position.x = v1.x; - position.y = v1.y; - position.z = v1.z; - - v1.x = op.x * (1 - alpha); - v1.y = op.y * (1 - alpha); - v1.z = op.z * (1 - alpha); - - position.x += v1.x; - position.y += v1.y; - position.z += v1.z; + position.x = cp.x * alpha + op.x * (1 - alpha); + position.y = cp.y * alpha + op.y * (1 - alpha); + position.z = cp.z * alpha + op.z * (1 - alpha); if (!body.isCharacter) { const r = this._rotation; From b116b18ad2641f2b21d3970c038b8f3acee36a36 Mon Sep 17 00:00:00 2001 From: LeXXik Date: Tue, 29 Oct 2024 17:22:49 +0200 Subject: [PATCH 2/2] clean up --- src/physics/jolt/back/motion-state.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/physics/jolt/back/motion-state.mjs b/src/physics/jolt/back/motion-state.mjs index 2f44459..402388f 100644 --- a/src/physics/jolt/back/motion-state.mjs +++ b/src/physics/jolt/back/motion-state.mjs @@ -1,7 +1,5 @@ import { Debug } from '../debug.mjs'; -const v1 = { x: 0, y: 0, z: 0 }; - class MotionState { constructor(body) { this._body = body;