Bearbeiten

Freigeben über


CameraFOVChecker.IsInFOVCached(Camera, Collider) Method

Definition

Returns true if a collider's bounds is within the camera FOV. Utilizes a cache to test if this collider has been seen before and returns current frame's calculated result. NOTE: This is a 'loose' FOV check -- it can return true in cases when the collider is actually not in the FOV because it does an axis-aligned check when testing for large colliders. So, if the axis aligned bounds are in the bounds of the camera, it will return true.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsInFOVCached(UnityEngine::Camera ^ cam, UnityEngine::Collider ^ myCollider);
public static bool IsInFOVCached (this UnityEngine.Camera cam, UnityEngine.Collider myCollider);
static member IsInFOVCached : UnityEngine.Camera * UnityEngine.Collider -> bool
<Extension()>
Public Function IsInFOVCached (cam As Camera, myCollider As Collider) As Boolean

Parameters

cam
UnityEngine.Camera
myCollider
UnityEngine.Collider

The collider to test

Returns

Remarks

NOTE: This is a 'loose' FOV check -- it can return true in cases when the collider is actually not in the FOV because it does an axis-aligned check when testing for large colliders. So, if the axis aligned bounds are in the bounds of the camera, it will return true.

Applies to