#include <TAPsBoundingVolume.hpp>


Public Member Functions | |
| BoundingVolume (const BoundingVolume< T > &orig) | |
| Copy Constructor. | |
| BoundingVolume (Enum::CD type, int id) | |
| BoundingVolume (Enum::CD type) | |
| Constructor(s) and Destructor. | |
| virtual void | CalAndSetPhysicsCenterOfMass () |
| virtual void | GetCenter (T &x, T &y, T &z) const |
| virtual Vector3< T > | GetCenter () const |
| Get/Set Generic Bounding Volume. | |
| virtual T | GetHeight () const |
| int | GetID () const |
| std::string const & | GetName () const |
| virtual T | GetRadius () const |
| TransformationSupport< T > & | GetTransform () |
| Get Transformation. | |
| TransformationSupport< T > const & | GetTransform () const |
| Get Transformation. | |
| Enum::CD | GetType () const |
| BoundingVolume< T > & | operator= (BoundingVolume< T > const &orig) |
| virtual void | ScaledBy (T val)=0 |
| virtual void | SetCenter (T x, T y, T z) |
| virtual void | SetCenter (Vector3< T > const ¢er) |
| virtual void | SetHeight (T height) |
| void | SetID (int id) |
| void | SetName (std::string const &name) |
| virtual void | SetRadius (T radius) |
| void | SetTransform (TransformationSupport< T > const &trx) |
| Set Transformation. | |
| virtual std::string | StrInfo () const |
| Return this object info as a string. | |
| virtual T | TestOverlapWith (BoundingVolume< T > const *const that) const =0 |
| virtual bool | TestPointLocation (Vector3< T > const *const pvPoint, TransformationSupport< T > const *const pTransform, Vector3< T > *const pvDistance=NULL) const =0 |
| Test if a point is inside this bounding volume. | |
| virtual bool | TestPointLocation (Vector3< T > const *const pvPoint, Vector3< T > *const pvDistance=NULL) const =0 |
| Test if a point is inside this bounding volume. | |
| virtual | ~BoundingVolume () |
Protected Attributes | |
| Enum::CD | m_eType |
| type identifier (see TAPsEnumList.hpp) | |
| int | m_iID |
| ID. | |
| std::string | m_strName |
| name | |
| TransformationSupport< T > | m_Transform |
| Vector3< T > | m_vCenter |
| Center. | |
Static Protected Attributes | |
| static int | m_iTotal = 0 |
| total number of models | |
Friends | |
| std::ostream & | operator<< (std::ostream &output, BoundingVolume< T > const &obj) |
Definition at line 27 of file TAPsBoundingVolume.hpp.
| BoundingVolume< T >::BoundingVolume | ( | Enum::CD | type | ) | [inline] |
Constructor(s) and Destructor.
Definition at line 23 of file TAPsBoundingVolume.cpp.
00024 : PhysicsSupport<T>(), 00025 m_eType( type ), 00026 m_iID( m_iTotal ), 00027 m_strName( "" ) 00028 { 00029 ++m_iTotal; 00030 }
| BoundingVolume< T >::BoundingVolume | ( | Enum::CD | type, | |
| int | id | |||
| ) | [inline] |
Definition at line 33 of file TAPsBoundingVolume.cpp.
00034 : PhysicsSupport<T>(), 00035 m_eType( type ), 00036 m_iID( id ), 00037 m_strName( "" ) 00038 { 00039 ++m_iTotal; 00040 }
| BoundingVolume< T >::BoundingVolume | ( | const BoundingVolume< T > & | orig | ) | [inline] |
Copy Constructor.
Definition at line 43 of file TAPsBoundingVolume.cpp.
00044 : PhysicsSupport<T>(), 00045 m_eType( orig.m_eType ), 00046 m_iID( orig.m_iID ), 00047 m_strName( orig.m_strName ), 00048 m_Transform( orig.m_Transform ) 00049 { 00050 ++m_iTotal; 00051 }
| BoundingVolume< T >::~BoundingVolume | ( | ) | [inline, virtual] |
| virtual void BoundingVolume< T >::CalAndSetPhysicsCenterOfMass | ( | ) | [inline, virtual] |
Calculate and set the center of mass. Inherited from class TransformationSupport.
Implements PhysicsSupport< T >.
Definition at line 54 of file TAPsBoundingVolume.hpp.
00055 { SetPhysicsCenterOfMass( GetCenter() ); }
| virtual void BoundingVolume< T >::GetCenter | ( | T & | x, | |
| T & | y, | |||
| T & | z | |||
| ) | const [inline, virtual] |
| virtual Vector3<T> BoundingVolume< T >::GetCenter | ( | ) | const [inline, virtual] |
Get/Set Generic Bounding Volume.
Definition at line 65 of file TAPsBoundingVolume.hpp.
00065 { return m_vCenter; }
| virtual T BoundingVolume< T >::GetHeight | ( | ) | const [inline, virtual] |
| int BoundingVolume< T >::GetID | ( | ) | const [inline] |
| std::string const & BoundingVolume< T >::GetName | ( | ) | const [inline] |
| virtual T BoundingVolume< T >::GetRadius | ( | ) | const [inline, virtual] |
Reimplemented in BoundingCylinder< T >, and BoundingSphere< T >.
Definition at line 69 of file TAPsBoundingVolume.hpp.
| TransformationSupport<T>& BoundingVolume< T >::GetTransform | ( | ) | [inline] |
Get Transformation.
Definition at line 81 of file TAPsBoundingVolume.hpp.
00081 { return m_Transform; }
| TransformationSupport<T> const& BoundingVolume< T >::GetTransform | ( | ) | const [inline] |
Get Transformation.
Definition at line 79 of file TAPsBoundingVolume.hpp.
00079 { return m_Transform; }
| Enum::CD BoundingVolume< T >::GetType | ( | ) | const [inline] |
| BoundingVolume<T>& BoundingVolume< T >::operator= | ( | BoundingVolume< T > const & | orig | ) | [inline] |
| virtual void BoundingVolume< T >::ScaledBy | ( | T | val | ) | [pure virtual] |
Implemented in BoundingCylinder< T >, and BoundingSphere< T >.
| virtual void BoundingVolume< T >::SetCenter | ( | T | x, | |
| T | y, | |||
| T | z | |||
| ) | [inline, virtual] |
| virtual void BoundingVolume< T >::SetCenter | ( | Vector3< T > const & | center | ) | [inline, virtual] |
| virtual void BoundingVolume< T >::SetHeight | ( | T | height | ) | [inline, virtual] |
| void BoundingVolume< T >::SetID | ( | int | id | ) | [inline] |
| void BoundingVolume< T >::SetName | ( | std::string const & | name | ) | [inline] |
| virtual void BoundingVolume< T >::SetRadius | ( | T | radius | ) | [inline, virtual] |
Reimplemented in BoundingCylinder< T >, and BoundingSphere< T >.
Definition at line 70 of file TAPsBoundingVolume.hpp.
| void BoundingVolume< T >::SetTransform | ( | TransformationSupport< T > const & | trx | ) | [inline] |
Set Transformation.
Definition at line 83 of file TAPsBoundingVolume.hpp.
00083 { m_Transform = trx; }
| std::string BoundingVolume< T >::StrInfo | ( | ) | const [inline, virtual] |
Return this object info as a string.
Reimplemented in BoundingCylinder< T >, and BoundingSphere< T >.
Definition at line 61 of file TAPsBoundingVolume.cpp.
00062 { 00063 std::string str = "The Bounding Object Type is "; 00064 switch ( m_eType ) { 00065 case Enum::UNDEFINED_TYPE: 00066 str += "\"UNDEFINED_TYPE\""; 00067 break; 00068 case Enum::BOUNDING_SPHERE: 00069 str += "\"BOUNDING_SPHERE\""; 00070 break; 00071 case Enum::BOUNDING_HALF_SPHERE: 00072 str += "\"BOUNDING_HALF_SPHERE\""; 00073 break; 00074 case Enum::BOUNDING_BOX: 00075 str += "\"BOUNDING_BOX\""; 00076 break; 00077 case Enum::BOUNDING_CYLINDER: 00078 str += "\"BOUNDING_CYLINDER\""; 00079 break; 00080 case Enum::BOUNDING_CONE: 00081 str += "\"BOUNDING_CONE\""; 00082 break; 00083 case Enum::BOUNDING_ELLIPSOID: 00084 str += "\"BOUNDING_ELLIPSOID\""; 00085 break; 00086 case Enum::BOUNDING_HALF_ELLIPSOID: 00087 str += "\"BOUNDING_HALF_ELLIPSOID\""; 00088 break; 00089 case Enum::BOUNDING_CAPSULE: 00090 str += "\"BOUNDING_CAPSULE\""; 00091 break; 00092 case Enum::BOUNDING_POLYTOPE: 00093 str += "\"BOUNDING_POLYTOPE\""; 00094 break; 00095 default: 00096 str += "\nUnrecognized Type!"; 00097 break; 00098 } 00099 str += " of type " + std::string( typeid(T).name() ) + "."; 00100 //------------------------------------------- 00101 // Properties 00102 std::ostringstream ss; 00103 ss << "\n ID: " << m_iID; 00104 ss << "\n Name: \"" << m_strName << "\""; 00105 ss << "\n Trx: " << m_Transform; 00106 ss << "\n Center: " << m_vCenter[0] << ", " << m_vCenter[1] << ", " << m_vCenter[2]; 00107 str += ss.str(); 00108 00109 return str; 00110 }
| virtual T BoundingVolume< T >::TestOverlapWith | ( | BoundingVolume< T > const *const | that | ) | const [pure virtual] |
Implemented in BoundingCylinder< T >, and BoundingSphere< T >.
| virtual bool BoundingVolume< T >::TestPointLocation | ( | Vector3< T > const *const | pvPoint, | |
| TransformationSupport< T > const *const | pTransform, | |||
| Vector3< T > *const | pvDistance = NULL | |||
| ) | const [pure virtual] |
Test if a point is inside this bounding volume.
Test Point Location Fn returns true if the input point (vPoint) location is inside the bounding volume, with TransformationSupport argument apply to the cylinder, and returns false otherwise. vDistance is for returning the shortest vector measuring from the input point to the bounding surface.
Therefore, this fn can be used to tell whether the point is inside or outside the bounding volume and how to move it to the surface of the bounding volume with the shortest distance.
Implemented in BoundingCylinder< T >, and BoundingSphere< T >.
| virtual bool BoundingVolume< T >::TestPointLocation | ( | Vector3< T > const *const | pvPoint, | |
| Vector3< T > *const | pvDistance = NULL | |||
| ) | const [pure virtual] |
Test if a point is inside this bounding volume.
Test Point Location Fn returns true if the input point (vPoint) location is inside the bounding volume and returns false otherwise. vDistance is for returning the shortest vector measuring from the input point to the bounding surface.
Therefore, this fn can be used to tell whether the point is inside or outside the bounding volume and how to move it to the surface of the bounding volume with the shortest distance.
Implemented in BoundingCylinder< T >, and BoundingSphere< T >.
| std::ostream& operator<< | ( | std::ostream & | output, | |
| BoundingVolume< T > const & | obj | |||
| ) | [friend] |
Definition at line 33 of file TAPsBoundingVolume.hpp.
00034 { 00035 output << obj.StrInfo(); 00036 return output; 00037 }
Enum::CD BoundingVolume< T >::m_eType [protected] |
int BoundingVolume< T >::m_iID [protected] |
BEGIN_NAMESPACE_TAPs int BoundingVolume< T >::m_iTotal = 0 [inline, static, protected] |
std::string BoundingVolume< T >::m_strName [protected] |
TransformationSupport<T> BoundingVolume< T >::m_Transform [protected] |
Definition at line 190 of file TAPsBoundingVolume.hpp.
Vector3<T> BoundingVolume< T >::m_vCenter [protected] |
1.5.6