OGRE-Next: Ogre::ArrayAabb Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Ogre::ArrayAabb Class Reference
Core » Math

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

`#include <OgreArrayAabb.h>`

## Public Member Functions
| ArrayAabb ()
| ArrayAabb ()
| ArrayAabb ()
| 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.
ArrayMaskR | contains (const ArrayAabb &other) const
| Tests whether another box contained by this box.
ArrayMaskR | contains (const ArrayAabb &other) const
| Tests whether another box contained by this box.
ArrayMaskR | contains (const ArrayVector3 &v) const
| Tests whether the given point contained by this box.
ArrayMaskR | contains (const ArrayVector3 &v) const
| Tests whether the given point contained by this box.
ArrayMaskR | contains (const ArrayVector3 &v) const
| Tests whether the given point contained by this box.
ArrayReal | distance (const ArrayVector3 &v) const
| Returns the minimum distance between a given point and any part of the box.
ArrayReal | distance (const ArrayVector3 &v) const
| Returns the minimum distance between a given point and any part of the box.
ArrayReal | distance (const ArrayVector3 &v) const
| Returns the minimum distance between a given point and any part of the box.
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.
Aabb | getAsAabb (size_t index) const
| Prefer using.
Aabb | getAsAabb (size_t index) const
| Prefer using.
ArrayVector3 | getMaximum () const
| Gets the maximum corner of the box.
ArrayVector3 | getMaximum () const
| Gets the maximum corner of the box.
ArrayVector3 | getMaximum () const
| Gets the maximum corner of the box.
ArrayVector3 | getMinimum () const
| Gets the minimum corner of the box.
ArrayVector3 | getMinimum () const
| Gets the minimum corner of the box.
ArrayVector3 | getMinimum () const
| Gets the minimum corner of the box.
ArrayAabb | intersection (const ArrayAabb &b2) const
| Calculate the area of intersection of this box and another.
ArrayAabb | intersection (const ArrayAabb &b2) const
| Calculate the area of intersection of this box and another.
ArrayAabb | intersection (const ArrayAabb &b2) const
| Calculate the area of intersection of this box and another.
ArrayMaskR | intersects (const ArrayAabb &b2) const
| Returns whether or not this box intersects another.
ArrayMaskR | intersects (const ArrayAabb &b2) const
| Returns whether or not this box intersects another.
ArrayMaskR | intersects (const ArrayAabb &b2) const
| Returns whether or not this box intersects another.
void | merge (const ArrayAabb &rhs)
| Merges the passed in box into the current box.
void | merge (const ArrayAabb &rhs)
| Merges the passed in box into the current box.
void | merge (const ArrayAabb &rhs)
| Merges the passed in box into the current box.
void | merge (const ArrayVector3 &points)
| Extends the box to encompass the specified point (if needed).
void | merge (const ArrayVector3 &points)
| Extends the box to encompass the specified point (if needed).
void | merge (const ArrayVector3 &points)
| Extends the box to encompass the specified point (if needed).
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)
ArrayReal | squaredDistance (const ArrayVector3 &v) const
| Returns the square of the minimum distance between a given point and any part of the box.
ArrayReal | squaredDistance (const ArrayVector3 &v) const
| Returns the square of the minimum distance between a given point and any part of the box.
ArrayReal | squaredDistance (const ArrayVector3 &v) const
| Returns the square of the minimum distance between a given point and any part of the box.
void | transformAffine (const ArrayMatrix4 &matrix)
| Transforms the box according to the matrix supplied.
void | transformAffine (const ArrayMatrix4 &matrix)
| Transforms the box according to the matrix supplied.
void | transformAffine (const ArrayMatrix4 &matrix)
| Transforms the box according to the matrix supplied.
ArrayReal | volume () const
| Calculate the volume of this box.
ArrayReal | volume () const
| Calculate the volume of this box.
ArrayReal | volume () const
| Calculate the volume of this box.

## 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) See 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

Remarks
  ArrayAabb is a SIMD & cache-friendly version of AxisAlignedBox. (AABB = Axis aligned bounding box) See 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

## Constructor & Destructor Documentation

## ◆ ArrayAabb() [1/6]

Ogre::ArrayAabb::ArrayAabb | ( |  | ) |
| inline

Referenced by contains(), distance(), intersection(), intersects(), and merge().

## ◆ ArrayAabb() [2/6]

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

References mCenter, and mHalfSize.

## ◆ ArrayAabb() [3/6]

Ogre::ArrayAabb::ArrayAabb | ( |  | ) |
| inline

## ◆ ArrayAabb() [4/6]

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

References mCenter, and mHalfSize.

## ◆ ArrayAabb() [5/6]

Ogre::ArrayAabb::ArrayAabb | ( |  | ) |
| inline

## ◆ ArrayAabb() [6/6]

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

References mCenter, and mHalfSize.

## Member Function Documentation

## ◆ contains() [1/6]

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

Tests whether another box contained by this box.

References ArrayAabb().

## ◆ contains() [2/6]

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

Tests whether another box contained by this box.

References ArrayAabb().

## ◆ contains() [3/6]

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

Tests whether another box contained by this box.

References ArrayAabb().

## ◆ contains() [4/6]

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

Tests whether the given point contained by this box.

## ◆ contains() [5/6]

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

Tests whether the given point contained by this box.

## ◆ contains() [6/6]

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

Tests whether the given point contained by this box.

## ◆ distance() [1/3]

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

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

## ◆ distance() [2/3]

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

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

References ArrayAabb(), BOX_INFINITE, and BOX_ZERO.

## ◆ distance() [3/3]

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

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

References ArrayAabb(), BOX_INFINITE, and BOX_ZERO.

## ◆ getAsAabb() [1/6]

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

References ARRAY_PACKED_REALS, Ogre::Aabb::mCenter, mCenter, Ogre::Aabb::mHalfSize, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

Referenced by Ogre::ObjectData::copy(), and getAsAabb().

## ◆ getAsAabb() [2/6]

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

References ARRAY_PACKED_REALS, Ogre::Aabb::mCenter, mCenter, Ogre::Aabb::mHalfSize, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

## ◆ getAsAabb() [3/6]

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

References ARRAY_PACKED_REALS, Ogre::Aabb::mCenter, mCenter, Ogre::Aabb::mHalfSize, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

## ◆ getAsAabb() [4/6]

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)

References getAsAabb().

## ◆ getAsAabb() [5/6]

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)

References getAsAabb().

## ◆ getAsAabb() [6/6]

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)

References getAsAabb().

## ◆ getMaximum() [1/3]

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

Gets the maximum corner of the box.

Referenced by Ogre::ArrayRay::intersects().

## ◆ getMaximum() [2/3]

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

Gets the maximum corner of the box.

## ◆ getMaximum() [3/3]

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

Gets the maximum corner of the box.

## ◆ getMinimum() [1/3]

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

Gets the minimum corner of the box.

Referenced by Ogre::ArrayRay::intersects().

## ◆ getMinimum() [2/3]

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

Gets the minimum corner of the box.

## ◆ getMinimum() [3/3]

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

Gets the minimum corner of the box.

## ◆ intersection() [1/3]

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

Calculate the area of intersection of this box and another.

References ArrayAabb().

## ◆ intersection() [2/3]

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

Calculate the area of intersection of this box and another.

References ArrayAabb().

## ◆ intersection() [3/3]

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

Calculate the area of intersection of this box and another.

References ArrayAabb().

## ◆ intersects() [1/3]

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

Returns whether or not this box intersects another.

References ArrayAabb().

## ◆ intersects() [2/3]

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

Returns whether or not this box intersects another.

References ArrayAabb().

## ◆ intersects() [3/3]

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

Returns whether or not this box intersects another.

References ArrayAabb().

## ◆ merge() [1/6]

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.

References ArrayAabb().

## ◆ merge() [2/6]

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.

References ArrayAabb().

## ◆ merge() [3/6]

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.

References ArrayAabb().

## ◆ merge() [4/6]

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

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

## ◆ merge() [5/6]

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

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

## ◆ merge() [6/6]

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

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

## ◆ setAll() [1/3]

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

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

## ◆ setAll() [2/3]

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

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

## ◆ setAll() [3/3]

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

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

## ◆ setFromAabb() [1/3]

void Ogre::ArrayAabb::setFromAabb | ( | const Aabb & | aabb,
|  | size_t | index )
| inline

References ARRAY_PACKED_REALS, Ogre::Aabb::mCenter, mCenter, Ogre::Aabb::mHalfSize, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

## ◆ setFromAabb() [2/3]

void Ogre::ArrayAabb::setFromAabb | ( | const Aabb & | aabb,
|  | size_t | index )
| inline

References ARRAY_PACKED_REALS, Ogre::Aabb::mCenter, mCenter, Ogre::Aabb::mHalfSize, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

## ◆ setFromAabb() [3/3]

void Ogre::ArrayAabb::setFromAabb | ( | const Aabb & | aabb,
|  | size_t | index )
| inline

References ARRAY_PACKED_REALS, Ogre::Aabb::mCenter, mCenter, Ogre::Aabb::mHalfSize, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

## ◆ squaredDistance() [1/3]

ArrayReal Ogre::ArrayAabb::squaredDistance | ( | const ArrayVector3 & | v | ) | const
| inline

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

## ◆ squaredDistance() [2/3]

ArrayReal Ogre::ArrayAabb::squaredDistance | ( | const ArrayVector3 & | v | ) | const
| inline

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

## ◆ squaredDistance() [3/3]

ArrayReal Ogre::ArrayAabb::squaredDistance | ( | const ArrayVector3 & | v | ) | const
| inline

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

## ◆ transformAffine() [1/3]

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.

## ◆ transformAffine() [2/3]

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.

## ◆ transformAffine() [3/3]

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.

## ◆ volume() [1/3]

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

Calculate the volume of this box.

## ◆ volume() [2/3]

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

Calculate the volume of this box.

## ◆ volume() [3/3]

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

Calculate the volume of this box.

## Member Data Documentation

## ◆ BOX_INFINITE

static const ArrayAabb Ogre::ArrayAabb::BOX_INFINITE
| static

Referenced by distance().

## ◆ BOX_ZERO

static const ArrayAabb Ogre::ArrayAabb::BOX_ZERO
| static

Referenced by distance().

## ◆ mCenter

ArrayVector3 Ogre::ArrayAabb::mCenter

Referenced by ArrayAabb(), getAsAabb(), setAll(), and setFromAabb().

## ◆ mHalfSize

ArrayVector3 Ogre::ArrayAabb::mHalfSize

Referenced by ArrayAabb(), and setAll().

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

- C/OgreArrayAabb.h
- NEON/Single/OgreArrayAabb.h
- SSE2/Single/OgreArrayAabb.h