00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NEPHYSICSNODE_H
00028 #define __NEPHYSICSNODE_H
00029
00030
00037 #include "base.h"
00038 #include "scenenode.h"
00039
00040 #include <vector>
00041
00042
00043 namespace NeoEngine
00044 {
00045
00046
00051 class NEOENGINE_API PhysicsNodeState
00052 {
00053 public:
00054
00056 Vector3d m_kVelocity;
00057
00059 Vector3d m_kTranslation;
00060
00062 Quaternion m_kRotation;
00063
00066 PhysicsNodeState() {}
00067
00073 PhysicsNodeState( const Vector3d &rkVelocity, const Vector3d &rkTranslation, const Quaternion &rkRotation ) : m_kVelocity( rkVelocity ), m_kTranslation( rkTranslation ), m_kRotation( rkRotation ) {}
00074
00078 PhysicsNodeState( const PhysicsNodeState &rkState ) : m_kVelocity( rkState.m_kVelocity ), m_kTranslation( rkState.m_kTranslation ), m_kRotation( rkState.m_kRotation ) {}
00079
00085 bool operator < ( const PhysicsNodeState &rkState ) const { return( false ); }
00086
00092 bool operator == ( const PhysicsNodeState &rkState ) const { return( ( m_kVelocity == rkState.m_kVelocity ) && ( m_kTranslation == rkState.m_kTranslation ) && ( m_kRotation == rkState.m_kRotation ) ); }
00093 };
00094
00095
00096 #ifdef WIN32
00097 # ifdef _MSC_VER
00098 # pragma warning( disable : 4231 )
00099 # endif
00100 # ifndef __HAVE_VECTOR_NEPHYSICSNODESTATEOBJ
00101 UDTVectorEXPIMP( PhysicsNodeState );
00102 # define __HAVE_VECTOR_NEPHYSICSNODESTATEOBJ
00103 # endif
00104 #endif
00105
00106
00112 class NEOENGINE_API PhysicsNode : public SceneNode
00113 {
00114 public:
00115
00116 DefineVisitable();
00117
00118
00119 private:
00120
00122 std::vector< PhysicsNodeState > m_vkStateStack;
00123
00124
00125 protected:
00126
00128 Vector3d m_kVelocity;
00129
00130
00131
00132 public:
00133
00136 PhysicsNode();
00137
00140 virtual ~PhysicsNode();
00141
00146 inline void SetVelocity( const Vector3d &rkVelocity ) { m_kVelocity = rkVelocity; }
00147
00151 inline const Vector3d &GetVelocity() const { return m_kVelocity; }
00152
00157 virtual SceneNode *Duplicate();
00158
00163 virtual void Update( float fDeltaTime );
00164
00168 virtual void PushState();
00169
00174 virtual void PopState( bool bSet = true );
00175
00179 virtual void ClearState();
00180
00181 };
00182
00183
00184 };
00185
00186
00187 #endif