NSMath::TBox Struct Reference

TBox class. More...

#include <Box.h>

Inheritance diagram for NSMath::TBox:

Inheritance graph
[legend]
Collaboration diagram for NSMath::TBox:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TBox (void)
 Default constructor.
 TBox (const TBox &box)
 Create this box according to another box.
 TBox (const TAABBox &aabb)
 Create this box from given AABB.
 TBox (const TSphere &sphere)
 Create this box from given sphere.
const TVector3GetCenter (void) const
 Returns center of this OBB.
const TVector3GetExtents (void) const
 Returns extents of this OBB.
const TMatrix3GetAxes (void) const
 Returns matrix that contains local axes of this OBB.
float GetMinX (void) const
 Returns minimal X-coordinate contained inside this box.
float GetMinY (void) const
 Returns minimal Y-coordinate contained inside this box.
float GetMinZ (void) const
 Returns minimal Z-coordinate contained inside this box.
float GetMaxX (void) const
 Returns maximal X-coordinate contained inside this box.
float GetMaxY (void) const
 Returns maximal Y-coordinate contained inside this box.
float GetMaxZ (void) const
 Returns maximal Z-coordinate contained inside this box.
void GetMinXYZ (TVector3 &min) const
 Compute minimal X,Y and Z coordinates contained in this box and store it in parameter.
void GetMaxXYZ (TVector3 &max) const
 Compute maximal X,Y and Z coordinates contained in this box and store it in parameter.
void GetMinMaxXYZ (TVector3 &min, TVector3 &max) const
 Compute minimal and maximal X,Y and Z coordinates contained in this box and store it in parameters.
void Set (const TBox &box)
 Set this OBB from another OBB.
void SetFromPoints (const TVector3 *points, const DWORD &count)
 Set this box from array of points.
TPlane GetPlaneLeft (void) const
 Returns left plane (side) of this box.
void GetPlaneLeft (TPlane &res) const
 Returns left plane (side) of this box and store it in parameter.
TPlane GetPlaneRight (void) const
 Returns right plane (side) of this box.
void GetPlaneRight (TPlane &res) const
 Returns right plane (side) of this box and store it in parameter.
TPlane GetPlaneFront (void) const
 Returns front plane (side) of this box.
void GetPlaneFront (TPlane &res) const
 Returns front plane (side) of this box and store it in parameter.
TPlane GetPlaneBack (void) const
 Returns front plane (side) of this box.
void GetPlaneBack (TPlane &res) const
 Returns front plane (side) of this box and store it in parameter.
TPlane GetPlaneBottom (void) const
 Returns bottom plane (side) of this box.
void GetPlaneBottom (TPlane &res) const
 Returns bottom plane (side) of this box and store it in parameter.
TPlane GetPlaneTop (void) const
 Returns top plane (side) of this box.
void GetPlaneTop (TPlane &res) const
 Returns top plane (side) of this box and store it in parameter.
void GetPointsAll (TVector3 points[8]) const
 Compute all corner points which define this box.
void GetPointsAllRelativeTo (TVector3 points[8], const TVector3 &origin) const
 Compute all corner points which define this box.
void GetPointsAllLocalSpace (TVector3 points[8]) const
 Compute all corner points which define this box.
void GetPointsAllLocalSpaceRelativeTo (TVector3 points[8], const TVector3 &origin) const
 Compute all corner points which define this box.
TAABBox ToAABBox (void) const
 Convert this box to AABB.
TSphere ToSphere (void) const
 Convert this box to sphere.
void Translate (const TVector3 &vec)
 Translate this box about specified vector.
void Translate (const float &x, const float &y, const float &z)
 Translate this box about specified vector [x,y,z].
void RotateAroundOrigin (const TMatrix3 &rotate)
 Rotate this box around origin with specified rotation matrix.
void RotateAroundOrigin (const TQuaternion &rotate)
 Rotate this box around origin with specified quaternion.
void RotateAroundPoint (const TMatrix3 &rotate, const TVector3 &origin)
 Rotate this box around specified point ORIGIN with specified rotation matrix.
void RotateAroundPoint (const TQuaternion &rotate, const TVector3 &origin)
 Rotate this box around specified point ORIGIN with specified quaternion.
void RotateAroundX (const float &angle)
 Rotate this box around X-axis about specified angle in radians.
void RotateAroundY (const float &angle)
 Rotate this box around Y-axis about specified angle in radians.
void RotateAroundZ (const float &angle)
 Rotate this box around Z-axis about specified angle in radians.
void RotateAroundXSinCos (const float &tsin, const float &tcos)
 Rotate this box around X-axis about specified angle that sinus and cosinus are contained in parameters.
void RotateAroundYSinCos (const float &tsin, const float &tcos)
 Rotate this box around Y-axis about specified angle that sinus and cosinus are contained in parameters.
void RotateAroundZSinCos (const float &tsin, const float &tcos)
 Rotate this box around Z-axis about specified angle that sinus and cosinus are contained in parameters.
void MoveTo (const TVector3 &vec)
 Move center of this box to specified position.
void MoveTo (const float &x, const float &y, const float &z)
 Move center of this box to specified position [x,y,z].
void ScaleFromCenter (const float &scale)
 Scale this box about specified value from center.
float DistanceSurface (const TVector3 &vec) const
 Compute smallest distance between given point and surface of this box.
float DistanceSurfaceSquare (const TVector3 &vec) const
 Compute square of smallest distance between given point and surface of this box.
float Width (void) const
 Returns width of this box.
float Length (void) const
 Returns length of this box.
float Height (void) const
 Returns height of this box.
float Radius (void) const
 Compute radius of circumsphere of this box.
float RadiusSquare (void) const
 Compute square of radius of circumsphere of this box.
float RadiusInner (void) const
 Compute radius of inner sphere of this box.
float RadiusInnerSquare (void) const
 Compute square of radius of inner sphere of this box.
float Surface (void) const
 Compute surface of this box.
float Volume (void) const
 Compute volume of this box.
BOOL AddPoint (const TVector3 &vec)
 "Add" specified points to this box.
TVector3 ToBoxSpaceGet (const TVector3 &vec) const
 Convert given point from world space to box space.
TVector3 ToBoxSpaceGet (const float &x, const float &y, const float &z) const
 Convert given point [x,y,z] from world space to box space.
void ToBoxSpace (TVector3 &vec) const
 Convert given point from world space to box space and result store in the same vector.
void ToBoxSpace (float &x, float &y, float &z) const
 Convert given point [x,y,z] from world space to box space and result store in coordinates of input point.
TVector3 ToBoxSpaceAsVectorGet (const TVector3 &vec) const
 Convert given vector from world space to box space and return new vector as result.
TVector3 ToBoxSpaceAsVectorGet (const float &x, const float &y, const float &z) const
 Convert given vector [x,y,z] from world space to box space and return new vector as result.
void ToBoxSpaceAsVector (TVector3 &vec) const
 Convert given vector from world space to box space and return store in this vector.
void ToBoxSpaceAsVector (float &x, float &y, float &z) const
 Convert given vector [x,y,z] from world space to box space and return store in input parameters.
TVector3 FromBoxSpaceGet (const TVector3 &vec) const
 Transform given point from box space to world space.
TVector3 FromBoxSpaceGet (const float &x, const float &y, const float &z) const
 Transform given point [x,y,z] from box space to world space.
void FromBoxSpace (TVector3 &vec) const
 Transform given point from box space to world space.
void FromBoxSpace (float &x, float &y, float &z) const
 Transform given point [x,y,z] from box space to world space and result store in input parameters.
TVector3 FromBoxSpaceAsVectorGet (const TVector3 &vec) const
 Convert given vector from box space to world space and return result as new vector.
TVector3 FromBoxSpaceAsVectorGet (const float &x, const float &y, const float &z) const
 Convert given vector [x,y,z] from box space to world space and return result as new vector.
void FromBoxSpaceAsVector (TVector3 &vec) const
 Convert given vector from box space to world space and result store in parameter.
void FromBoxSpaceAsVector (float &x, float &y, float &z) const
 Convert given vector [x,y,z] from box space to world space and result stores in parameters.
float ProjectExtentsToAxis (const TVector3 &axisDir) const
 This method projects extents to specified axis represented by given normalized directional vector.
float ProjectExtentsToX (void) const
 Project extents to X-axis.
float ProjectExtentsToY (void) const
 Project extents to Y-axis.
float ProjectExtentsToZ (void) const
 Project extents to Z-axis.
void ProjectToAxis (const TVector3 &axisDir, float &timeMin, float &timeMax) const
 This method projects box to specified axis determined only directional vector (thus axis goes through origin of space.
void ProjectToLine (const TLine &line, float &timeMin, float &timeMax) const
 This method projects box to specified line.
void ProjectToLineSegment (const TLineSegment &seg, float &timeMin, float &timeMax) const
 This method projects box to specified line segment.
void ProjectToLineSegmentNormalized (const TLineSegment &seg, float &timeMin, float &timeMax) const
 This method projects box to specified line segment in NORMALIZED coordinated!!!
void ProjectToRay (const TRay &ray, float &timeMin, float &timeMax) const
 This method projects box to specified ray.
BOOL Compare (const TBox &box) const
 Compare this box with another box with default tolerancy for object components.
BOOL Compare (const TBox &box, const float &delta) const
 Compare this box with another box with given tolerancy for object components.
BOOL ComparePrecise (const TBox &box) const
 Compare this box with another box very precisly (bit to bit).
BOOL IsInside (const TVector3 &vec) const
 This method determines whether given point is inside of this box.
BOOL IsInside (const TBox &box) const
 This method determines whether given OBB is entire inside of this box.
BOOL IsInside (const TAABBox &aabb) const
 This method determines whether specified AABB is entire contained inside of this box.
BOOL IsInside (const TSphere &sphere) const
 This method determines whether specified sphere is entire contained inside of this box.
BOOL IsIntersect (const TLineSegment &seg) const
 This method determines whether given line segment intersects this box.
BOOL IsIntersect (const TVector3 &start, const TVector3 &end) const
 This method determines whether line segment specified by two points intersects this box.
BOOL IsIntersect (const TRay &ray) const
 This method determines if specified ray intersects this box.
BOOL IsIntersect (const TLine &line) const
 This method determines if specified line intersects this box.
BOOL IsIntersect (const TPlane &plane) const
 This method determines whether given plane intersects this box.
BOOL IsIntersect (const TSphere &sphere) const
 This method determines whether given sphere has intersection with this box.
BOOL IsIntersect (const TAABBox &aabb) const
 This method determines whether given AABB has intersection with this box.
BOOL IsIntersect (const TBox &box) const
 This method determines whether given box intersects this box.
TBoxoperator= (const TBox &box)
 Assignment operator.
BOOL operator== (const TBox &box) const
 Compare two boxes with default tolerancy.
BOOL operator!= (const TBox &box) const
 Compare two boxes with default tolerancy.
TBoxoperator+= (const TVector3 &vec)
 Move this box about specified vector.
TBoxoperator-= (const TVector3 &vec)
 Move this box about specified vector in inverse direction.

Detailed Description

TBox class.

This class represents oriented bounding box (OBB) in 3D.

It is represented via position of center, extents (half of width, length and height) and three local axes stored inside 3x3 matrix.

Matrix with local axes is stored in COLUMN-MAJOR ORDER !!!

Definition at line 59 of file Box.h.


Constructor & Destructor Documentation

TBox::TBox void   )  [inline]
 

Default constructor.

Create box with center = [0,0,0], extents = [0.5,0.5,0.5] and axes identical with principal axes X,Y and Z.

Definition at line 256 of file Box.h.

TBox::TBox const TBox box  )  [inline]
 

Create this box according to another box.

Parameters:
box [in] original box

Definition at line 267 of file Box.h.

References Set().

Here is the call graph for this function:

TBox::TBox const TAABBox aabb  )  [explicit]
 

Create this box from given AABB.

Note:
Created box has local axis aligned with principal X,Y and Z axes. Center is identical with center of AABB and extents are set to half of width, length and height of given AABB.
Parameters:
aabb [in] original aligned box

Definition at line 25 of file Box.cpp.

TBox::TBox const TSphere sphere  )  [explicit]
 

Create this box from given sphere.

Note:
Created box has local axis aligned with principal X,Y and Z axes. Center is identical with center of sphere and extents are set to radius.
Parameters:
sphere [in] original sphere

Definition at line 39 of file Box.cpp.


Member Function Documentation

BOOL TBox::AddPoint const TVector3 vec  )  [inline]
 

"Add" specified points to this box.

If added point is outside box then box is expanded and TRUE is returned.

Note:
This method may move center and resize extents.
Parameters:
vec [in] added point

Definition at line 1059 of file Box.h.

References NSMath::TVector3::Add(), NSMath::NSStdMath::exp(), NSMath::NSStdMath::fabs(), FALSE, FromBoxSpaceGet(), ToBoxSpaceGet(), TRUE, NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

BOOL TBox::Compare const TBox box,
const float &  delta
const [inline]
 

Compare this box with another box with given tolerancy for object components.

Parameters:
box [in] box to compare
delta [in] maximall allowed tolerancy - should be >= 0 !!!

Definition at line 1560 of file Box.h.

References NSMath::TMatrix3::Compare(), NSMath::TVector3::Compare(), DBGASSERT_MATHLOW, m_axes, m_center, and m_extents.

Here is the call graph for this function:

BOOL TBox::Compare const TBox box  )  const [inline]
 

Compare this box with another box with default tolerancy for object components.

Parameters:
box [in] box to compare

Definition at line 1547 of file Box.h.

References NSMath::TMatrix3::Compare(), NSMath::TVector3::Compare(), m_axes, m_center, and m_extents.

Referenced by operator!=(), and operator==().

Here is the call graph for this function:

BOOL TBox::ComparePrecise const TBox box  )  const [inline]
 

Compare this box with another box very precisly (bit to bit).

Parameters:
box [in] box to compare

Definition at line 1574 of file Box.h.

References NSMath::TMatrix3::ComparePrecise(), NSMath::TVector3::ComparePrecise(), m_axes, m_center, and m_extents.

Here is the call graph for this function:

float TBox::DistanceSurface const TVector3 vec  )  const [inline]
 

Compute smallest distance between given point and surface of this box.

Warning:
If point is inside of box then distance is always 0 !!!
Parameters:
vec [in] point to test

Definition at line 916 of file Box.h.

References NSMath::NSStdMath::sqrt().

Here is the call graph for this function:

float TBox::DistanceSurfaceSquare const TVector3 vec  )  const [inline]
 

Compute square of smallest distance between given point and surface of this box.

Note:
This method is faster than TBox::DistanceSurface because no square root is used.
Warning:
If point is inside of box then distance is always 0 !!!
Parameters:
vec [in] point to test

Definition at line 929 of file Box.h.

References NSMath::TVector3::AbsoluteGet(), ToBoxSpaceGet(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by IsIntersect().

Here is the call graph for this function:

void TBox::FromBoxSpace float &  x,
float &  y,
float &  z
const [inline]
 

Transform given point [x,y,z] from box space to world space and result store in input parameters.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
x [in out] point's x-coordinate in box space and output x-coordinate too
y [in out] point's y-coordinate in box space and output y-coordinate too
z [in out] point's z-coordinate in box space and output z-coordinate too

Definition at line 1296 of file Box.h.

References NSMath::TMatrix3::Transform(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

void TBox::FromBoxSpace TVector3 vec  )  const [inline]
 

Transform given point from box space to world space.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
vec [in out] point to convert and result too

Definition at line 1279 of file Box.h.

References NSMath::TMatrix3::Transform().

Here is the call graph for this function:

void TBox::FromBoxSpaceAsVector float &  x,
float &  y,
float &  z
const [inline]
 

Convert given vector [x,y,z] from box space to world space and result stores in parameters.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
x [in out] x-coordinate of vector to transform and also output
y [in out] y-coordinate of vector to transform and also output
z [in out] z-coordinate of vector to transform and also output

Definition at line 1352 of file Box.h.

References NSMath::TMatrix3::Transform().

Here is the call graph for this function:

void TBox::FromBoxSpaceAsVector TVector3 vec  )  const [inline]
 

Convert given vector from box space to world space and result store in parameter.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
vec [in out] vector to transform and also result

Definition at line 1338 of file Box.h.

References NSMath::TMatrix3::Transform().

Here is the call graph for this function:

TVector3 TBox::FromBoxSpaceAsVectorGet const float &  x,
const float &  y,
const float &  z
const [inline]
 

Convert given vector [x,y,z] from box space to world space and return result as new vector.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
x [in] x-coordinate of vector to transform
y [in] y-coordinate of vector to transform
z [in] z-coordinate of vector to transform

Definition at line 1326 of file Box.h.

References NSMath::TMatrix3::TransformTo().

Here is the call graph for this function:

TVector3 TBox::FromBoxSpaceAsVectorGet const TVector3 vec  )  const [inline]
 

Convert given vector from box space to world space and return result as new vector.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
vec [in] vector to transform

Definition at line 1312 of file Box.h.

References NSMath::TMatrix3::TransformTo().

Here is the call graph for this function:

TVector3 TBox::FromBoxSpaceGet const float &  x,
const float &  y,
const float &  z
const [inline]
 

Transform given point [x,y,z] from box space to world space.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
x [in] point's x-coordinate in box space
y [in] point's y-coordinate in box space
z [in] point's z-coordinate in box space

Definition at line 1267 of file Box.h.

References NSMath::TMatrix3::TransformTo().

Here is the call graph for this function:

TVector3 TBox::FromBoxSpaceGet const TVector3 vec  )  const [inline]
 

Transform given point from box space to world space.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
vec [in] point to convert

Definition at line 1253 of file Box.h.

References NSMath::TMatrix3::TransformTo().

Referenced by AddPoint(), GetPlaneBack(), GetPlaneBottom(), GetPlaneFront(), GetPlaneLeft(), GetPlaneRight(), GetPlaneTop(), and GetPointsAll().

Here is the call graph for this function:

const TMatrix3 & TBox::GetAxes void   )  const [inline]
 

Returns matrix that contains local axes of this OBB.

Warning:
This matrix stores axes in COLUMN-MAJOR order!!! You get row-major order matrix simple as transpose of this matrix.

Definition at line 296 of file Box.h.

const TVector3 & TBox::GetCenter void   )  const [inline]
 

Returns center of this OBB.

Definition at line 276 of file Box.h.

Referenced by IsIntersect(), NSMath::TPlane::IsNegative(), and NSMath::TPlane::IsPositive().

const TVector3 & TBox::GetExtents void   )  const [inline]
 

Returns extents of this OBB.

Note:
Returned vector contains half of width(X), length(Y) and height(Z). All values are measured in local axes.

Definition at line 286 of file Box.h.

float TBox::GetMaxX void   )  const [inline]
 

Returns maximal X-coordinate contained inside this box.

Warning:
Value must be always computed!!!

Definition at line 332 of file Box.h.

References ProjectExtentsToX(), and NSMath::TVector3::x.

Here is the call graph for this function:

void TBox::GetMaxXYZ TVector3 max  )  const [inline]
 

Compute maximal X,Y and Z coordinates contained in this box and store it in parameter.

Parameters:
max [out] vector to store maximal X,Y and Z coordinates

Definition at line 372 of file Box.h.

References ProjectExtentsToX(), ProjectExtentsToY(), ProjectExtentsToZ(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

float TBox::GetMaxY void   )  const [inline]
 

Returns maximal Y-coordinate contained inside this box.

Warning:
Value must be always computed!!!

Definition at line 341 of file Box.h.

References ProjectExtentsToY(), and NSMath::TVector3::y.

Here is the call graph for this function:

float TBox::GetMaxZ void   )  const [inline]
 

Returns maximal Z-coordinate contained inside this box.

Warning:
Value must be always computed!!!

Definition at line 350 of file Box.h.

References ProjectExtentsToZ(), and NSMath::TVector3::z.

Here is the call graph for this function:

void TBox::GetMinMaxXYZ TVector3 min,
TVector3 max
const [inline]
 

Compute minimal and maximal X,Y and Z coordinates contained in this box and store it in parameters.

Parameters:
min [out] vector to store minimal X,Y and Z coordinates
max [out] vector to store maximal X,Y and Z coordinates

Definition at line 385 of file Box.h.

References ProjectExtentsToX(), ProjectExtentsToY(), ProjectExtentsToZ(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by NSMath::TAABBox::IsInside(), and NSMath::TAABBox::TAABBox().

Here is the call graph for this function:

float TBox::GetMinX void   )  const [inline]
 

Returns minimal X-coordinate contained inside this box.

Warning:
Value must be always computed!!!

Definition at line 305 of file Box.h.

References ProjectExtentsToX(), and NSMath::TVector3::x.

Here is the call graph for this function:

void TBox::GetMinXYZ TVector3 min  )  const [inline]
 

Compute minimal X,Y and Z coordinates contained in this box and store it in parameter.

Parameters:
min [out] vector to store minimal X,Y and Z coordinates

Definition at line 360 of file Box.h.

References ProjectExtentsToX(), ProjectExtentsToY(), ProjectExtentsToZ(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

float TBox::GetMinY void   )  const [inline]
 

Returns minimal Y-coordinate contained inside this box.

Warning:
Value must be always computed!!!

Definition at line 314 of file Box.h.

References ProjectExtentsToY(), and NSMath::TVector3::y.

Here is the call graph for this function:

float TBox::GetMinZ void   )  const [inline]
 

Returns minimal Z-coordinate contained inside this box.

Warning:
Value must be always computed!!!

Definition at line 323 of file Box.h.

References ProjectExtentsToZ(), and NSMath::TVector3::z.

Here is the call graph for this function:

void TBox::GetPlaneBack TPlane res  )  const [inline]
 

Returns front plane (side) of this box and store it in parameter.

Note:
Its normal vector points out from box.
Parameters:
res [out] plane to store result

Definition at line 514 of file Box.h.

References FromBoxSpaceGet(), NSMath::TMatrix3::GetRow(), and NSMath::TPlane::Set().

Here is the call graph for this function:

TPlane TBox::GetPlaneBack void   )  const [inline]
 

Returns front plane (side) of this box.

Note:
Its normal vector points out from box.

Definition at line 503 of file Box.h.

References FromBoxSpaceGet(), and NSMath::TMatrix3::GetRow().

Here is the call graph for this function:

void TBox::GetPlaneBottom TPlane res  )  const [inline]
 

Returns bottom plane (side) of this box and store it in parameter.

Note:
Its normal vector points out from box.
Parameters:
res [out] plane to store result

Definition at line 534 of file Box.h.

References FromBoxSpaceGet(), NSMath::TMatrix3::GetRow(), and NSMath::TPlane::Set().

Here is the call graph for this function:

TPlane TBox::GetPlaneBottom void   )  const [inline]
 

Returns bottom plane (side) of this box.

Note:
Its normal vector points out from box.

Definition at line 523 of file Box.h.

References FromBoxSpaceGet(), and NSMath::TMatrix3::GetRow().

Here is the call graph for this function:

void TBox::GetPlaneFront TPlane res  )  const [inline]
 

Returns front plane (side) of this box and store it in parameter.

Note:
Its normal vector points out from box.
Parameters:
res [out] plane to store result

Definition at line 494 of file Box.h.

References FromBoxSpaceGet(), NSMath::TMatrix3::GetRow(), and NSMath::TPlane::Set().

Here is the call graph for this function:

TPlane TBox::GetPlaneFront void   )  const [inline]
 

Returns front plane (side) of this box.

Note:
Its normal vector points out from box.

Definition at line 483 of file Box.h.

References FromBoxSpaceGet(), and NSMath::TMatrix3::GetRow().

Here is the call graph for this function:

void TBox::GetPlaneLeft TPlane res  )  const [inline]
 

Returns left plane (side) of this box and store it in parameter.

Note:
Its normal vector points out from box.
Parameters:
res [out] plane to store result

Definition at line 454 of file Box.h.

References FromBoxSpaceGet(), NSMath::TMatrix3::GetRow(), and NSMath::TPlane::Set().

Here is the call graph for this function:

TPlane TBox::GetPlaneLeft void   )  const [inline]
 

Returns left plane (side) of this box.

Note:
Its normal vector points out from box.

Definition at line 443 of file Box.h.

References FromBoxSpaceGet(), and NSMath::TMatrix3::GetRow().

Here is the call graph for this function:

void TBox::GetPlaneRight TPlane res  )  const [inline]
 

Returns right plane (side) of this box and store it in parameter.

Note:
Its normal vector points out from box.
Parameters:
res [out] plane to store result

Definition at line 474 of file Box.h.

References FromBoxSpaceGet(), NSMath::TMatrix3::GetRow(), and NSMath::TPlane::Set().

Here is the call graph for this function:

TPlane TBox::GetPlaneRight void   )  const [inline]
 

Returns right plane (side) of this box.

Note:
Its normal vector points out from box.

Definition at line 463 of file Box.h.

References FromBoxSpaceGet(), and NSMath::TMatrix3::GetRow().

Here is the call graph for this function:

void TBox::GetPlaneTop TPlane res  )  const [inline]
 

Returns top plane (side) of this box and store it in parameter.

Note:
Its normal vector points out from box.
Parameters:
res [out] plane to store result

Definition at line 554 of file Box.h.

References FromBoxSpaceGet(), NSMath::TMatrix3::GetRow(), and NSMath::TPlane::Set().

Here is the call graph for this function:

TPlane TBox::GetPlaneTop void   )  const [inline]
 

Returns top plane (side) of this box.

Note:
Its normal vector points out from box.

Definition at line 543 of file Box.h.

References FromBoxSpaceGet(), and NSMath::TMatrix3::GetRow().

Here is the call graph for this function:

void TBox::GetPointsAll TVector3  points[8]  )  const [inline]
 

Compute all corner points which define this box.

Points are stored in array in this order:

FLB,FLT,FRT,FRB,BLB,BLT,BRT,BRB

It is encoded in format <FRONT|BACK><LEFT|RIGHT><TOP|BOTTOM>

Parameters:
points [out] array to store points

Definition at line 569 of file Box.h.

References FromBoxSpaceGet(), NSMath::TVector3::Set(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by GetPointsAllRelativeTo().

Here is the call graph for this function:

void TBox::GetPointsAllLocalSpace TVector3  points[8]  )  const [inline]
 

Compute all corner points which define this box.

Points are in box space.

Points are stored in array in this order:

FLB,FLT,FRT,FRB,BLB,BLT,BRT,BRB

It is encoded in format <FRONT|BACK><LEFT|RIGHT><TOP|BOTTOM>

Parameters:
points [out] array to store points

Definition at line 631 of file Box.h.

References NSMath::TVector3::Set(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by GetPointsAllLocalSpaceRelativeTo().

Here is the call graph for this function:

void TBox::GetPointsAllLocalSpaceRelativeTo TVector3  points[8],
const TVector3 origin
const [inline]
 

Compute all corner points which define this box.

Points are in box space relative to given point ORIGIN that is also in box space.

Points are stored in array in this order:

FLB,FLT,FRT,FRB,BLB,BLT,BRT,BRB

It is encoded in format <FRONT|BACK><LEFT|RIGHT><TOP|BOTTOM>

Parameters:
points [out] array to store points
origin [in] new origin of box space - thus points is in box space !!!

Definition at line 664 of file Box.h.

References GetPointsAllLocalSpace().

Referenced by NSMath::TSphere::IsInside().

Here is the call graph for this function:

void TBox::GetPointsAllRelativeTo TVector3  points[8],
const TVector3 origin
const [inline]
 

Compute all corner points which define this box.

Points are in coordinate system related to given point ORIGIN.

Note:
Axis of this coordinate system are always identical with principal X,Y and Z axes.
Points are stored in array in this order:

FLB,FLT,FRT,FRB,BLB,BLT,BRT,BRB

It is encoded in format <FRONT|BACK><LEFT|RIGHT><TOP|BOTTOM>

Parameters:
points [out] array to store points
origin [in] origin in world coordinates

Definition at line 606 of file Box.h.

References GetPointsAll().

Here is the call graph for this function:

float TBox::Height void   )  const [inline]
 

Returns height of this box.

Note:
It is double of extents along local Z-axis.

Definition at line 980 of file Box.h.

References NSMath::TVector3::z.

BOOL TBox::IsInside const TSphere sphere  )  const
 

This method determines whether specified sphere is entire contained inside of this box.

Parameters:
sphere [in] sphere to test

Definition at line 94 of file Box.cpp.

References NSMath::TVector3::Dot(), NSMath::NSStdMath::fabs(), FALSE, NSMath::TSphere::GetCenter(), NSMath::TVector3::GetItem(), NSMath::TSphere::GetRadius(), NSMath::TMatrix3::GetRow(), and ToBoxSpaceGet().

Here is the call graph for this function:

BOOL TBox::IsInside const TAABBox aabb  )  const
 

This method determines whether specified AABB is entire contained inside of this box.

Parameters:
aabb [in] aligned box to test

Definition at line 65 of file Box.cpp.

References NSMath::TAABBox::Center(), NSMath::TVector3::Dot(), NSMath::NSStdMath::fabs(), FALSE, NSMath::TVector3::GetItem(), NSMath::TMatrix3::GetRow(), NSMath::TAABBox::ProjectExtentsToAxis(), and ToBoxSpaceGet().

Here is the call graph for this function:

BOOL TBox::IsInside const TBox box  )  const [inline]
 

This method determines whether given OBB is entire inside of this box.

Parameters:
box [in] box to test

Definition at line 1601 of file Box.h.

References NSMath::TVector3::Dot(), NSMath::NSStdMath::fabs(), FALSE, NSMath::TVector3::GetItem(), NSMath::TMatrix3::GetRow(), m_center, ProjectExtentsToAxis(), and ToBoxSpaceGet().

Here is the call graph for this function:

BOOL TBox::IsInside const TVector3 vec  )  const [inline]
 

This method determines whether given point is inside of this box.

Parameters:
vec [in] point to test

Definition at line 1588 of file Box.h.

References ToBoxSpaceGet().

Here is the call graph for this function:

BOOL TBox::IsIntersect const TBox box  )  const
 

This method determines whether given box intersects this box.

Parameters:
box [in] box to test

Definition at line 527 of file Box.cpp.

References NSMath::TVector3::AbsoluteGet(), NSMath::TVector3::Cross(), NSMath::NSStdMath::fabs(), FALSE, GetCenter(), NSMath::TMatrix3::GetRow(), m_axes, m_extents, ProjectExtentsToAxis(), ToBoxSpaceAsVectorGet(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

BOOL TBox::IsIntersect const TAABBox aabb  )  const
 

This method determines whether given AABB has intersection with this box.

Parameters:
aabb [in] aligned box to test

Definition at line 367 of file Box.cpp.

References NSMath::TAABBox::Center(), NSMath::TVector3::Cross(), NSMath::TVector3::Dot(), NSMath::NSStdMath::fabs(), FALSE, NSMath::TMatrix3::GetRow(), NSMath::TAABBox::Height(), NSMath::TAABBox::Length(), ProjectExtentsToAxis(), NSMath::TAABBox::ProjectExtentsToAxis(), ProjectExtentsToX(), ProjectExtentsToY(), ProjectExtentsToZ(), ToBoxSpaceGet(), NSMath::TAABBox::Width(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

BOOL TBox::IsIntersect const TSphere sphere  )  const
 

This method determines whether given sphere has intersection with this box.

Parameters:
sphere [in] sphere to test

Definition at line 355 of file Box.cpp.

References DistanceSurfaceSquare(), NSMath::TSphere::GetCenter(), and NSMath::TSphere::GetRadiusSquare().

Here is the call graph for this function:

BOOL TBox::IsIntersect const TPlane plane  )  const [inline]
 

This method determines whether given plane intersects this box.

Parameters:
plane [in] plane to test

Definition at line 1629 of file Box.h.

References NSMath::TPlane::AbsDistance(), NSMath::TPlane::GetNormal(), and ProjectExtentsToAxis().

Here is the call graph for this function:

BOOL TBox::IsIntersect const TLine line  )  const
 

This method determines if specified line intersects this box.

Parameters:
line [in] line to test

Definition at line 300 of file Box.cpp.

References NSMath::TVector3::Cross(), NSMath::NSStdMath::fabs(), FALSE, NSMath::TLine::GetPoint(), NSMath::TLine::GetVector(), ToBoxSpaceAsVectorGet(), ToBoxSpaceGet(), TRUE, NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

BOOL TBox::IsIntersect const TRay ray  )  const
 

This method determines if specified ray intersects this box.

Parameters:
ray [in] ray to test

Definition at line 213 of file Box.cpp.

References NSMath::NSStdMath::fabs(), FALSE, NSMath::TRay::GetStart(), NSMath::TRay::GetVector(), ToBoxSpaceAsVectorGet(), ToBoxSpaceGet(), TRUE, NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

BOOL TBox::IsIntersect const TVector3 start,
const TVector3 end
const
 

This method determines whether line segment specified by two points intersects this box.

Parameters:
start [in] starting point of line segment
end [in] end point of line segment

Definition at line 132 of file Box.cpp.

References NSMath::TVector3::Cross(), NSMath::NSStdMath::fabs(), FALSE, ToBoxSpaceGet(), TRUE, NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

BOOL TBox::IsIntersect const TLineSegment seg  )  const
 

This method determines whether given line segment intersects this box.

Parameters:
seg [in] line segment to test

Definition at line 121 of file Box.cpp.

References NSMath::TLineSegment::GetEnd(), and NSMath::TLineSegment::GetStart().

Referenced by NSMath::TSphere::IsIntersect(), and NSMath::TAABBox::IsIntersect().

Here is the call graph for this function:

float TBox::Length void   )  const [inline]
 

Returns length of this box.

Note:
It is double of extents along local Y-axis.

Definition at line 971 of file Box.h.

References NSMath::TVector3::y.

void TBox::MoveTo const float &  x,
const float &  y,
const float &  z
[inline]
 

Move center of this box to specified position [x,y,z].

Parameters:
x [in] new x-position of center
y [in] new y-position of center
z [in] new z-position of center

Definition at line 892 of file Box.h.

References NSMath::TVector3::Set().

Here is the call graph for this function:

void TBox::MoveTo const TVector3 vec  )  [inline]
 

Move center of this box to specified position.

Parameters:
vec [in] new position of center

Definition at line 881 of file Box.h.

BOOL TBox::operator!= const TBox box  )  const [inline]
 

Compare two boxes with default tolerancy.

Parameters:
box [in] second box to compare

Definition at line 1667 of file Box.h.

References Compare().

Here is the call graph for this function:

TBox & TBox::operator+= const TVector3 vec  )  [inline]
 

Move this box about specified vector.

Parameters:
vec [in] offset

Definition at line 1676 of file Box.h.

TBox & TBox::operator-= const TVector3 vec  )  [inline]
 

Move this box about specified vector in inverse direction.

Parameters:
vec [in] offset

Definition at line 1687 of file Box.h.

TBox & TBox::operator= const TBox box  )  [inline]
 

Assignment operator.

Parameters:
box [in] original box

Definition at line 1647 of file Box.h.

References Set().

Here is the call graph for this function:

BOOL TBox::operator== const TBox box  )  const [inline]
 

Compare two boxes with default tolerancy.

Parameters:
box [in] second box to compare

Definition at line 1658 of file Box.h.

References Compare().

Here is the call graph for this function:

float TBox::ProjectExtentsToAxis const TVector3 axisDir  )  const [inline]
 

This method projects extents to specified axis represented by given normalized directional vector.

Note:
Always returns value >= 0.
Parameters:
axisDir [in] normalized directional vector

Definition at line 1365 of file Box.h.

References DBGASSERT_MATH, NSMath::TMatrix3::DotRow0(), NSMath::TMatrix3::DotRow1(), NSMath::TMatrix3::DotRow2(), NSMath::NSStdMath::fabs(), NSMath::TVector3::IsNormalized(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by IsInside(), IsIntersect(), NSMath::TPlane::IsNegative(), NSMath::TPlane::IsPositive(), ProjectToAxis(), ProjectToLine(), ProjectToLineSegment(), ProjectToLineSegmentNormalized(), and ProjectToRay().

Here is the call graph for this function:

float TBox::ProjectExtentsToX void   )  const [inline]
 

Project extents to X-axis.

Note:
Always returns value >= 0.

Definition at line 1379 of file Box.h.

References NSMath::NSStdMath::fabs(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by GetMaxX(), GetMaxXYZ(), GetMinMaxXYZ(), GetMinX(), GetMinXYZ(), and IsIntersect().

Here is the call graph for this function:

float TBox::ProjectExtentsToY void   )  const [inline]
 

Project extents to Y-axis.

Note:
Always returns value >= 0.

Definition at line 1391 of file Box.h.

References NSMath::NSStdMath::fabs(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by GetMaxXYZ(), GetMaxY(), GetMinMaxXYZ(), GetMinXYZ(), GetMinY(), and IsIntersect().

Here is the call graph for this function:

float TBox::ProjectExtentsToZ void   )  const [inline]
 

Project extents to Z-axis.

Note:
Always returns value >= 0.

Definition at line 1403 of file Box.h.

References NSMath::NSStdMath::fabs(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Referenced by GetMaxXYZ(), GetMaxZ(), GetMinMaxXYZ(), GetMinXYZ(), GetMinZ(), and IsIntersect().

Here is the call graph for this function:

void TBox::ProjectToAxis const TVector3 axisDir,
float &  timeMin,
float &  timeMax
const [inline]
 

This method projects box to specified axis determined only directional vector (thus axis goes through origin of space.

Method computes time values which bound projection of box to axis. You can use these time values to compute point of projection simply via ORIGIN + DIR * TIME where ORIGIN = [0,0,0].

Parameters:
axisDir [in] directional vector (normalized) for axis
timeMin [out] first computed time value - always less or equal than second
timeMax [out] second computed time value - always greater or equal than second

Definition at line 1422 of file Box.h.

References NSMath::TVector3::Dot(), and ProjectExtentsToAxis().

Here is the call graph for this function:

void TBox::ProjectToLine const TLine line,
float &  timeMin,
float &  timeMax
const [inline]
 

This method projects box to specified line.

Method computes time values which bound projection of AABB to line. You can use these time values to compute point of projection simply via ORIGIN + DIR * TIME.

Time t==0 is returned for points "above" line definition point.

Parameters:
line [in] line for projection
timeMin [out] first computed time value - always less or equal than second
timeMax [out] second computed time value - always greater or equal than second

Definition at line 1445 of file Box.h.

References NSMath::TLine::GetVector(), ProjectExtentsToAxis(), and NSMath::TLine::Time().

Here is the call graph for this function:

void TBox::ProjectToLineSegment const TLineSegment seg,
float &  timeMin,
float &  timeMax
const [inline]
 

This method projects box to specified line segment.

Method computes time values which bound projection of box to line segment. You can use these time values to compute point of projection simply via ORIGIN + DIR * SEG_LENGTH * TIME.

Time t==0 is returned for points "above" start of line segment. Time t==1 is returned for points "above" end of line segment.

Parameters:
seg [in] line segment for projection
timeMin [out] first computed time value - always less or equal than second
timeMax [out] second computed time value - always greater or equal than second

Definition at line 1469 of file Box.h.

References NSMath::TLineSegment::GetVector(), NSMath::TLineSegment::InvLength(), ProjectExtentsToAxis(), and NSMath::TLineSegment::TimeNormalized().

Here is the call graph for this function:

void TBox::ProjectToLineSegmentNormalized const TLineSegment seg,
float &  timeMin,
float &  timeMax
const [inline]
 

This method projects box to specified line segment in NORMALIZED coordinated!!!

Method computes time values which bound projection of box to line segment. You can use these time values to compute point of projection simply via ORIGIN + DIR * TIME.

Time t==0 is returned for points "above" start of line segment.

Warning:
NORMALIZED time value t==1 is point in distance 1 from START of segment!!! Its not point above END point of line segment!!!
Parameters:
seg [in] line segment for projection
timeMin [out] first computed time value - always less or equal than second
timeMax [out] second computed time value - always greater or equal than second

Definition at line 1504 of file Box.h.

References NSMath::TLineSegment::GetVector(), ProjectExtentsToAxis(), and NSMath::TLineSegment::TimeNormalized().

Here is the call graph for this function:

void TBox::ProjectToRay const TRay ray,
float &  timeMin,
float &  timeMax
const [inline]
 

This method projects box to specified ray.

Method computes time values which bound projection of box to ray. You can use these time values to compute point of projection simply via ORIGIN + DIR * TIME.

Time t==0 is returned for points "above" start of ray.

Parameters:
ray [in] ray for projection
timeMin [out] first computed time value - always less or equal than second
timeMax [out] second computed time value - always greater or equal than second

Definition at line 1531 of file Box.h.

References NSMath::TRay::GetVector(), ProjectExtentsToAxis(), and NSMath::TRay::Time().

Here is the call graph for this function:

float TBox::Radius void   )  const [inline]
 

Compute radius of circumsphere of this box.

Definition at line 987 of file Box.h.

References NSMath::TVector3::Length().

Here is the call graph for this function:

float TBox::RadiusInner void   )  const [inline]
 

Compute radius of inner sphere of this box.

Warning:
This method is faster than TBox::RadiusInnerSquare.

Definition at line 1003 of file Box.h.

References NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

float TBox::RadiusInnerSquare void   )  const [inline]
 

Compute square of radius of inner sphere of this box.

Warning:
This method is slower than TBox::RadiusInnerSquare.

Definition at line 1016 of file Box.h.

References NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

float TBox::RadiusSquare void   )  const [inline]
 

Compute square of radius of circumsphere of this box.

Definition at line 994 of file Box.h.

References NSMath::TVector3::LengthSq().

Referenced by NSMath::TSphere::TSphere().

Here is the call graph for this function:

void TBox::RotateAroundOrigin const TQuaternion rotate  )  [inline]
 

Rotate this box around origin with specified quaternion.

Note:
This method is slower than TBox::RotateAroundOrigin(TMatrix3)
Parameters:
rotate [in] quaternion

Definition at line 725 of file Box.h.

References NSMath::TMatrix3::GetRow(), and NSMath::TQuaternion::Transform().

Here is the call graph for this function:

void TBox::RotateAroundOrigin const TMatrix3 rotate  )  [inline]
 

Rotate this box around origin with specified rotation matrix.

Parameters:
rotate [in] rotation matrix

Definition at line 704 of file Box.h.

References NSMath::TMatrix3::GetRow(), NSMath::TMatrix3::MulRight(), and NSMath::TMatrix3::Transform().

Here is the call graph for this function:

void TBox::RotateAroundPoint const TQuaternion rotate,
const TVector3 origin
[inline]
 

Rotate this box around specified point ORIGIN with specified quaternion.

Note:
This method is slower than TBox::RotateAroundPoint(TMatrix3)
Parameters:
rotate [in] quaternion
origin [in] point of rotation

Definition at line 765 of file Box.h.

References NSMath::TMatrix3::GetRow(), NSMath::TQuaternion::Transform(), and NSMath::TQuaternion::TransformTo().

Here is the call graph for this function:

void TBox::RotateAroundPoint const TMatrix3 rotate,
const TVector3 origin
[inline]
 

Rotate this box around specified point ORIGIN with specified rotation matrix.

Parameters:
rotate [in] rotation matrix
origin [in] point of rotation

Definition at line 741 of file Box.h.

References NSMath::TMatrix3::GetRow(), NSMath::TMatrix3::MulRight(), and NSMath::TMatrix3::Transform().

Here is the call graph for this function:

void TBox::RotateAroundX const float &  angle  )  [inline]
 

Rotate this box around X-axis about specified angle in radians.

Angle is measured in counter-clockwise order when you look along X-axis towards origin.

Parameters:
angle [in] angle in radians

Definition at line 784 of file Box.h.

References NSMath::TMatrix3::GetRow(), NSMath::TVector3::RotateXSinCos(), and NSMath::NSStdMath::sincos().

Here is the call graph for this function:

void TBox::RotateAroundXSinCos const float &  tsin,
const float &  tcos
[inline]
 

Rotate this box around X-axis about specified angle that sinus and cosinus are contained in parameters.

Parameters:
tsin [in] sinus of given angle
tcos [in] cosinus of given angle

Definition at line 838 of file Box.h.

References NSMath::TMatrix3::GetRow(), and NSMath::TVector3::RotateXSinCos().

Here is the call graph for this function:

void TBox::RotateAroundY const float &  angle  )  [inline]
 

Rotate this box around Y-axis about specified angle in radians.

Angle is measured in counter-clockwise order when you look along Y-axis towards origin.

Parameters:
angle [in] angle in radians

Definition at line 802 of file Box.h.

References NSMath::TMatrix3::GetRow(), NSMath::TVector3::RotateYSinCos(), and NSMath::NSStdMath::sincos().

Here is the call graph for this function:

void TBox::RotateAroundYSinCos const float &  tsin,
const float &  tcos
[inline]
 

Rotate this box around Y-axis about specified angle that sinus and cosinus are contained in parameters.

Parameters:
tsin [in] sinus of given angle
tcos [in] cosinus of given angle

Definition at line 853 of file Box.h.

References NSMath::TMatrix3::GetRow(), and NSMath::TVector3::RotateYSinCos().

Here is the call graph for this function:

void TBox::RotateAroundZ const float &  angle  )  [inline]
 

Rotate this box around Z-axis about specified angle in radians.

Angle is measured in counter-clockwise order when you look along Z-axis towards origin.

Parameters:
angle [in] angle in radians

Definition at line 820 of file Box.h.

References NSMath::TMatrix3::GetRow(), NSMath::TVector3::RotateZSinCos(), and NSMath::NSStdMath::sincos().

Here is the call graph for this function:

void TBox::RotateAroundZSinCos const float &  tsin,
const float &  tcos
[inline]
 

Rotate this box around Z-axis about specified angle that sinus and cosinus are contained in parameters.

Parameters:
tsin [in] sinus of given angle
tcos [in] cosinus of given angle

Definition at line 868 of file Box.h.

References NSMath::TMatrix3::GetRow(), and NSMath::TVector3::RotateZSinCos().

Here is the call graph for this function:

void TBox::ScaleFromCenter const float &  scale  )  [inline]
 

Scale this box about specified value from center.

Note:
It means position of center won't be changed.
Parameters:
scale [in] scale factor - MUST BE >= 0 !!!

Definition at line 903 of file Box.h.

References DBGASSERT_MATH.

void TBox::Set const TBox box  )  [inline]
 

Set this OBB from another OBB.

Parameters:
box [in] original box

Definition at line 407 of file Box.h.

References m_axes, m_center, and m_extents.

Referenced by operator=(), and TBox().

void TBox::SetFromPoints const TVector3 points,
const DWORD count
[inline]
 

Set this box from array of points.

Warning:
At least one point must be contained in array!!!
Parameters:
points [in] array with points
count [in] number of points in array - must be > 0 !!!

Definition at line 421 of file Box.h.

References DBGASSERT_MATH, DBGASSERT_MATHLOW, NSMath::TMathCPU::FindMinMax(), TGlobalsMath::GetCPU(), and NSMath::TMatrix3::Identity().

Here is the call graph for this function:

float TBox::Surface void   )  const [inline]
 

Compute surface of this box.

Definition at line 1027 of file Box.h.

References NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

TAABBox TBox::ToAABBox void   )  const
 

Convert this box to AABB.

Definition at line 48 of file Box.cpp.

void TBox::ToBoxSpace float &  x,
float &  y,
float &  z
const [inline]
 

Convert given point [x,y,z] from world space to box space and result store in coordinates of input point.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
x [in out] point's x-coordinate and x-coordinate of result
y [in out] point's y-coordinate and y-coordinate of result
z [in out] point's z-coordinate and z-coordinate of result

Definition at line 1185 of file Box.h.

References NSMath::TMatrix3::TransformInverse(), NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

Here is the call graph for this function:

void TBox::ToBoxSpace TVector3 vec  )  const [inline]
 

Convert given point from world space to box space and result store in the same vector.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
vec [in out] vector in world space to convert and result too

Definition at line 1168 of file Box.h.

References NSMath::TMatrix3::TransformInverse().

Here is the call graph for this function:

void TBox::ToBoxSpaceAsVector float &  x,
float &  y,
float &  z
const [inline]
 

Convert given vector [x,y,z] from world space to box space and return store in input parameters.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
x [in out] x-coordinate of vector to transform and also result x-coordinate
y [in out] y-coordinate of vector to transform and also result y-coordinate
z [in out] z-coordinate of vector to transform and also result z-coordinate

Definition at line 1241 of file Box.h.

References NSMath::TMatrix3::TransformInverse().

Here is the call graph for this function:

void TBox::ToBoxSpaceAsVector TVector3 vec  )  const [inline]
 

Convert given vector from world space to box space and return store in this vector.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
vec [in out] vector to transform and also output

Definition at line 1226 of file Box.h.

References NSMath::TMatrix3::TransformInverse().

Here is the call graph for this function:

TVector3 TBox::ToBoxSpaceAsVectorGet const float &  x,
const float &  y,
const float &  z
const [inline]
 

Convert given vector [x,y,z] from world space to box space and return new vector as result.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
x [in] x-coordinate of vector to transform
y [in] y-coordinate of vector to transform
z [in] z-coordinate of vector to transform

Definition at line 1215 of file Box.h.

References ToBoxSpaceAsVectorGet().

Here is the call graph for this function:

TVector3 TBox::ToBoxSpaceAsVectorGet const TVector3 vec  )  const [inline]
 

Convert given vector from world space to box space and return new vector as result.

Note:
Vectors have no position thus operation only rotate vector with local basis.
Parameters:
vec [in] vector to transform

Definition at line 1201 of file Box.h.

References NSMath::TMatrix3::TransformInverseTo().

Referenced by IsIntersect(), and ToBoxSpaceAsVectorGet().

Here is the call graph for this function:

TVector3 TBox::ToBoxSpaceGet const float &  x,
const float &  y,
const float &  z
const [inline]
 

Convert given point [x,y,z] from world space to box space.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
x [in] point's x-coordinate
y [in] point's y-coordinate
z [in] point's z-coordinate

Definition at line 1156 of file Box.h.

References NSMath::TMatrix3::TransformInverseTo().

Here is the call graph for this function:

TVector3 TBox::ToBoxSpaceGet const TVector3 vec  )  const [inline]
 

Convert given point from world space to box space.

Note:
Point [0,0,0] in box space is equal to center of box !!!
Parameters:
vec [in] vector in world space to convert

Definition at line 1142 of file Box.h.

References NSMath::TMatrix3::TransformInverseTo().

Referenced by AddPoint(), DistanceSurfaceSquare(), NSMath::TSphere::IsInside(), IsInside(), and IsIntersect().

Here is the call graph for this function:

TSphere TBox::ToSphere void   )  const
 

Convert this box to sphere.

Definition at line 55 of file Box.cpp.

void TBox::Translate const float &  x,
const float &  y,
const float &  z
[inline]
 

Translate this box about specified vector [x,y,z].

Parameters:
x [in] offset in x-coordinate
y [in] offset in y-coordinate
z [in] offset in z-coordinate

Definition at line 695 of file Box.h.

References NSMath::TVector3::Add().

Here is the call graph for this function:

void TBox::Translate const TVector3 vec  )  [inline]
 

Translate this box about specified vector.

Parameters:
vec [in] offset

Definition at line 684 of file Box.h.

float TBox::Volume void   )  const [inline]
 

Compute volume of this box.

Definition at line 1047 of file Box.h.

References NSMath::TVector3::x, NSMath::TVector3::y, and NSMath::TVector3::z.

float TBox::Width void   )  const [inline]
 

Returns width of this box.

Note:
It is double of extents along local X-axis.

Definition at line 962 of file Box.h.

References NSMath::TVector3::x.


The documentation for this struct was generated from the following files:
Generated on Wed Nov 28 22:47:48 2007 for Joy4D by  doxygen 1.4.6-NO