Unravel Engine C# Reference
Loading...
Searching...
No Matches
Bounds Struct Reference
Inheritance diagram for Bounds:

Public Member Functions

 Bounds (Vector3 min, Vector3 max)
 Creates a box from two corners.
 
 Bounds (float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
 Creates a box by specifying each coordinate.
 
void Reset ()
 Resets to an “unpopulated” state—ready for Grow/Encapsulate.
 
bool IsPopulated ()
 True if Reset() has been called (i.e. not both corners = zero).
 
bool IsDegenerate (float epsilon=float.Epsilon)
 True if the box has zero volume (within epsilon).
 
void AddPoint (Vector3 point)
 Expand to include this point.
 
bool ContainsPoint (Vector3 p)
 True if the point is inside [Min,Max].
 
bool ContainsPoint (Vector3 p, Vector3 tol)
 Contains with per‐axis tolerance.
 
bool ContainsPoint (Vector3 p, float tol)
 Contains with uniform tolerance.
 
Vector3 GetDimensions ()
 The size of the box = Max − Min.
 
Vector3 GetCenter ()
 Center = (Min + Max) / 2.
 
Vector3 GetExtents ()
 Extents = half‐dimensions.
 
void Inflate (float amount)
 Grow/shrink all sides by a uniform amount.
 
void Inflate (Vector3 amount)
 Grow/shrink all sides by per‐axis amounts.
 
Vector3[] GetCorners ()
 The eight corners in the same order as your C++ code.
 
bool Intersect (Bounds b)
 AABB‐AABB overlap test.
 
bool Intersect (Bounds b, out bool contained)
 Overlap + full containment test. Returns true if they overlap; sets contained=true if b is entirely inside this.
 
bool Intersect (Bounds b, out Bounds intersection)
 Overlap + return the intersection box.
 
bool Intersect (Bounds b, Vector3 tol)
 Overlap with a tolerance vector.
 
bool Slab (float o, float d, float mn, float mx, ref float t0, ref float t1)
 
bool Intersect (Vector3 origin, Vector3 dir, out float t, bool restrictRange=true)
 Ray vs AABB (slab method).
Returns true if hit; t = entry time in [0,1] if restrictRange.
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
bool Equals (Bounds other)
 

Static Public Member Functions

static Bounds operator+ (Bounds b, Vector3 shift)
 
static Bounds operator- (Bounds b, Vector3 shift)
 
static Bounds operator* (Bounds b, float s)
 
static bool operator== (Bounds a, Bounds b)
 
static bool operator!= (Bounds a, Bounds b)
 

Public Attributes

Vector3 Min
 The minimum corner of the box.
 
Vector3 Max
 The maximum corner of the box.
 

Static Public Attributes

static readonly Bounds Empty = new Bounds(Vector3.one * float.MaxValue, Vector3.one * float.MinValue)
 

Detailed Description

Definition at line 6 of file Bounds.cs.

Constructor & Destructor Documentation

◆ Bounds() [1/2]

Bounds.Bounds ( Vector3 min,
Vector3 max )

Creates a box from two corners.

Definition at line 16 of file Bounds.cs.

◆ Bounds() [2/2]

Bounds.Bounds ( float xMin,
float yMin,
float zMin,
float xMax,
float yMax,
float zMax )

Creates a box by specifying each coordinate.

Definition at line 23 of file Bounds.cs.

Member Function Documentation

◆ AddPoint()

void Bounds.AddPoint ( Vector3 point)

Expand to include this point.

Definition at line 57 of file Bounds.cs.

◆ ContainsPoint() [1/3]

bool Bounds.ContainsPoint ( Vector3 p)

True if the point is inside [Min,Max].

◆ ContainsPoint() [2/3]

bool Bounds.ContainsPoint ( Vector3 p,
float tol )

Contains with uniform tolerance.

◆ ContainsPoint() [3/3]

bool Bounds.ContainsPoint ( Vector3 p,
Vector3 tol )

Contains with per‐axis tolerance.

◆ Equals() [1/2]

bool Bounds.Equals ( Bounds other)

◆ Equals() [2/2]

override bool Bounds.Equals ( object obj)

◆ GetCenter()

Vector3 Bounds.GetCenter ( )

Center = (Min + Max) / 2.

◆ GetCorners()

Vector3[] Bounds.GetCorners ( )

The eight corners in the same order as your C++ code.

◆ GetDimensions()

Vector3 Bounds.GetDimensions ( )

The size of the box = Max − Min.

◆ GetExtents()

Vector3 Bounds.GetExtents ( )

Extents = half‐dimensions.

◆ GetHashCode()

override int Bounds.GetHashCode ( )

◆ Inflate() [1/2]

void Bounds.Inflate ( float amount)

Grow/shrink all sides by a uniform amount.

Definition at line 93 of file Bounds.cs.

◆ Inflate() [2/2]

void Bounds.Inflate ( Vector3 amount)

Grow/shrink all sides by per‐axis amounts.

Definition at line 100 of file Bounds.cs.

◆ Intersect() [1/5]

bool Bounds.Intersect ( Bounds b)

AABB‐AABB overlap test.

◆ Intersect() [2/5]

bool Bounds.Intersect ( Bounds b,
out bool contained )

Overlap + full containment test. Returns true if they overlap; sets contained=true if b is entirely inside this.

Definition at line 129 of file Bounds.cs.

◆ Intersect() [3/5]

bool Bounds.Intersect ( Bounds b,
out Bounds intersection )

Overlap + return the intersection box.

Definition at line 149 of file Bounds.cs.

◆ Intersect() [4/5]

bool Bounds.Intersect ( Bounds b,
Vector3 tol )

Overlap with a tolerance vector.

Definition at line 166 of file Bounds.cs.

◆ Intersect() [5/5]

bool Bounds.Intersect ( Vector3 origin,
Vector3 dir,
out float t,
bool restrictRange = true )

Ray vs AABB (slab method).
Returns true if hit; t = entry time in [0,1] if restrictRange.

Definition at line 200 of file Bounds.cs.

◆ IsDegenerate()

bool Bounds.IsDegenerate ( float epsilon = float.Epsilon)

True if the box has zero volume (within epsilon).

◆ IsPopulated()

bool Bounds.IsPopulated ( )

True if Reset() has been called (i.e. not both corners = zero).

Definition at line 39 of file Bounds.cs.

◆ operator!=()

static bool Bounds.operator!= ( Bounds a,
Bounds b )
static

◆ operator*()

static Bounds Bounds.operator* ( Bounds b,
float s )
static

◆ operator+()

static Bounds Bounds.operator+ ( Bounds b,
Vector3 shift )
static

◆ operator-()

static Bounds Bounds.operator- ( Bounds b,
Vector3 shift )
static

◆ operator==()

static bool Bounds.operator== ( Bounds a,
Bounds b )
static

◆ Reset()

void Bounds.Reset ( )

Resets to an “unpopulated” state—ready for Grow/Encapsulate.

Definition at line 32 of file Bounds.cs.

◆ Slab()

bool Bounds.Slab ( float o,
float d,
float mn,
float mx,
ref float t0,
ref float t1 )

Definition at line 178 of file Bounds.cs.

Member Data Documentation

◆ Empty

readonly Bounds Bounds.Empty = new Bounds(Vector3.one * float.MaxValue, Vector3.one * float.MinValue)
static

Definition at line 13 of file Bounds.cs.

◆ Max

Vector3 Bounds.Max

The maximum corner of the box.

Definition at line 11 of file Bounds.cs.

◆ Min

Vector3 Bounds.Min

The minimum corner of the box.

Definition at line 9 of file Bounds.cs.


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