struct BBox
in global
An Axis Aligned Bounding Box.
public Vector3 Mins
The minimum corner extents of the AABB. Values on each axis should be mathematically smaller than values on the same axis of . See
public Vector3 Maxs
The maximum corner extents of the AABB. Values on each axis should be mathematically larger than values on the same axis of . See
public BBox( Vector3 mins, Vector3 maxs )
Initialize an AABB with given mins and maxs corners. See .
public BBox( Vector3 center, float size = 0 )
Initializes a zero sized BBox with given center. This is useful if you intend to use AddPoint to expand the box later.
public IEnumerable<Vector3> Corners { get; }
An enumerable that contains all corners of this AABB.
public Vector3 Center { get; }
Calculated center of the AABB.
public Vector3 Size { get; }
Calculated size of the AABB on each axis.
public Vector3 Extents { get; }
The extents of the bbox. This is half the size.
public BBox Translate( ref Vector3 point )
Move this box by this amount and return
public BBox Rotate( ref Rotation rotation )
Rotate this box by this amount and return
public BBox Transform( ref Transform transform )
Transform this box by this amount and return
public Vector3 RandomPointInside { get; }
Returns a random point within this AABB.
public Vector3 RandomPointOnEdge { get; }
Returns a random point within this AABB.
public float Volume { get; }
Returns the physical volume of this AABB.
public bool Contains( ref BBox b )
Returns true if this AABB completely contains given AABB
public bool Contains( ref Vector3 b )
Returns true if this AABB contains given point
public bool Overlaps( ref BBox b )
Returns true if this AABB somewhat overlaps given AABB
public BBox AddPoint( ref Vector3 point )
Returns this bbox but stretched to include given point
public BBox AddBBox( ref BBox point )
Returns this bbox but stretched to include given bbox
public BBox Grow( ref float skin )
Return a slightly bigger box
public Vector3 ClosestPoint( ref Vector3 point )
Returns the closest point on this AABB to another point
public static BBox FromHeightAndRadius( float height, float radius )
Creates an AABB of length and depth, and given
public static BBox FromPositionAndSize( ref Vector3 center, float size = 0 )
Creates an AABB at given position and given which acts as a diameter of a sphere contained within the AABB.
public static BBox FromPositionAndSize( Vector3 center, Vector3 size )
Creates an AABB at given position and given a.k.a. "extents".
public bool Trace( ref Ray ray, float distance, ref float hitDistance )
Trace a ray against this box. If hit then return the distance.
public BBox Snap( float distance )
Snap this AABB to a grid
public static BBox FromPoints( IEnumerable<Vector3> points, float size = 0 )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public float GetVolume( )
😔 No documentation found.
public static bool op_Equality( BBox left, BBox right )
😔 No documentation found.
public static bool op_Inequality( BBox left, BBox right )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public bool Equals( BBox o )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public static BBox op_Multiply( BBox c1, float c2 )
😔 No documentation found.
public static BBox FromBoxes( IEnumerable<BBox> boxes )
😔 No documentation found.
public static BBox op_Addition( BBox c1, Vector3 c2 )
😔 No documentation found.