Skip to content

Commit

Permalink
Fix compatibility with Pehkui player scale (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coffee-Maker authored Aug 16, 2024
1 parent 8142bb8 commit ad53ee3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,18 @@ private void redirectSetVelocity(final MoverType moverType, final Vec3 movement,

// Remove the component of [movementAdjustedForCollisions] that is parallel to [collisionResponseHorizontal]
if (collisionResponseHorizontal.lengthSquared() > 1e-6) {
final Vec3 deltaMovement = getDeltaMovement();

final Vector3dc collisionResponseHorizontalNormal = collisionResponseHorizontal.normalize(new Vector3d());
final double parallelHorizontalVelocityComponent =
collisionResponseHorizontalNormal
.dot(movementAdjustedForCollisions.x, 0.0, movementAdjustedForCollisions.z);
.dot(deltaMovement.x, 0.0, deltaMovement.z);

setDeltaMovement(
movementAdjustedForCollisions.x
deltaMovement.x
- collisionResponseHorizontalNormal.x() * parallelHorizontalVelocityComponent,
movementAdjustedForCollisions.y,
movementAdjustedForCollisions.z
deltaMovement.y,
deltaMovement.z
- collisionResponseHorizontalNormal.z() * parallelHorizontalVelocityComponent
);
}
Expand Down

0 comments on commit ad53ee3

Please sign in to comment.