TrueSync
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
TrueSync.TSBBox Struct Reference

Bounding Box defined through min and max vectors. More...

Public Types

enum  ContainmentType { ContainmentType.Disjoint, ContainmentType.Contains, ContainmentType.Intersects }
 Containment type used within the TSBBox structure. More...
 

Public Member Functions

 TSBBox (TSVector min, TSVector max)
 Constructor More...
 
void Transform (ref TSMatrix orientation)
 
bool SegmentIntersect (ref TSVector origin, ref TSVector direction)
 
bool RayIntersect (ref TSVector origin, ref TSVector direction)
 
bool SegmentIntersect (TSVector origin, TSVector direction)
 
bool RayIntersect (TSVector origin, TSVector direction)
 
ContainmentType Contains (TSVector point)
 Checks wether a point is within a box or not. More...
 
ContainmentType Contains (ref TSVector point)
 Checks whether a point is inside, outside or intersecting a point. More...
 
void GetCorners (TSVector[] corners)
 Retrieves the 8 corners of the box. More...
 
void AddPoint (TSVector point)
 
void AddPoint (ref TSVector point)
 
ContainmentType Contains (TSBBox box)
 Checks whether another bounding box is inside, outside or intersecting this box. More...
 
ContainmentType Contains (ref TSBBox box)
 Checks whether another bounding box is inside, outside or intersecting this box. More...
 
override string ToString ()
 

Static Public Member Functions

static TSBBox CreateFromPoints (TSVector[] points)
 Expands a bounding box with the volume 0 by all points given. More...
 
static TSBBox CreateFromCenter (TSVector center, TSVector size)
 
static TSBBox CreateMerged (TSBBox original, TSBBox additional)
 Creates a new box containing the two given ones. More...
 
static void CreateMerged (ref TSBBox original, ref TSBBox additional, out TSBBox result)
 Creates a new box containing the two given ones. More...
 

Public Attributes

TSVector min
 The maximum point of the box. More...
 
TSVector max
 The minimum point of the box. More...
 

Static Public Attributes

static readonly TSBBox LargeBox
 Returns the largest box possible. More...
 
static readonly TSBBox SmallBox
 Returns the smalltest box possible. More...
 

Properties

TSVector center [get]
 
TSVector size [get]
 
TSVector extents [get]
 

Detailed Description

Bounding Box defined through min and max vectors.

Definition at line 25 of file TSBBox.cs.

Member Enumeration Documentation

Containment type used within the TSBBox structure.

Enumerator
Disjoint 

The objects don't intersect.

Contains 

One object is within the other.

Intersects 

The two objects intersect.

Definition at line 30 of file TSBBox.cs.

Constructor & Destructor Documentation

TrueSync.TSBBox.TSBBox ( TSVector  min,
TSVector  max 
)

Constructor

Parameters
minThe minimum point of the box.
maxThe maximum point of the box.

Definition at line 79 of file TSBBox.cs.

Member Function Documentation

ContainmentType TrueSync.TSBBox.Contains ( TSVector  point)

Checks wether a point is within a box or not.

Parameters
point
Returns

Definition at line 199 of file TSBBox.cs.

ContainmentType TrueSync.TSBBox.Contains ( ref TSVector  point)

Checks whether a point is inside, outside or intersecting a point.

Parameters
pointA point in space.
Returns
The ContainmentType of the point.

Definition at line 210 of file TSBBox.cs.

ContainmentType TrueSync.TSBBox.Contains ( TSBBox  box)

Checks whether another bounding box is inside, outside or intersecting this box.

Parameters
boxThe other bounding box to check.
Returns
The ContainmentType of the box.

Definition at line 282 of file TSBBox.cs.

ContainmentType TrueSync.TSBBox.Contains ( ref TSBBox  box)

Checks whether another bounding box is inside, outside or intersecting this box.

Parameters
boxThe other bounding box to check.
Returns
The ContainmentType of the box.

Definition at line 293 of file TSBBox.cs.

static TSBBox TrueSync.TSBBox.CreateFromPoints ( TSVector[]  points)
static

Expands a bounding box with the volume 0 by all points given.

Parameters
pointsA array of JVector.
Returns
The resulting bounding box containing all points.

Definition at line 259 of file TSBBox.cs.

static TSBBox TrueSync.TSBBox.CreateMerged ( TSBBox  original,
TSBBox  additional 
)
static

Creates a new box containing the two given ones.

Parameters
originalFirst box.
additionalSecond box.
Returns
A JBBox containing the two given boxes.

Definition at line 319 of file TSBBox.cs.

static void TrueSync.TSBBox.CreateMerged ( ref TSBBox  original,
ref TSBBox  additional,
out TSBBox  result 
)
static

Creates a new box containing the two given ones.

Parameters
originalFirst box.
additionalSecond box.
resultA JBBox containing the two given boxes.

Definition at line 332 of file TSBBox.cs.

void TrueSync.TSBBox.GetCorners ( TSVector[]  corners)

Retrieves the 8 corners of the box.

Returns
An array of 8 JVector entries.

Definition at line 225 of file TSBBox.cs.

Member Data Documentation

readonly TSBBox TrueSync.TSBBox.LargeBox
static

Returns the largest box possible.

Definition at line 59 of file TSBBox.cs.

TSVector TrueSync.TSBBox.max

The minimum point of the box.

Definition at line 54 of file TSBBox.cs.

TSVector TrueSync.TSBBox.min

The maximum point of the box.

Definition at line 49 of file TSBBox.cs.

readonly TSBBox TrueSync.TSBBox.SmallBox
static

Returns the smalltest box possible.

Definition at line 64 of file TSBBox.cs.


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