Loading...
Searching...
No Matches
PixelCrushers.LoveHate.FieldOfView Class Reference

Defines a field of view, which is an area with a horizontal arc and vertical arc. More...

Public Member Functions

 FieldOfView ()
 
 FieldOfView (float horizontalFOV, float verticalFOV, float maxDistance, Color gizmoColor)
 Creates a new field of view.
 
 FieldOfView (FieldOfView fov)
 Copies a field of view.
 
bool Contains (Transform origin, Transform target, Dimension dimension)
 Determines whether a target is within the field of view that extends from the sensor's origin point.
 

Public Attributes

float horizontalFOV = 120f
 The horizontal viewing angle in degrees.
 
float verticalFOV = 120f
 The vertical viewing angle in degrees.
 
float maxDistance = 10f
 The max distance from the sensor that the field of view extends.
 
Color gizmoColor = new Color(1, 1, 1, 0.25f)
 The color to use when drawing this field of view in the Scene view.
 

Detailed Description

Defines a field of view, which is an area with a horizontal arc and vertical arc.

Constructor & Destructor Documentation

◆ FieldOfView() [1/3]

PixelCrushers.LoveHate.FieldOfView.FieldOfView ( )
inline

◆ FieldOfView() [2/3]

PixelCrushers.LoveHate.FieldOfView.FieldOfView ( float  horizontalFOV,
float  verticalFOV,
float  maxDistance,
Color  gizmoColor 
)
inline

Creates a new field of view.

Parameters
horizontalFOVHorizontal viewing angle in degrees.
verticalFOVVertical viewing angle in degrees.
maxDistanceMax distance from the sensor.
gizmoColorColor to use when drawing the Scene view gizmo.

◆ FieldOfView() [3/3]

PixelCrushers.LoveHate.FieldOfView.FieldOfView ( FieldOfView  fov)
inline

Copies a field of view.

Parameters
fovSource field of view.

Member Function Documentation

◆ Contains()

bool PixelCrushers.LoveHate.FieldOfView.Contains ( Transform  origin,
Transform  target,
Dimension  dimension 
)
inline

Determines whether a target is within the field of view that extends from the sensor's origin point.

Parameters
originSensor's origin point.
targetTarget to check.
dimensionSpecifies whether to check in 2D or 3D.
Returns
true if the target is within the field of view; false otherwise.

Member Data Documentation

◆ gizmoColor

Color PixelCrushers.LoveHate.FieldOfView.gizmoColor = new Color(1, 1, 1, 0.25f)

The color to use when drawing this field of view in the Scene view.

◆ horizontalFOV

float PixelCrushers.LoveHate.FieldOfView.horizontalFOV = 120f

The horizontal viewing angle in degrees.

◆ maxDistance

float PixelCrushers.LoveHate.FieldOfView.maxDistance = 10f

The max distance from the sensor that the field of view extends.

◆ verticalFOV

float PixelCrushers.LoveHate.FieldOfView.verticalFOV = 120f

The vertical viewing angle in degrees.


The documentation for this class was generated from the following file: