Helios++
Helios software for LiDAR simulations
|
Class representing an Axis Aligned Bounding Box (AABB) More...
#include <AABB.h>
Public Member Functions | |
AABB ()=default | |
Default constructor for axis aligned bounding box. | |
AABB (glm::dvec3 min, glm::dvec3 max) | |
Build an axis aligned bounding box through min and max values for each coordinate. More... | |
AABB (double const ax, double const ay, double const az, double const bx, double const by, double const bz) | |
Build an axis aligned bounding box through given points \(a\) and \(b\) which are the minimum and maximum vertex of the axis aligned bounding box respectively. More... | |
~AABB () override=default | |
Default destructor for axis aligned bounding box. | |
Primitive * | clone () override |
Generate a clone of the primitive. More... | |
void | _clone (Primitive *p) override |
Assist clone function. More... | |
glm::dvec3 const & | getMin () const |
Get the min value for each coordinate of the axis aligned bounding box. More... | |
glm::dvec3 const & | getMax () const |
Get the max value for each coordinate of the axis aligned bounding box. More... | |
AABB * | getAABB () override |
Obtain this axis aligned bounding box. More... | |
glm::dvec3 | getCentroid () override |
Get the centroid of the axis aligned bounding box. More... | |
double | getIncidenceAngle_rad (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir, const glm::dvec3 &intersectionPoint) override |
std::vector< double > | getRayIntersection (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override |
double | getRayIntersectionDistance (const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override |
size_t | getNumVertices () override |
Vertex * | getVertices () override |
void | update () override |
glm::dvec3 | getSize () |
Obtain size along each axis for the axis aligned bounding box. More... | |
std::string | toString () |
Bbuild a string representing the axis aligned bounding box. More... | |
![]() | |
virtual void | onFinishLoading (NoiseSource< double > &uniformNoiseSource) |
Method to be triggered once all Primitives have been loaded. More... | |
virtual size_t | getNumFullVertices () |
Obtain the number of vertices returned by the getFullVertices function. More... | |
virtual Vertex * | getFullVertices () |
Obtain full vertices for the primitive. More... | |
virtual double | getGroundZOffset () |
Offset for ground point z coordinate. More... | |
virtual bool | canHandleIntersections () |
Specify if the primitive can handle intersections or not. More... | |
virtual IntersectionHandlingResult | onRayIntersection (NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity) |
Handle ray intersections. More... | |
virtual void | rotate (Rotation &r) |
Performs rotation over primitive. More... | |
virtual void | scale (double const factor) |
Scale primitive by given factor. More... | |
virtual void | translate (glm::dvec3 const &shift) |
Translate primitive by given shift. More... | |
virtual bool | canComputeSigmaWithLadLut () |
Check if primitive can compute sigma using LadLut or not. More... | |
virtual double | computeSigmaWithLadLut (glm::dvec3 const &direction) |
Compute sigma using LadLut. More... | |
Static Public Member Functions | |
static std::shared_ptr< AABB > | getForPrimitives (std::vector< Primitive * > &primitives) |
Build an axis aligned bounding box containing given primitives. More... | |
static std::shared_ptr< AABB > | getForVertices (std::vector< Vertex > &verts) |
Build an axis aligned bounding box containing given vertices. More... | |
static std::shared_ptr< AABB > | getForVertices (std::unordered_set< Vertex *, VertexKeyHash, VertexKeyEqual > &verts) |
Build an axis aligned bounding box containing given vertices. More... | |
Public Attributes | |
Vertex | vertices [2] |
Vertices defining the axis aligned bounding box. More... | |
glm::dvec3 | bounds [2] |
Cached bounds to speed-up intersection computation. | |
![]() | |
std::shared_ptr< ScenePart > | part = nullptr |
Shared pointer to the scene part the primitive belongs to. More... | |
std::shared_ptr< Material > | material = nullptr |
Shared pointer to the material defining certain properties such as reflectance, specularity, ... More... | |
Private Member Functions | |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize an axis-aligned bounding box to a stream of bytes. More... | |
Friends | |
class | boost::serialization::access |
Class representing an Axis Aligned Bounding Box (AABB)
AABB::AABB | ( | glm::dvec3 | min, |
glm::dvec3 | max | ||
) |
Build an axis aligned bounding box through min and max values for each coordinate.
min | Min value for each 3D coordinate |
max | Max value for each 3D coordinate |
|
inline |
Build an axis aligned bounding box through given points \(a\) and \(b\) which are the minimum and maximum vertex of the axis aligned bounding box respectively.
ax | \(x\) component of the minimum vertex |
ay | \(y\) component of the minimum vertex |
az | \(z\) component of the minimum vertex |
bx | \(x\) component of the maximum vertex |
by | \(y\) component of the maximum vertex |
bz | \(z\) component of the maximum vertex |
|
overridevirtual |
Assist clone function.
p | Pointer to the clone to be updated |
Reimplemented from Primitive.
|
overridevirtual |
Generate a clone of the primitive.
Implements Primitive.
|
overridevirtual |
Obtain this axis aligned bounding box.
Implements Primitive.
|
overridevirtual |
Get the centroid of the axis aligned bounding box.
Implements Primitive.
Build an axis aligned bounding box containing given primitives.
primitives | Primitives to build axis aligned bounding box around |
|
static |
Build an axis aligned bounding box containing given vertices.
verts | Vertices to build axis aligned bounding box around |
Build an axis aligned bounding box containing given vertices.
verts | Vertices to build axis aligned bounding box around |
|
overridevirtual |
Implements Primitive.
|
inline |
Get the max value for each coordinate of the axis aligned bounding box.
|
inline |
Get the min value for each coordinate of the axis aligned bounding box.
|
inlineoverridevirtual |
Reimplemented from Primitive.
|
overridevirtual |
Implements Primitive.
|
overridevirtual |
Implements Primitive.
glm::dvec3 AABB::getSize | ( | ) |
Obtain size along each axis for the axis aligned bounding box.
|
overridevirtual |
Implements Primitive.
|
inlineprivate |
Serialize an axis-aligned bounding box to a stream of bytes.
Archive | Type of rendering |
ar | Specific rendering for the stream of bytes |
version | Version number for the axis-aligned bounding box |
string AABB::toString | ( | ) |
Bbuild a string representing the axis aligned bounding box.
|
inlineoverridevirtual |
Implements Primitive.
Vertex AABB::vertices[2] |
Vertices defining the axis aligned bounding box.
The first vertex represents the minimum boundaries while the second one represents the maximum boundaries