Panda3D
Public Member Functions | Public Attributes | List of all members
PhysxBounds3 Class Reference

Represention of a axis aligned bounding box. More...

#include "physxBounds3.h"

Public Member Functions

void bounds_of_obb (const LMatrix3f &orientation, const LPoint3f &translation, const LVector3f &half_dims)
 Sets this to the AABB (axis ligned bounding box) of the OBB (oriented bounding box). More...
 
void combine (const PhysxBounds3 &b2)
 Sets this to the union of this and b2. More...
 
bool contain (const LPoint3f &p) const
 Returns TRUE if these bounds contain the point v. More...
 
void fatten (float distance)
 Fattens the AABB in all three dimensions by the given distance. More...
 
LPoint3f get_center () const
 Returns the center of the bounding box. More...
 
LVector3f get_dimensions () const
 Returns the extents of the bounding box. More...
 
LPoint3f get_max () const
 Returns the minimum corner of the bounding box. More...
 
LPoint3f get_min () const
 Returns the maximum corner of the bounding box. More...
 
void include (const LPoint3f &v)
 Expands the volume to include the point v. More...
 
bool intersects (const PhysxBounds3 &b) const
 Returns TRUE if the intersection of this and b is is not empty. More...
 
bool intersects2d (const PhysxBounds3 &b, unsigned axis_to_ignore) const
 Indicates whether the intersection of this and b is empty or not in the plane orthogonal to the axis passed (X = 0, Y = 1 or Z = 2). More...
 
bool is_empty () const
 Returns TRUE if the bounding box is empty. More...
 
void scale (float scale)
 Scales the AABB by the given factor. More...
 
void set (const LPoint3f &min, const LPoint3f &max)
 Setup this AABB from minimum corner and maximum corner. More...
 
void set_center_extents (const LPoint3f &center, const LVector3f &extents)
 Setup this AABB from center point and extents vector. More...
 
void set_empty ()
 Sets empty to TRUE. More...
 
void set_infinite ()
 Sets infinite bounds. More...
 
void set_max (LPoint3f value)
 Sets the maximum corner of the bounding box. More...
 
void set_min (LPoint3f value)
 Sets the minimum corner of the bounding box. More...
 
void transform (const LMatrix3f &orientation, const LPoint3f &translation)
 Transforms this volume as if it was an axis aligned bounding box, and then assigns the results' bounds to this. More...
 

Public Attributes

NxBounds3 _bounds
 

Detailed Description

Represention of a axis aligned bounding box.

The box is stored as minimum and maximum extent corners. Alternate representation would be center and dimensions. May be empty or nonempty. If not empty, min <= max has to hold.

Definition at line 29 of file physxBounds3.h.

Member Function Documentation

◆ bounds_of_obb()

void PhysxBounds3::bounds_of_obb ( const LMatrix3f &  orientation,
const LPoint3f &  translation,
const LVector3f &  half_dims 
)

Sets this to the AABB (axis ligned bounding box) of the OBB (oriented bounding box).

The OBB is described by orientation, translation and half dimensions.

Definition at line 85 of file physxBounds3.cxx.

◆ combine()

void PhysxBounds3::combine ( const PhysxBounds3 b2)

Sets this to the union of this and b2.

Definition at line 100 of file physxBounds3.cxx.

◆ contain()

bool PhysxBounds3::contain ( const LPoint3f &  p) const

Returns TRUE if these bounds contain the point v.

Definition at line 109 of file physxBounds3.cxx.

◆ fatten()

void PhysxBounds3::fatten ( float  distance)

Fattens the AABB in all three dimensions by the given distance.

Definition at line 120 of file physxBounds3.cxx.

◆ get_center()

LPoint3f PhysxBounds3::get_center ( ) const

Returns the center of the bounding box.

Definition at line 39 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_point3().

◆ get_dimensions()

LVector3f PhysxBounds3::get_dimensions ( ) const

Returns the extents of the bounding box.

Definition at line 50 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_vec3().

◆ get_max()

LPoint3f PhysxBounds3::get_max ( ) const

Returns the minimum corner of the bounding box.

Definition at line 21 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_point3().

◆ get_min()

LPoint3f PhysxBounds3::get_min ( ) const

Returns the maximum corner of the bounding box.

Definition at line 30 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_point3().

◆ include()

void PhysxBounds3::include ( const LPoint3f &  v)

Expands the volume to include the point v.

Definition at line 129 of file physxBounds3.cxx.

◆ intersects()

bool PhysxBounds3::intersects ( const PhysxBounds3 b) const

Returns TRUE if the intersection of this and b is is not empty.

Definition at line 139 of file physxBounds3.cxx.

◆ intersects2d()

bool PhysxBounds3::intersects2d ( const PhysxBounds3 b,
unsigned  axis_to_ignore 
) const

Indicates whether the intersection of this and b is empty or not in the plane orthogonal to the axis passed (X = 0, Y = 1 or Z = 2).

Definition at line 149 of file physxBounds3.cxx.

◆ is_empty()

bool PhysxBounds3::is_empty ( ) const

Returns TRUE if the bounding box is empty.

Definition at line 158 of file physxBounds3.cxx.

◆ scale()

void PhysxBounds3::scale ( float  scale)

Scales the AABB by the given factor.

Definition at line 167 of file physxBounds3.cxx.

◆ set()

void PhysxBounds3::set ( const LPoint3f &  min,
const LPoint3f &  max 
)

Setup this AABB from minimum corner and maximum corner.

Definition at line 176 of file physxBounds3.cxx.

◆ set_center_extents()

void PhysxBounds3::set_center_extents ( const LPoint3f &  center,
const LVector3f &  extents 
)

Setup this AABB from center point and extents vector.

Definition at line 189 of file physxBounds3.cxx.

◆ set_empty()

void PhysxBounds3::set_empty ( )

Sets empty to TRUE.

Definition at line 202 of file physxBounds3.cxx.

◆ set_infinite()

void PhysxBounds3::set_infinite ( )

Sets infinite bounds.

Definition at line 211 of file physxBounds3.cxx.

◆ set_max()

void PhysxBounds3::set_max ( LPoint3f  value)

Sets the maximum corner of the bounding box.

Definition at line 61 of file physxBounds3.cxx.

◆ set_min()

void PhysxBounds3::set_min ( LPoint3f  value)

Sets the minimum corner of the bounding box.

Definition at line 72 of file physxBounds3.cxx.

◆ transform()

void PhysxBounds3::transform ( const LMatrix3f &  orientation,
const LPoint3f &  translation 
)

Transforms this volume as if it was an axis aligned bounding box, and then assigns the results' bounds to this.

The orientation is applied first, then the translation.

Definition at line 222 of file physxBounds3.cxx.


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