From a834866fcd316e2b91d5c65488114418691d6d89 Mon Sep 17 00:00:00 2001 From: arcattack Date: Wed, 8 Jul 2026 16:39:15 -0500 Subject: [PATCH] Enemy spawn faces the player (was copying the player's pose -> back turned) The dummy spawned 120u along the player's forward with the SAME orientation, so both mechs faced the same way and the player stared at its back (also why first shots read as rear hits). Flip the enemy's yaw 180 deg about Y (engine convention: Z basis = (sin y, 0, cos y) -> yaw = atan2(z.x, z.z) + pi) so the two spawn face to face. Co-Authored-By: Claude Fable 5 --- game/reconstructed/btplayer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/game/reconstructed/btplayer.cpp b/game/reconstructed/btplayer.cpp index 20adfcb..4e43a80 100644 --- a/game/reconstructed/btplayer.cpp +++ b/game/reconstructed/btplayer.cpp @@ -740,6 +740,14 @@ void enemy_origin.linearPosition.x -= spawnZ.x * 120.0f; // forward = -Z enemy_origin.linearPosition.y -= spawnZ.y * 120.0f; enemy_origin.linearPosition.z -= spawnZ.z * 120.0f; + // FACE THE PLAYER: copying the spawn pose left BOTH mechs facing + // the same way (the player stared at the enemy's back). Flip the + // enemy's yaw 180 deg about Y so the two face each other. Engine + // yaw convention (MATRIX.cpp:196-209): the Z basis = (sin y, 0, + // cos y) -> yaw = atan2(z.x, z.z); enemy yaw = that + pi. + Scalar spawnYaw = (Scalar)atan2((double)spawnZ.x, (double)spawnZ.z); + enemy_origin.angularPosition = + EulerAngles(0.0f, spawnYaw + 3.14159265f, 0.0f); } Mech::MakeMessage