C# Класс 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.
Наследование: ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
UpdateCorners ( ) : void

Описание методов

AxisAlignedBox() публичный Метод

public AxisAlignedBox ( ) : System
Результат System

AxisAlignedBox() публичный Метод

public AxisAlignedBox ( AxisAlignedBox box ) : System
box AxisAlignedBox
Результат System

AxisAlignedBox() публичный Метод

public AxisAlignedBox ( Vector3 min, Vector3 max ) : System
min Vector3
max Vector3
Результат System

Clone() публичный Метод

public Clone ( ) : object
Результат object

Contains() публичный Метод

Tests whether the given point contained by this box.
public Contains ( Vector3 v ) : bool
v Vector3
Результат bool

Equals() публичный Метод

public Equals ( object obj ) : bool
obj object
Результат bool

FromDimensions() публичный статический Метод

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
Результат AxisAlignedBox

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

Intersection() публичный Метод

Calculate the area of intersection of this box and another
public Intersection ( AxisAlignedBox b2 ) : AxisAlignedBox
b2 AxisAlignedBox
Результат AxisAlignedBox

Intersects() публичный Метод

Returns whether or not this box intersects another.
public Intersects ( AxisAlignedBox box2 ) : bool
box2 AxisAlignedBox
Результат bool

Intersects() публичный Метод

public Intersects ( Plane plane ) : bool
plane Plane
Результат bool

Intersects() публичный Метод

Tests whether this box intersects a sphere.
public Intersects ( Sphere sphere ) : bool
sphere Sphere
Результат bool

Intersects() публичный Метод

Tests whether the vector point is within this box.
public Intersects ( Vector3 vector ) : bool
vector Vector3
Результат bool

Merge() публичный Метод

Allows for merging two boxes together (combining).
public Merge ( AxisAlignedBox box ) : void
box AxisAlignedBox Source box.
Результат void

Merge() публичный Метод

Extends the box to encompass the specified point (if needed).
public Merge ( Vector3 point ) : void
point Vector3
Результат void

Scale() публичный Метод

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.
Результат void

SetExtents() публичный Метод

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
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

Transform() публичный Метод

public Transform ( Matrix4 matrix ) : void
matrix Matrix4
Результат void

operator() публичный статический Метод

public static operator ( ) : bool
Результат bool