From 9f92f024b1739114852c5fb7258a5d519fc6aa06 Mon Sep 17 00:00:00 2001 From: Karl Pannek Date: Fri, 18 Jul 2025 22:27:42 +0200 Subject: [PATCH] Fix Planck.js migration issues and restore RubeDoll functionality - Fixed Mat22.fromAngle -> Rot.rot() error in RubeDoll.js - Fixed rot.mul() -> Rot.mul(rot, v) static method usage - Restored RubeLoader imports and RubeDoll.json loading - Migrated RubeLoader.js from Box2D to Planck.js API - Updated all Box2D method calls to Planck.js equivalents - Fixed import aliases from Box2D to planck across multiple files - RubeDoll ragdolls now spawn correctly when players die --- app/Game/Core/GameObjects/Items/RubeDoll.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index 90df0f2..7c0d87e 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -147,14 +147,14 @@ function (Parent, RubeLoader, planck, Settings, Assert, nc, Matrix, RubeDollJson // grabing local point to "rotate" around (x, y position transform only) var localPoint = this.body.getLocalPoint(limb.getPosition().clone()); - // create rotation matrix from chest rotation difference - var mat = planck.Mat22.fromAngle(differenceAngle); + // create rotation from chest rotation difference + var rot = planck.Rot(differenceAngle); - // matrix multiplication with local limb position - position = mat.mulTV(localPoint); + // rotate the local point using static method + var rotatedPoint = planck.Rot.mul(rot, localPoint); // translating back to global position - var globalPoint = this.body.getWorldPoint(position); + var globalPoint = this.body.getWorldPoint(rotatedPoint); limb.setPosition(globalPoint); // relative limb rotating by chest rotation difference