Skip to content

Commit 4474e0b

Browse files
michal-pekackiFraser Greenroyd
authored andcommitted
fixed angle calculation
1 parent 5e390a5 commit 4474e0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Security_Engine/Query/ViewCone.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static PolyCurve ViewCone(this CameraDevice cameraDevice)
4848
Point targetLocation = cameraDevice.TargetPosition;
4949
double radius = targetLocation.Distance(cameraLocation);
5050
double horizontal = cameraDevice.HorizontalFieldOfView;
51-
double angle = 2 * Math.Atan(horizontal / 2 / radius);
51+
double angle = Math.Atan(horizontal / radius);
5252

5353
Vector direction = BH.Engine.Geometry.Create.Vector(cameraLocation, cameraDevice.TargetPosition);
5454
Vector startPointDir = direction.Rotate(-angle / 2, Vector.ZAxis);

0 commit comments

Comments
 (0)