C# Class Axiom.Math.AxisAlignedBox

A 3D box aligned with the x/y/z axes.
This class represents a simple box which is aligned with the axes. It stores 2 points as the extremeties of the box, one which is the minima of all 3 axes, and the other which is the maxima of all 3 axes. This class is typically used for an axis-aligned bounding box (AABB) for collision and visibility determination.
Inheritance: ICloneable
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Méthodes publiques

Méthode Description
AxisAlignedBox ( ) : System
AxisAlignedBox ( AxisAlignedBox box ) : System
AxisAlignedBox ( Vector3 min, Vector3 max ) : System
Clone ( ) : object
Contains ( Vector3 v ) : bool

Tests whether the given point contained by this box.

Equals ( object obj ) : bool
FromDimensions ( Vector3 center, Vector3 size ) : AxisAlignedBox

Return new bounding box from the supplied dimensions.

GetHashCode ( ) : int
Intersection ( AxisAlignedBox b2 ) : AxisAlignedBox

Calculate the area of intersection of this box and another

Intersects ( AxisAlignedBox box2 ) : bool

Returns whether or not this box intersects another.

Intersects ( Plane plane ) : bool

Intersects ( Sphere sphere ) : bool

Tests whether this box intersects a sphere.

Intersects ( Vector3 vector ) : bool

Tests whether the vector point is within this box.

Merge ( AxisAlignedBox box ) : void

Allows for merging two boxes together (combining).

Merge ( Vector3 point ) : void

Extends the box to encompass the specified point (if needed).

Scale ( Vector3 factor ) : void

Scales the size of the box by the supplied factor.

SetExtents ( Vector3 min, Vector3 max ) : void

Sets both Minimum and Maximum at once, so that UpdateCorners only needs to be called once as well.

ToString ( ) : string
Transform ( Matrix4 matrix ) : void

operator ( ) : bool

Private Methods

Méthode Description
UpdateCorners ( ) : void

Method Details

AxisAlignedBox() public méthode

public AxisAlignedBox ( ) : System
Résultat System

AxisAlignedBox() public méthode

public AxisAlignedBox ( AxisAlignedBox box ) : System
box AxisAlignedBox
Résultat System

AxisAlignedBox() public méthode

public AxisAlignedBox ( Vector3 min, Vector3 max ) : System
min Vector3
max Vector3
Résultat System

Clone() public méthode

public Clone ( ) : object
Résultat object

Contains() public méthode

Tests whether the given point contained by this box.
public Contains ( Vector3 v ) : bool
v Vector3
Résultat bool

Equals() public méthode

public Equals ( object obj ) : bool
obj object
Résultat bool

FromDimensions() public static méthode

Return new bounding box from the supplied dimensions.
public static FromDimensions ( Vector3 center, Vector3 size ) : AxisAlignedBox
center Vector3 Center of the new box
size Vector3 Entire size of the new box
Résultat AxisAlignedBox

GetHashCode() public méthode

public GetHashCode ( ) : int
Résultat int

Intersection() public méthode

Calculate the area of intersection of this box and another
public Intersection ( AxisAlignedBox b2 ) : AxisAlignedBox
b2 AxisAlignedBox
Résultat AxisAlignedBox

Intersects() public méthode

Returns whether or not this box intersects another.
public Intersects ( AxisAlignedBox box2 ) : bool
box2 AxisAlignedBox
Résultat bool

Intersects() public méthode

public Intersects ( Plane plane ) : bool
plane Plane
Résultat bool

Intersects() public méthode

Tests whether this box intersects a sphere.
public Intersects ( Sphere sphere ) : bool
sphere Sphere
Résultat bool

Intersects() public méthode

Tests whether the vector point is within this box.
public Intersects ( Vector3 vector ) : bool
vector Vector3
Résultat bool

Merge() public méthode

Allows for merging two boxes together (combining).
public Merge ( AxisAlignedBox box ) : void
box AxisAlignedBox Source box.
Résultat void

Merge() public méthode

Extends the box to encompass the specified point (if needed).
public Merge ( Vector3 point ) : void
point Vector3
Résultat void

Scale() public méthode

Scales the size of the box by the supplied factor.
public Scale ( Vector3 factor ) : void
factor Vector3 Factor of scaling to apply to the box.
Résultat void

SetExtents() public méthode

Sets both Minimum and Maximum at once, so that UpdateCorners only needs to be called once as well.
public SetExtents ( Vector3 min, Vector3 max ) : void
min Vector3
max Vector3
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

Transform() public méthode

public Transform ( Matrix4 matrix ) : void
matrix Matrix4
Résultat void

operator() public static méthode

public static operator ( ) : bool
Résultat bool