2 #include "ParaVector3.h" 3 #include "ParaMatrix4.h" 48 NEAR_RIGHT_BOTTOM = 7,
58 mExtent = EXTENT_NULL;
83 float mx,
float my,
float mz,
84 float Mx,
float My,
float Mz ) : mpCorners(0)
105 delete [](mpCorners);
144 mExtent = EXTENT_FINITE;
148 inline void setMinimum(
float x,
float y,
float z )
150 mExtent = EXTENT_FINITE;
161 void setMinimumY(
float y);
163 void setMinimumZ(
float z);
169 mExtent = EXTENT_FINITE;
173 inline void setMaximum(
float x,
float y,
float z )
175 mExtent = EXTENT_FINITE;
186 void setMaximumY(
float y );
188 void setMaximumZ(
float z );
195 float mx,
float my,
float mz,
196 float Mx,
float My,
float Mz );
228 friend std::ostream& operator<<( std::ostream& o,
const AxisAlignedBox aab )
233 o <<
"AxisAlignedBox(null)";
237 o <<
"AxisAlignedBox(min=" << aab.mMinimum <<
", max=" << aab.mMaximum <<
")";
240 case EXTENT_INFINITE:
241 o <<
"AxisAlignedBox(infinite)";
245 PE_ASSERT(
false &&
"Never reached" );
Vector3 & getMinimum(void)
Gets a modifiable version of the minimum corner of the box.
Definition: ParaAxisAlignedBox.h:119
bool operator==(const AxisAlignedBox &rhs) const
Tests 2 boxes for equality.
Definition: ParaAxisAlignedBox.cpp:21
void merge(const AxisAlignedBox &rhs)
Merges the passed in box into the current box.
Definition: ParaAxisAlignedBox.cpp:363
float volume(void) const
Calculate the volume of this box.
Definition: ParaAxisAlignedBox.cpp:188
bool isInfinite(void) const
Returns true if the box is infinite.
Definition: ParaAxisAlignedBox.cpp:242
different physics engine has different winding order.
Definition: EventBinding.h:32
A sphere primitive, mostly used for bounds checking.
Definition: ParaSphere.h:46
void setExtents(const Vector3 &min, const Vector3 &max)
Sets both minimum and maximum extents at once.
Definition: ParaAxisAlignedBox.cpp:459
Vector3 getCenter(void) const
Gets the centre of the box.
Definition: ParaAxisAlignedBox.cpp:105
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
Vector3 & getMaximum(void)
Gets a modifiable version of the maximum corner of the box.
Definition: ParaAxisAlignedBox.h:134
const Vector3 * getAllCorners(void) const
Returns a pointer to an array of 8 corner points, useful for collision vs.
Definition: ParaAxisAlignedBox.cpp:417
void transformAffine(const Matrix4 &m)
Transforms the box according to the affine matrix supplied.
Definition: ParaAxisAlignedBox.cpp:267
Vector3 getCorner(CornerEnum cornerToGet) const
gets the position of one of the corners
Definition: ParaAxisAlignedBox.cpp:392
bool intersects(const AxisAlignedBox &b2) const
Returns whether or not this box intersects another.
Definition: ParaAxisAlignedBox.cpp:146
void setMaximumX(float x)
Changes one of the components of the maximum corner of the box used to resize only one dimension of t...
Definition: ParaAxisAlignedBox.cpp:479
bool contains(const Vector3 &v) const
Tests whether the given point contained by this box.
Definition: ParaAxisAlignedBox.cpp:49
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
Defines a plane in 3D space.
Definition: ParaPlane.h:23
void setMaximum(const Vector3 &vec)
Sets the maximum corner of the box.
Definition: ParaAxisAlignedBox.h:167
AxisAlignedBox intersection(const AxisAlignedBox &b2) const
Calculate the area of intersection of this box and another.
Definition: ParaAxisAlignedBox.cpp:210
void scale(const Vector3 &s)
Scales the AABB by the vector given.
Definition: ParaAxisAlignedBox.cpp:176
bool isNull(void) const
Returns true if the box is null i.e.
Definition: ParaAxisAlignedBox.cpp:257
void setNull()
Sets the box to a 'null' value i.e.
Definition: ParaAxisAlignedBox.cpp:262
const Vector3 & getMaximum(void) const
Gets the maximum corner of the box.
Definition: ParaAxisAlignedBox.h:126
void setMinimum(const Vector3 &vec)
Sets the minimum corner of the box.
Definition: ParaAxisAlignedBox.h:142
void transform(const Matrix4 &matrix)
Transforms the box according to the matrix supplied.
Definition: ParaAxisAlignedBox.cpp:287
bool operator!=(const AxisAlignedBox &rhs) const
Tests 2 boxes for inequality.
Definition: ParaAxisAlignedBox.cpp:16
Vector3 getSize(void) const
Gets the size of the box.
Definition: ParaAxisAlignedBox.cpp:83
A 3D box aligned with the x/y/z axes.
Definition: ParaAxisAlignedBox.h:16
bool isFinite(void) const
Returns true if the box is finite.
Definition: ParaAxisAlignedBox.cpp:252
Vector3 getHalfSize(void) const
Gets the half-size of the box.
Definition: ParaAxisAlignedBox.cpp:61
const Vector3 & getMinimum(void) const
Gets the minimum corner of the box.
Definition: ParaAxisAlignedBox.h:111
void setMinimumX(float x)
Changes one of the components of the minimum corner of the box used to resize only one dimension of t...
Definition: ParaAxisAlignedBox.cpp:494
void setInfinite()
Sets the box to 'infinite'.
Definition: ParaAxisAlignedBox.cpp:247