Panda3D
|
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 ¢er, 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 |
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.
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 84 of file physxBounds3.cxx.
void PhysxBounds3::combine | ( | const PhysxBounds3 & | b2 | ) |
Sets this to the union of this and b2.
Definition at line 99 of file physxBounds3.cxx.
bool PhysxBounds3::contain | ( | const LPoint3f & | p | ) | const |
Returns TRUE if these bounds contain the point v.
Definition at line 108 of file physxBounds3.cxx.
void PhysxBounds3::fatten | ( | float | distance | ) |
Fattens the AABB in all three dimensions by the given distance.
Definition at line 119 of file physxBounds3.cxx.
LPoint3f PhysxBounds3::get_center | ( | ) | const |
Returns the center of the bounding box.
Definition at line 38 of file physxBounds3.cxx.
References PhysxManager::nxVec3_to_point3().
LVector3f PhysxBounds3::get_dimensions | ( | ) | const |
Returns the extents of the bounding box.
Definition at line 49 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 20 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 29 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 128 of file physxBounds3.cxx.
bool PhysxBounds3::intersects | ( | const PhysxBounds3 & | b | ) | const |
Returns TRUE if the intersection of this and b is is not empty.
Definition at line 138 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 148 of file physxBounds3.cxx.
bool PhysxBounds3::is_empty | ( | ) | const |
Returns TRUE if the bounding box is empty.
Definition at line 157 of file physxBounds3.cxx.
void PhysxBounds3::scale | ( | float | scale | ) |
Scales the AABB by the given factor.
Definition at line 166 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 175 of file physxBounds3.cxx.
void PhysxBounds3::set_center_extents | ( | const LPoint3f & | center, |
const LVector3f & | extents | ||
) |
Setup this AABB from center point and extents vector.
Definition at line 188 of file physxBounds3.cxx.
void PhysxBounds3::set_empty | ( | ) |
Sets empty to TRUE.
Definition at line 201 of file physxBounds3.cxx.
void PhysxBounds3::set_infinite | ( | ) |
Sets infinite bounds.
Definition at line 210 of file physxBounds3.cxx.
void PhysxBounds3::set_max | ( | LPoint3f | value | ) |
Sets the maximum corner of the bounding box.
Definition at line 60 of file physxBounds3.cxx.
void PhysxBounds3::set_min | ( | LPoint3f | value | ) |
Sets the minimum corner of the bounding box.
Definition at line 71 of file physxBounds3.cxx.
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 221 of file physxBounds3.cxx.