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