OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::ArrayAabb Class Reference

Cache-friendly array of Aabb represented as a SoA array. More...

#include <OgreArrayAabb.h>

+ Collaboration diagram for Ogre::ArrayAabb:

Public Member Functions

 ArrayAabb (const ArrayVector3 &center, const ArrayVector3 &halfSize)
 
 ArrayAabb (const ArrayVector3 &center, const ArrayVector3 &halfSize)
 
 ArrayAabb (const ArrayVector3 &center, const ArrayVector3 &halfSize)
 
ArrayMaskR contains (const ArrayAabb &other) const
 Tests whether another box contained by this box. More...
 
ArrayMaskR contains (const ArrayAabb &other) const
 Tests whether another box contained by this box. More...
 
ArrayMaskR contains (const ArrayAabb &other) const
 Tests whether another box contained by this box. More...
 
ArrayMaskR contains (const ArrayVector3 &v) const
 Tests whether the given point contained by this box. More...
 
ArrayMaskR contains (const ArrayVector3 &v) const
 Tests whether the given point contained by this box. More...
 
ArrayMaskR contains (const ArrayVector3 &v) const
 Tests whether the given point contained by this box. More...
 
ArrayReal distance (const ArrayVector3 &v) const
 Returns the minimum distance between a given point and any part of the box. More...
 
ArrayReal distance (const ArrayVector3 &v) const
 Returns the minimum distance between a given point and any part of the box. More...
 
ArrayReal distance (const ArrayVector3 &v) const
 Returns the minimum distance between a given point and any part of the box. More...
 
void getAsAabb (Aabb &out, size_t index) const
 
void getAsAabb (Aabb &out, size_t index) const
 
void getAsAabb (Aabb &out, size_t index) const
 
Aabb getAsAabb (size_t index) const
 Prefer using. More...
 
Aabb getAsAabb (size_t index) const
 Prefer using. More...
 
Aabb getAsAabb (size_t index) const
 Prefer using. More...
 
ArrayVector3 getMaximum () const
 Gets the maximum corner of the box. More...
 
ArrayVector3 getMaximum () const
 Gets the maximum corner of the box. More...
 
ArrayVector3 getMaximum () const
 Gets the maximum corner of the box. More...
 
ArrayVector3 getMinimum () const
 Gets the minimum corner of the box. More...
 
ArrayVector3 getMinimum () const
 Gets the minimum corner of the box. More...
 
ArrayVector3 getMinimum () const
 Gets the minimum corner of the box. More...
 
ArrayAabb intersection (const ArrayAabb &b2) const
 Calculate the area of intersection of this box and another. More...
 
ArrayAabb intersection (const ArrayAabb &b2) const
 Calculate the area of intersection of this box and another. More...
 
ArrayAabb intersection (const ArrayAabb &b2) const
 Calculate the area of intersection of this box and another. More...
 
ArrayMaskR intersects (const ArrayAabb &b2) const
 Returns whether or not this box intersects another. More...
 
ArrayMaskR intersects (const ArrayAabb &b2) const
 Returns whether or not this box intersects another. More...
 
ArrayMaskR intersects (const ArrayAabb &b2) const
 Returns whether or not this box intersects another. More...
 
void merge (const ArrayAabb &rhs)
 Merges the passed in box into the current box. More...
 
void merge (const ArrayAabb &rhs)
 Merges the passed in box into the current box. More...
 
void merge (const ArrayAabb &rhs)
 Merges the passed in box into the current box. More...
 
void merge (const ArrayVector3 &points)
 Extends the box to encompass the specified point (if needed). More...
 
void merge (const ArrayVector3 &points)
 Extends the box to encompass the specified point (if needed). More...
 
void merge (const ArrayVector3 &points)
 Extends the box to encompass the specified point (if needed). More...
 
void setAll (const Aabb &aabb)
 
void setAll (const Aabb &aabb)
 
void setAll (const Aabb &aabb)
 
void setFromAabb (const Aabb &aabb, size_t index)
 
void setFromAabb (const Aabb &aabb, size_t index)
 
void setFromAabb (const Aabb &aabb, size_t index)
 
void transformAffine (const ArrayMatrix4 &matrix)
 Transforms the box according to the matrix supplied. More...
 
void transformAffine (const ArrayMatrix4 &matrix)
 Transforms the box according to the matrix supplied. More...
 
void transformAffine (const ArrayMatrix4 &matrix)
 Transforms the box according to the matrix supplied. More...
 
ArrayReal volume (void) const
 Calculate the volume of this box. More...
 
ArrayReal volume (void) const
 Calculate the volume of this box. More...
 
ArrayReal volume (void) const
 Calculate the volume of this box. More...
 

Public Attributes

ArrayVector3 mCenter
 
ArrayVector3 mHalfSize
 

Static Public Attributes

static const ArrayAabb BOX_INFINITE
 
static const ArrayAabb BOX_ZERO
 

Detailed Description

Cache-friendly array of Aabb represented as a SoA array.

Remarks
ArrayAabb is a SIMD & cache-friendly version of AxisAlignedBox. (AABB = Axis aligned bounding box) ArrayVector3 for more information.
For performance reasons given the mathematical properties, this version stores the box in the form "center + halfSize" instead of the form "minimum, maximum" that is present in AxisAlignedBox: Merging is slightly more expensive intersects() is much cheaper Naturally deals with infinite boxes (no need for branches) Transform is cheaper (a common operation)
Extracting one aabb needs 84 bytes, while all 4 aabbs need 96 bytes, both cases are always two cache lines. Architectures where the cache line == 32 bytes may want to set ARRAY_PACKED_REALS = 2 depending on their needs

Definition at line 69 of file C/OgreArrayAabb.h.

Constructor & Destructor Documentation

Ogre::ArrayAabb::ArrayAabb ( const ArrayVector3 center,
const ArrayVector3 halfSize 
)
inline

Definition at line 75 of file C/OgreArrayAabb.h.

Ogre::ArrayAabb::ArrayAabb ( const ArrayVector3 center,
const ArrayVector3 halfSize 
)
inline

Definition at line 75 of file NEON/Single/OgreArrayAabb.h.

Ogre::ArrayAabb::ArrayAabb ( const ArrayVector3 center,
const ArrayVector3 halfSize 
)
inline

Definition at line 75 of file SSE2/Single/OgreArrayAabb.h.

Member Function Documentation

ArrayMaskR Ogre::ArrayAabb::contains ( const ArrayAabb other) const
inline

Tests whether another box contained by this box.

ArrayMaskR Ogre::ArrayAabb::contains ( const ArrayAabb other) const
inline

Tests whether another box contained by this box.

ArrayMaskR Ogre::ArrayAabb::contains ( const ArrayAabb other) const
inline

Tests whether another box contained by this box.

ArrayMaskR Ogre::ArrayAabb::contains ( const ArrayVector3 v) const
inline

Tests whether the given point contained by this box.

ArrayMaskR Ogre::ArrayAabb::contains ( const ArrayVector3 v) const
inline

Tests whether the given point contained by this box.

ArrayMaskR Ogre::ArrayAabb::contains ( const ArrayVector3 v) const
inline

Tests whether the given point contained by this box.

ArrayReal Ogre::ArrayAabb::distance ( const ArrayVector3 v) const
inline

Returns the minimum distance between a given point and any part of the box.

ArrayReal Ogre::ArrayAabb::distance ( const ArrayVector3 v) const
inline

Returns the minimum distance between a given point and any part of the box.

ArrayReal Ogre::ArrayAabb::distance ( const ArrayVector3 v) const
inline

Returns the minimum distance between a given point and any part of the box.

void Ogre::ArrayAabb::getAsAabb ( Aabb out,
size_t  index 
) const
inline
void Ogre::ArrayAabb::getAsAabb ( Aabb out,
size_t  index 
) const
inline
void Ogre::ArrayAabb::getAsAabb ( Aabb out,
size_t  index 
) const
inline
Aabb Ogre::ArrayAabb::getAsAabb ( size_t  index) const
inline

Prefer using.

See also
getAsAabb() because this function may have more overhead (the other one is faster)

Definition at line 94 of file C/OgreArrayAabb.h.

Aabb Ogre::ArrayAabb::getAsAabb ( size_t  index) const
inline

Prefer using.

See also
getAsAabb() because this function may have more overhead (the other one is faster)

Definition at line 94 of file NEON/Single/OgreArrayAabb.h.

Aabb Ogre::ArrayAabb::getAsAabb ( size_t  index) const
inline

Prefer using.

See also
getAsAabb() because this function may have more overhead (the other one is faster)

Definition at line 94 of file SSE2/Single/OgreArrayAabb.h.

ArrayVector3 Ogre::ArrayAabb::getMaximum ( ) const
inline

Gets the maximum corner of the box.

ArrayVector3 Ogre::ArrayAabb::getMaximum ( ) const
inline

Gets the maximum corner of the box.

ArrayVector3 Ogre::ArrayAabb::getMaximum ( ) const
inline

Gets the maximum corner of the box.

ArrayVector3 Ogre::ArrayAabb::getMinimum ( ) const
inline

Gets the minimum corner of the box.

ArrayVector3 Ogre::ArrayAabb::getMinimum ( ) const
inline

Gets the minimum corner of the box.

ArrayVector3 Ogre::ArrayAabb::getMinimum ( ) const
inline

Gets the minimum corner of the box.

ArrayAabb Ogre::ArrayAabb::intersection ( const ArrayAabb b2) const
inline

Calculate the area of intersection of this box and another.

ArrayAabb Ogre::ArrayAabb::intersection ( const ArrayAabb b2) const
inline

Calculate the area of intersection of this box and another.

ArrayAabb Ogre::ArrayAabb::intersection ( const ArrayAabb b2) const
inline

Calculate the area of intersection of this box and another.

ArrayMaskR Ogre::ArrayAabb::intersects ( const ArrayAabb b2) const
inline

Returns whether or not this box intersects another.

ArrayMaskR Ogre::ArrayAabb::intersects ( const ArrayAabb b2) const
inline

Returns whether or not this box intersects another.

ArrayMaskR Ogre::ArrayAabb::intersects ( const ArrayAabb b2) const
inline

Returns whether or not this box intersects another.

void Ogre::ArrayAabb::merge ( const ArrayAabb rhs)
inline

Merges the passed in box into the current box.

The result is the box which encompasses both.

void Ogre::ArrayAabb::merge ( const ArrayAabb rhs)
inline

Merges the passed in box into the current box.

The result is the box which encompasses both.

void Ogre::ArrayAabb::merge ( const ArrayAabb rhs)
inline

Merges the passed in box into the current box.

The result is the box which encompasses both.

void Ogre::ArrayAabb::merge ( const ArrayVector3 points)
inline

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

void Ogre::ArrayAabb::merge ( const ArrayVector3 points)
inline

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

void Ogre::ArrayAabb::merge ( const ArrayVector3 points)
inline

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

void Ogre::ArrayAabb::setAll ( const Aabb aabb)
inline

Definition at line 112 of file C/OgreArrayAabb.h.

References Ogre::Aabb::mCenter, and Ogre::Aabb::mHalfSize.

void Ogre::ArrayAabb::setAll ( const Aabb aabb)
inline

Definition at line 112 of file NEON/Single/OgreArrayAabb.h.

References Ogre::Aabb::mCenter, and Ogre::Aabb::mHalfSize.

void Ogre::ArrayAabb::setAll ( const Aabb aabb)
inline

Definition at line 112 of file SSE2/Single/OgreArrayAabb.h.

References Ogre::Aabb::mCenter, and Ogre::Aabb::mHalfSize.

void Ogre::ArrayAabb::setFromAabb ( const Aabb aabb,
size_t  index 
)
inline
void Ogre::ArrayAabb::setFromAabb ( const Aabb aabb,
size_t  index 
)
inline
void Ogre::ArrayAabb::setFromAabb ( const Aabb aabb,
size_t  index 
)
inline
void Ogre::ArrayAabb::transformAffine ( const ArrayMatrix4 matrix)
inline

Transforms the box according to the matrix supplied.

Remarks
By calling this method you get the axis-aligned box which surrounds the transformed version of this box. Therefore each corner of the box is transformed by the matrix, then the extents are mapped back onto the axes to produce another AABB. Useful when you have a local AABB for an object which is then transformed.
Note
The matrix must be an affine matrix.
See also
Matrix4::isAffine.
void Ogre::ArrayAabb::transformAffine ( const ArrayMatrix4 matrix)
inline

Transforms the box according to the matrix supplied.

Remarks
By calling this method you get the axis-aligned box which surrounds the transformed version of this box. Therefore each corner of the box is transformed by the matrix, then the extents are mapped back onto the axes to produce another AABB. Useful when you have a local AABB for an object which is then transformed.
Note
The matrix must be an affine matrix.
See also
Matrix4::isAffine.
void Ogre::ArrayAabb::transformAffine ( const ArrayMatrix4 matrix)
inline

Transforms the box according to the matrix supplied.

Remarks
By calling this method you get the axis-aligned box which surrounds the transformed version of this box. Therefore each corner of the box is transformed by the matrix, then the extents are mapped back onto the axes to produce another AABB. Useful when you have a local AABB for an object which is then transformed.
Note
The matrix must be an affine matrix.
See also
Matrix4::isAffine.
ArrayReal Ogre::ArrayAabb::volume ( void  ) const
inline

Calculate the volume of this box.

ArrayReal Ogre::ArrayAabb::volume ( void  ) const
inline

Calculate the volume of this box.

ArrayReal Ogre::ArrayAabb::volume ( void  ) const
inline

Calculate the volume of this box.

Member Data Documentation

static const ArrayAabb Ogre::ArrayAabb::BOX_INFINITE
static

Definition at line 163 of file C/OgreArrayAabb.h.

static const ArrayAabb Ogre::ArrayAabb::BOX_ZERO
static

Definition at line 166 of file C/OgreArrayAabb.h.

ArrayVector3 Ogre::ArrayAabb::mCenter

Definition at line 72 of file C/OgreArrayAabb.h.

ArrayVector3 Ogre::ArrayAabb::mHalfSize

Definition at line 73 of file C/OgreArrayAabb.h.


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