[Scummvm-git-logs] scummvm master -> f94dabb1b467dcf1ccf7d9268b7e4c1f4032add0

aquadran noreply at scummvm.org
Mon Nov 2 20:27:17 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
f94dabb1b4 GRIM: Do not use pitch for the forward vector


Commit: f94dabb1b467dcf1ccf7d9268b7e4c1f4032add0
    https://github.com/scummvm/scummvm/commit/f94dabb1b467dcf1ccf7d9268b7e4c1f4032add0
Author: Joel Teichroeb (joel at teichroeb.net)
Date: 2026-11-02T21:27:11+01:00

Commit Message:
GRIM: Do not use pitch for the forward vector

This fixes the uber spider in sp

To reproduce go to the sp set, take out the scyth and use it on the
heart. The uber spider will come down and fix the web. Its pitch should
not affect its movement.

Other sets where this could potentially be a change

In the high roller elevator, if you put the forklift into the gap on the
way down, it'll get rotated as its pushed back. I couldn't see a
difference.

In the beaver dam, after the beavers are defeated, Glottis drives the
Bone Wagon through and a small amount of pitch is applied. Again I
couldn't see a difference with this change.

In EMI Roll is never set. The two places that were questionable from the
scripts were the glowing fish in the underwater scene and the parrots.
In both cases I couldn't get the game to try moving them while pitch was
set.

Assisted-by: Claude:claude-sonnet-5-5

Changed paths:
    engines/grim/actor.cpp


diff --git a/engines/grim/actor.cpp b/engines/grim/actor.cpp
index a07c208ebd4..3ef565dcc7c 100644
--- a/engines/grim/actor.cpp
+++ b/engines/grim/actor.cpp
@@ -820,15 +820,14 @@ void Actor::walkForward() {
 	_walking = false;
 
 	if (!_followBoxes) {
-		Math::Vector3d forwardVec(-_moveYaw.getSine() * _pitch.getCosine(),
-		                           _moveYaw.getCosine() * _pitch.getCosine(), _pitch.getSine());
+		Math::Vector3d forwardVec(-_moveYaw.getSine(),
+		                           _moveYaw.getCosine(), 0);
 
 		// EMI: Y is up-down, actors use an X-Z plane for movement
 		if (g_grim->getGameType() == GType_MONKEY4) {
-			float temp = forwardVec.z();
 			forwardVec.x() = -forwardVec.x();
 			forwardVec.z() = forwardVec.y();
-			forwardVec.y() = temp;
+			forwardVec.y() = 0;
 		}
 
 		_pos += forwardVec * dist;
@@ -849,15 +848,14 @@ void Actor::walkForward() {
 
 		g_grim->getCurrSet()->findClosestSector(_pos, &currSector, &_pos);
 		if (!currSector) { // Shouldn't happen...
-			Math::Vector3d forwardVec(-_moveYaw.getSine() * _pitch.getCosine(),
-			                           _moveYaw.getCosine() * _pitch.getCosine(), _pitch.getSine());
+			Math::Vector3d forwardVec(-_moveYaw.getSine(),
+			                           _moveYaw.getCosine(), 0);
 
 			// EMI: Y is up-down, actors use an X-Z plane for movement
 			if (g_grim->getGameType() == GType_MONKEY4) {
-				float temp = forwardVec.z();
 				forwardVec.x() = -forwardVec.x();
 				forwardVec.z() = forwardVec.y();
-				forwardVec.y() = temp;
+				forwardVec.y() = 0;
 			}
 
 			if (backwards)
@@ -878,18 +876,18 @@ void Actor::walkForward() {
 				Math::Angle ax = Math::Vector2d(normal.x(), normal.z()).getAngle();
 				Math::Angle ay = Math::Vector2d(normal.y(), normal.z()).getAngle();
 
-				float z1 = -_moveYaw.getCosine() * (ay - _pitch).getCosine();
-				float z2 = _moveYaw.getSine() * (ax - _pitch).getCosine();
-				forwardVec = Math::Vector3d(-_moveYaw.getSine() * ax.getSine() * _pitch.getCosine(),
-				                             _moveYaw.getCosine() * ay.getSine() * _pitch.getCosine(), z1 + z2);
+				float z1 = -_moveYaw.getCosine() * ay.getCosine();
+				float z2 = _moveYaw.getSine() * ax.getCosine();
+				forwardVec = Math::Vector3d(-_moveYaw.getSine() * ax.getSine(),
+				                             _moveYaw.getCosine() * ay.getSine(), z1 + z2);
 			} else {
 				Math::Angle ax = Math::Vector2d(normal.x(), normal.y()).getAngle();
 				Math::Angle az = Math::Vector2d(normal.z(), normal.y()).getAngle();
 
-				float y1 = _moveYaw.getCosine() * (az - _pitch).getCosine();
-				float y2 = _moveYaw.getSine() * (ax - _pitch).getCosine();
-				forwardVec = Math::Vector3d(-_moveYaw.getSine() * ax.getSine() * _pitch.getCosine(), y1 + y2,
-				                            -_moveYaw.getCosine() * az.getSine() * _pitch.getCosine());
+				float y1 = _moveYaw.getCosine() * az.getCosine();
+				float y2 = _moveYaw.getSine() * ax.getCosine();
+				forwardVec = Math::Vector3d(-_moveYaw.getSine() * ax.getSine(), y1 + y2,
+				                            -_moveYaw.getCosine() * az.getSine());
 			}
 
 			if (backwards)




More information about the Scummvm-git-logs mailing list