move FieldOfView into Player

GitOrigin-RevId: 6d6a4094533819b11deebd5319616b5f5ed68948
This commit is contained in:
Colin McMillen 2020-02-15 14:59:59 -05:00
parent 66f895fab8
commit 24078d6c62
2 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -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);