![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsPointMassDynamicWithQuaternionRotation.hpp 00003 ******************************************************************************/ 00012 /****************************************************************************** 00013 SUKITTI PUNAK (08/12/2010) 00014 UPDATE (09/21/2010) 00015 ******************************************************************************/ 00016 #ifndef TAPs_POINT_MASS_DYNAMIC_WITH_QUATERNION_ROTATION_HPP 00017 #define TAPs_POINT_MASS_DYNAMIC_WITH_QUATERNION_ROTATION_HPP 00018 00019 #include "TAPsPointMassDynamic.hpp" 00020 #include "../Core/TAPsQuaternion.hpp" 00021 00022 BEGIN_NAMESPACE_TAPs 00023 //============================================================================= 00024 template <typename T> 00025 class PointMassDynamicWithQuaternionRotation : public /*virtual*/ PointMassDynamic<T> { 00026 //============================================================================= 00027 //----------------------------------------------------------------------------- 00028 // Friend Function 00029 friend std::ostream & operator<< ( std::ostream &output, PointMassDynamicWithQuaternionRotation<T> const &P ) 00030 { 00031 return output << P.StrInfo(); 00032 } 00033 //----------------------------------------------------------------------------- 00034 00035 //============================================================================= 00036 public: 00037 // Member Functions ------------------------------------------------------- 00038 00040 PointMassDynamicWithQuaternionRotation ( bool bRandomValue = false ); 00041 00043 PointMassDynamicWithQuaternionRotation ( 00044 T mass, 00045 T radius = 1, 00046 Vector3<T> const & position = ZeroVector, 00047 Vector3<T> const & velocity = ZeroVector, 00048 Vector3<T> const & acceleration = ZeroVector, 00049 Vector3<T> const & force = ZeroVector, 00050 Quaternion<T> const & rotation = Quaternion<T>(), 00051 DS::SimulationFlags const & flags = DS::SimulationFlags() 00052 ); 00053 00055 PointMassDynamicWithQuaternionRotation ( Vector3<T> const & location ); 00056 00058 PointMassDynamicWithQuaternionRotation ( T const location[3] ); 00059 00061 PointMassDynamicWithQuaternionRotation ( T locX, T locY, T locZ ); 00062 00064 PointMassDynamicWithQuaternionRotation ( PointMassDynamicWithQuaternionRotation<T> const & P ); 00065 00067 ~PointMassDynamicWithQuaternionRotation (); 00068 00070 virtual std::string StrInfo () const; 00071 00073 inline virtual void DefaultValues (); 00074 00076 inline virtual void RandomValues (); 00077 00078 //------------------------------------------------------------------------- 00079 // Assignment Operator 00080 PointMassDynamicWithQuaternionRotation<T> const & operator= ( PointMassDynamicWithQuaternionRotation<T> const & P ); 00081 00082 //------------------------------------------------------------------------- 00083 // Get/Set Functions 00084 00085 // Physics Properties ------------------------------------------- 00087 inline Quaternion<T> const & GetQuaternionRotation () const; 00089 inline Quaternion<T> & GetQuaternionRotation (); 00091 inline void SetQuaternionRotation ( Quaternion<T> const & rotation ); 00093 inline void SetQuaternionRotation ( T r, T i, T j, T k ); 00094 00095 //------------------------------------------------------------------------- 00096 // Data Members ----------------------------------------------------------- 00097 //============================================================================= 00098 protected: 00099 // Member Functions ------------------------------------------------------- 00100 // Data Members ----------------------------------------------------------- 00101 // Physics Properties ------------------------------------------- 00102 Quaternion<T> m_QuaternionRotation; 00103 //============================================================================= 00104 private: 00105 // Member Functions ------------------------------------------------------- 00106 // Data Members ----------------------------------------------------------- 00107 //============================================================================= 00108 #if defined(__gl_h_) || defined(__GL_H__) 00109 public: 00111 virtual void Draw () const; 00113 virtual void Draw ( T scale ) const; 00114 #endif 00115 //============================================================================= 00116 }; // END CLASS PointMassDynamicWithQuaternionRotation 00117 //============================================================================= 00118 END_NAMESPACE_TAPs 00119 //----------------------------------------------------------------------------- 00120 #include "TAPsPointMassDynamicWithQuaternionRotation.cpp" 00121 //----------------------------------------------------------------------------- 00122 #endif 00123 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00124 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----