Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor::BoundingBox Class Reference

#include <BoundingBox.hpp>

Inheritance diagram for castor::BoundingBox:
Inheritance graph
[legend]
Collaboration diagram for castor::BoundingBox:
Collaboration graph
[legend]

Public Member Functions

CU_API BoundingBox ()=default
 
CU_API BoundingBox (Point3f const &min, Point3f const &max)
 Constructor from min and max extents.
 
CU_API BoundingBox getUnion (BoundingBox const &bb) const
 Computes the bounding box resulting of the union of this bounding box and given one.
 
CU_API bool isWithin (Point3f const &point) const override
 Tests if a vertex is within the container, id est inside it but not on it's limits.
 
CU_API bool isOnLimits (Point3f const &point) const override
 Tests if a vertex is on the limits of this container, and not within.
 
CU_API void load (Point3f const &min, Point3f const &max)
 Reinitialises the combo box to the given limits.
 
CU_API BoundingBox getAxisAligned (Matrix4x4f const &transformations) const
 Retrieves the axis aligned cube box for given tranformations.
 
CU_API Point3f getPositiveVertex (Point3f const &normal) const
 Computes the positive vertex of a direction.
 
CU_API Point3f getNegativeVertex (Point3f const &normal) const
 Computes the negative vertex of a direction.
 
Point3f getMin () const
 
Point3f getMax () const
 
Point3f const & getDimensions () const
 
- Public Member Functions inherited from castor::BoundingContainer< Dimension >
CU_API BoundingContainer ()=default
 
CU_API BoundingContainer (BoundingContainer const &)=default
 
CU_API BoundingContainer (BoundingContainer &&) noexcept=default
 
CU_API BoundingContaineroperator= (BoundingContainer const &)=default
 
CU_API BoundingContaineroperator= (BoundingContainer &&) noexcept=default
 
virtual CU_API ~BoundingContainer () noexcept=default
 
 BoundingContainer (MyPoint center)
 Constructor from center.
 
virtual CU_API bool isWithin (MyPoint const &point) const =0
 Tests if a vertex is within the container, id est inside it but not on it's limits.
 
virtual CU_API bool isOnLimits (MyPoint const &point) const =0
 Tests if a vertex is on the limits of this container, and not within.
 
MyPoint const & getCenter () const
 

Additional Inherited Members

- Public Types inherited from castor::BoundingContainer< Dimension >
using MyPoint = Point< float, Dimension >
 
- Protected Member Functions inherited from castor::BoundingContainer< Dimension >
void setCenter (MyPoint center) noexcept
 

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

CU_API castor::BoundingBox::BoundingBox ( )
default

◆ BoundingBox() [2/2]

CU_API castor::BoundingBox::BoundingBox ( Point3f const & min,
Point3f const & max )

Constructor from min and max extents.

Parameters
[in]minThe min extent.
[in]maxThe max extent.

Member Function Documentation

◆ getAxisAligned()

CU_API BoundingBox castor::BoundingBox::getAxisAligned ( Matrix4x4f const & transformations) const

Retrieves the axis aligned cube box for given tranformations.

Parameters
[in]transformationsThe transformation matrix.

◆ getDimensions()

Point3f const & castor::BoundingBox::getDimensions ( ) const
inline
Returns
The dimensions.

◆ getMax()

Point3f castor::BoundingBox::getMax ( ) const
inline
Returns
The max extent.

References castor::BoundingContainer< Dimension >::getCenter().

Here is the call graph for this function:

◆ getMin()

Point3f castor::BoundingBox::getMin ( ) const
inline
Returns
The min extent.

References castor::BoundingContainer< Dimension >::getCenter().

Here is the call graph for this function:

◆ getNegativeVertex()

CU_API Point3f castor::BoundingBox::getNegativeVertex ( Point3f const & normal) const

Computes the negative vertex of a direction.

Parameters
[in]normalThe direction vector.
Returns
The position of the vertex on the box in the opposite way from the normal, while considering the center.

◆ getPositiveVertex()

CU_API Point3f castor::BoundingBox::getPositiveVertex ( Point3f const & normal) const

Computes the positive vertex of a direction.

See also
getNegativeVertex.
Parameters
[in]normalThe direction vector.
Returns
The position of the vertex on the box in the same way as the normal, while considering the center.

◆ getUnion()

CU_API BoundingBox castor::BoundingBox::getUnion ( BoundingBox const & bb) const

Computes the bounding box resulting of the union of this bounding box and given one.

Parameters
[in]bbThe other bounding box.
Returns
The resulting bounding box.

◆ isOnLimits()

CU_API bool castor::BoundingBox::isOnLimits ( Point3f const & point) const
override

Tests if a vertex is on the limits of this container, and not within.

Parameters
[in]pointThe vertex to test.
Returns
true if the vertex is on the limits of the container, false if not.

◆ isWithin()

CU_API bool castor::BoundingBox::isWithin ( Point3f const & point) const
override

Tests if a vertex is within the container, id est inside it but not on it's limits.

Parameters
[in]pointThe vertex to test.
Returns
true if the vertex is within the container, false if not.

◆ load()

CU_API void castor::BoundingBox::load ( Point3f const & min,
Point3f const & max )

Reinitialises the combo box to the given limits.

Parameters
[in]minThe min extent.
[in]maxThe max extent.

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