Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

physicsnode.h

Go to the documentation of this file.
00001 /***************************************************************************
00002             physicsnode.h  -  Base node class for physics simulation
00003                              -------------------
00004     begin                : Sat Jan 3 2004
00005     copyright            : (C) 2004 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, physicsnode.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2004
00023  Reality Rift Studios. All Rights Reserved.
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

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5