Vector3Ext.IsInsideBox Method (Vector3, BoxCollider, Vector3, Boolean)
Checks if a point is inside of a BoxCollider.
Namespace: UltimateXR.Extensions.Unity.Math
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static bool IsInsideBox(
this Vector3 point,
BoxCollider box,
Vector3 margin = default,
bool marginIsWorld = true
)
Parameters
- point
- Type: Vector3
Point in world coordinates - box
- Type: BoxCollider
Box collider to test against - margin (Optional)
- Type: Vector3
Optional margin to be added to the each of the box sides - marginIsWorld (Optional)
- Type: System.Boolean
Whether the margin is specified in world coordinates or local
Return Value
Type: Boolean
Whether point is inside
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Vector3. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also
Reference
Vector3Ext Class
IsInsideBox Overload
UltimateXR.Extensions.Unity.Math Namespace