Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
C3DTBBox< TYPE > Class Template Reference

The class defines a bounding box using int, float or double. More...

Detailed Description

template<class TYPE>
class C3DTBBox< TYPE >

The class defines a bounding box using int, float or double.

Template Parameters
TYPEcan be int (C3DBBoxI), float (C3DBBox or C3DBBoxF) or double (C3DBBoxD)

#include <3DBBox.h>

Public Member Functions

 C3DTBBox (const C3DTPoint< TYPE > &center, TYPE radius)
 
 C3DTBBox (const C3DTPoint< TYPE > &center, TYPE radiusx, TYPE radiusy, TYPE radiusz)
 
void Reinit ()
 
void InitDone ()
 
void AddPoint (const C3DTPoint< TYPE > &pt)
 
template<class TYPE2 >
 C3DTBBox (const C3DTBBox< TYPE2 > &bbox)
 
template<class TYPE2 >
C3DTBBoxoperator= (const C3DTBBox< TYPE2 > &bbox)
 
bool operator== (const C3DTBBox< TYPE > &bbox) const
 
bool IsInBox (const C3DTPoint< TYPE > &pt, bool strictlyInside=false) const
 <
 
C3DTVector< TYPEGetDiagonal () const
 
double GetDiagonalLength () const
 
double GetRadius () const
 <
 
C3DTBBox< TYPEGetGreaterUniformBBox () const
 <
 
const C3DTPoint< TYPE > & GetMin () const
 
const C3DTPoint< TYPE > & GetMax () const
 
void SetMinMax (const C3DTPoint< TYPE > &min, const C3DTPoint< TYPE > &max)
 
double GetMinLength () const
 
double GetMaxLength () const
 
double GetProjectionDistance (const C3DTPoint< TYPE > &pt)
 
const C3DTPoint< TYPEGetProjection (const C3DTPoint< TYPE > &pt)
 
C3DTPoint< TYPEGetClosestCorner (const C3DTPoint< TYPE > &pt) const
 <
 
bool GetCenter (C3DTPoint< TYPE > &center) const
 
C3DTPoint< TYPEGetCenter () const
 
bool IsNull () const
 
bool IsInitialized () const
 <
 
bool IsValid () const
 Invalid bounding box, means that min is greater than max.
 
void Inflate (TYPE value)
 
void Inflate (const C3DTPoint< TYPE > &vector)
 
void Translate (const C3DTPoint< TYPE > &vector)
 
bool SelfUnion (const C3DTBBox< TYPE > &bbox)
 
C3DTBBox< TYPEUnion (const C3DTBBox< TYPE > &bbox) const
 
bool SelfIntersect (const C3DTBBox< TYPE > &bbox)
 
C3DTBBox< TYPEIntersect (const C3DTBBox< TYPE > &bbox) const
 
void operator*= (const C4x4TMatrix< TYPE > &matrix)
 
bool RayIntersect (const C3DTPoint< TYPE > &orig, const C3DTVector< TYPE > &dir, double &t)
 Return true only if ray intersect the bbox which is in front (otherwise dist < 0).
 
bool RayIntersect (const C3DTPoint< TYPE > &orig, const C3DTVector< TYPE > &dir, C3DTPoint< TYPE > *hitPt=NULL)
 
C3DTBBox< intGetGreaterUniformBBox () const
 

Member Function Documentation

◆ GetClosestCorner()

template<class TYPE >
C3DTPoint< TYPE > C3DTBBox< TYPE >::GetClosestCorner ( const C3DTPoint< TYPE > &  pt) const
inline

<

Returns the closes point of the bbox to the given point

◆ GetGreaterUniformBBox()

template<class TYPE >
C3DTBBox< TYPE > C3DTBBox< TYPE >::GetGreaterUniformBBox ( ) const
inline

<

Returns a bbox with same sizes on X,Y,Z axys. This bbox contains the referenced bbox

◆ GetRadius()

template<class TYPE >
double C3DTBBox< TYPE >::GetRadius ( ) const
inline

<

Returns the radius of the sphere that contains the whole bbox

◆ IsInBox()

template<class TYPE >
bool C3DTBBox< TYPE >::IsInBox ( const C3DTPoint< TYPE > &  pt,
bool  strictlyInside = false 
) const
inline

<

Returns false if box is invalid or NULL, as it is considered as void box. If strictlyInside, the point cannot be on the box plane

◆ IsInitialized()

template<class TYPE >
bool C3DTBBox< TYPE >::IsInitialized ( ) const
inline

<

Useful to know if the bounding box has been computed

◆ IsValid()

template<class TYPE >
bool C3DTBBox< TYPE >::IsValid ( ) const
inline

Invalid bounding box, means that min is greater than max.

If init = false, this only means that bounding box is empty, but it is valid. If min == max, then it is valid but null

◆ RayIntersect()

template<class TYPE >
bool C3DTBBox< TYPE >::RayIntersect ( const C3DTPoint< TYPE > &  orig,
const C3DTVector< TYPE > &  dir,
double t 
)
inline

Return true only if ray intersect the bbox which is in front (otherwise dist < 0).

We can know the contact point using point = orig+dir*t Note: RayIntersect might be called with the negation of a vector. In that case, 0.0 value is supposed to be always position 0 (+0.0), otherwise we can miss an intersection and t will be negative and it should be positive


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