Panda3D
Public Member Functions | Public Attributes

PhysxBounds3 Class Reference

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

#include "physxBounds3.h"

List of all members.

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).
void combine (const PhysxBounds3 &b2)
 Sets this to the union of this and b2.
bool contain (const LPoint3f &p) const
 Returns TRUE if these bounds contain the point v.
void fatten (float distance)
 Fattens the AABB in all three dimensions by the given distance.
LPoint3f get_center () const
 Returns the center of the bounding box.
LVector3f get_dimensions () const
 Returns the extents of the bounding box.
LPoint3f get_max () const
 Returns the minimum corner of the bounding box.
LPoint3f get_min () const
 Returns the maximum corner of the bounding box.
void include (const LPoint3f &v)
 Expands the volume to include the point v.
bool intersects (const PhysxBounds3 &b) const
 Returns TRUE if the intersection of this and b is is not empty.
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).
bool is_empty () const
 Returns TRUE if the bounding box is empty.
void scale (float scale)
 Scales the AABB by the given factor.
void set (const LPoint3f &min, const LPoint3f &max)
 Setup this AABB from minimum corner and maximum corner.
void set_center_extents (const LPoint3f &center, const LVector3f &extents)
 Setup this AABB from center point and extents vector.
void set_empty ()
 Sets empty to TRUE.
void set_infinite ()
 Sets infinite bounds.
void set_max (LPoint3f value)
 Sets the maximum corner of the bounding box.
void set_min (LPoint3f value)
 Sets the minimum corner of the bounding box.
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.

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 32 of file physxBounds3.h.


Member Function Documentation

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 101 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), LMatrix3f::is_nan(), PhysxManager::mat3_to_nxMat33(), PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

void PhysxBounds3::combine ( const PhysxBounds3 b2)

Sets this to the union of this and b2.

Definition at line 118 of file physxBounds3.cxx.

bool PhysxBounds3::contain ( const LPoint3f p) const

Returns TRUE if these bounds contain the point v.

Definition at line 129 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), and PhysxManager::point3_to_nxVec3().

void PhysxBounds3::fatten ( float  distance)

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

Definition at line 143 of file physxBounds3.cxx.

LPoint3f PhysxBounds3::get_center ( ) const

Returns the center of the bounding box.

Definition at line 46 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_point3().

LVector3f PhysxBounds3::get_dimensions ( ) const

Returns the extents of the bounding box.

Definition at line 59 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_vec3().

LPoint3f PhysxBounds3::get_max ( ) const

Returns the minimum corner of the bounding box.

Definition at line 24 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_point3().

LPoint3f PhysxBounds3::get_min ( ) const

Returns the maximum corner of the bounding box.

Definition at line 35 of file physxBounds3.cxx.

References PhysxManager::nxVec3_to_point3().

void PhysxBounds3::include ( const LPoint3f v)

Expands the volume to include the point v.

Definition at line 154 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), and PhysxManager::point3_to_nxVec3().

bool PhysxBounds3::intersects ( const PhysxBounds3 b) const

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

Definition at line 167 of file physxBounds3.cxx.

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 180 of file physxBounds3.cxx.

bool PhysxBounds3::is_empty ( ) const

Returns TRUE if the bounding box is empty.

Definition at line 191 of file physxBounds3.cxx.

void PhysxBounds3::scale ( float  scale)

Scales the AABB by the given factor.

Definition at line 202 of file physxBounds3.cxx.

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

Setup this AABB from minimum corner and maximum corner.

Definition at line 214 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), and PhysxManager::point3_to_nxVec3().

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

Setup this AABB from center point and extents vector.

Definition at line 230 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

void PhysxBounds3::set_empty ( )

Sets empty to TRUE.

Definition at line 245 of file physxBounds3.cxx.

void PhysxBounds3::set_infinite ( )

Sets infinite bounds.

Definition at line 256 of file physxBounds3.cxx.

void PhysxBounds3::set_max ( LPoint3f  value)

Sets the maximum corner of the bounding box.

Definition at line 72 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), and PhysxManager::point3_to_nxVec3().

void PhysxBounds3::set_min ( LPoint3f  value)

Sets the minimum corner of the bounding box.

Definition at line 85 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), and PhysxManager::point3_to_nxVec3().

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 270 of file physxBounds3.cxx.

References LVecBase3f::is_nan(), LMatrix3f::is_nan(), PhysxManager::mat3_to_nxMat33(), and PhysxManager::point3_to_nxVec3().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations