Browse Source

fix cones-of-sight tilting in the wrong up/down direction when facing left

GitOrigin-RevId: 6b4925c75f
master
Colin McMillen 4 years ago
parent
commit
d44ac76d49
  1. 4
      Shared/Player.cs

4
Shared/Player.cs

@ -182,10 +182,10 @@ namespace SemiColinGames {
float visionRangeSq = visionRange * visionRange;
Vector2 ray = new Vector2(visionRange * (int) facing, 0);
if (pose == Pose.Stretching) {
ray = Rotate(ray, FMath.DegToRad(-30));
ray = Rotate(ray, (int) facing * FMath.DegToRad(-30));
}
if (pose == Pose.Crouching) {
ray = Rotate(ray, FMath.DegToRad(30));
ray = Rotate(ray, (int) facing * FMath.DegToRad(30));
}
Vector2 coneBottom = Rotate(ray, fov);
Vector2 coneTop = Rotate(ray, -fov);

Loading…
Cancel
Save