From 24078d6c62ca75cb0150f1b34449e1bda6f5955a Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sat, 15 Feb 2020 14:59:59 -0500 Subject: [PATCH] move FieldOfView into Player GitOrigin-RevId: 6d6a4094533819b11deebd5319616b5f5ed68948 --- Shared/LinesOfSight.cs | 2 +- Shared/Player.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Shared/LinesOfSight.cs b/Shared/LinesOfSight.cs index 40a20a1..5b325d0 100644 --- a/Shared/LinesOfSight.cs +++ b/Shared/LinesOfSight.cs @@ -25,9 +25,9 @@ namespace SemiColinGames { Vector2 eyePos = player.EyePosition; float visionRange = player.VisionRange; Vector2 ray = player.VisionRay; + float fov = player.FieldOfView; float visionRangeSq = visionRange * visionRange; - float fov = FMath.DegToRad(120); float fovStep = fov / (numEdgeVertices - 1); coneVertices[0] = new VertexPositionColor(new Vector3(player.EyePosition, 0), color); diff --git a/Shared/Player.cs b/Shared/Player.cs index 68cfe49..40ef2b0 100644 --- a/Shared/Player.cs +++ b/Shared/Player.cs @@ -159,6 +159,12 @@ namespace SemiColinGames { } } + public float FieldOfView { + get { + return FMath.DegToRad(120); + } + } + public Vector2 VisionRay { get { Vector2 ray = new Vector2(VisionRange * Facing, 0);