From d44ac76d4960c6451860f46f4df32a8eb4217259 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Mon, 3 Feb 2020 12:02:52 -0500 Subject: [PATCH] fix cones-of-sight tilting in the wrong up/down direction when facing left GitOrigin-RevId: 6b4925c75f44069af84685bc749a3586ad376e1d --- Shared/Player.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shared/Player.cs b/Shared/Player.cs index e7db54c..a94128a 100644 --- a/Shared/Player.cs +++ b/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);