Pathfinder
Public Member Functions | Public Attributes | List of all members
Pathfinder::AABB Struct Reference

This struct models an AABB. More...

#include <AABB.h>

Collaboration diagram for Pathfinder::AABB:

Public Member Functions

 AABB ()
 A constructor that creates an object with dummy attributes. More...
 
 AABB (const Geometry::Vec3 &min, const Geometry::Vec3 &max)
 A constructor that creates an AABB out of two vectors. More...
 
bool triNotInAABB (const Polygon *p, const short &component)
 Check whether a polygon definetely lies outside of this AABB. More...
 
bool triInAABB (const Polygon *p)
 Check whether the polygon intersects with this AABB. More...
 
bool pointInAABB (Geometry::Vec3 p)
 Check whether the point lies inside this AABB. More...
 

Public Attributes

Geometry::Vec3 min
 The smallest corner of the AABB. More...
 
Geometry::Vec3 max
 The biggest corner of the AABB. More...
 

Detailed Description

This struct models an AABB.

An AABB is defined to be the volume between the two corners min and max.

Constructor & Destructor Documentation

◆ AABB() [1/2]

Pathfinder::AABB::AABB ( )

A constructor that creates an object with dummy attributes.

The two data members are initialized with two empty Vec3 objects.

◆ AABB() [2/2]

Pathfinder::AABB::AABB ( const Geometry::Vec3 &  min,
const Geometry::Vec3 &  max 
)

A constructor that creates an AABB out of two vectors.

This constructor initializes min and max with the given parameters of the same name.

Parameters
minThe smallest corner of the AABB.
maxThe biggest corner of the AABB.

Member Function Documentation

◆ pointInAABB()

bool Pathfinder::AABB::pointInAABB ( Geometry::Vec3  p)

Check whether the point lies inside this AABB.

Parameters
pThe point that shall be checked.
Returns
Return true if p lies inside the AABB, false otherwise.

◆ triInAABB()

bool Pathfinder::AABB::triInAABB ( const Polygon p)

Check whether the polygon intersects with this AABB.

If triNotInAABB returns true for any component, this function will be false.

Parameters
pThe polygon which is to be checked for intersection.
Returns
Return true if the polygon has the possibility of intersecting with the AABB. Return false if there is no chance of intersection.

◆ triNotInAABB()

bool Pathfinder::AABB::triNotInAABB ( const Polygon p,
const short &  component 
)

Check whether a polygon definetely lies outside of this AABB.

This is the case if the vertices p1, p2 and p3 of p all share a component which is smaller/greater than the corresponding component of min/max.

Parameters
pThe polygon that shall be compared.
componentThe component which is to be examined. x = 0, y = 1, z = 2.
Returns
Return true if such a component exists, false otherwise.

Member Data Documentation

◆ max

Geometry::Vec3 Pathfinder::AABB::max

The biggest corner of the AABB.

◆ min

Geometry::Vec3 Pathfinder::AABB::min

The smallest corner of the AABB.


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