00001 #ifndef TRANSFORMNODE_H 00002 #define TRANSFORMNODE_H 00003 00004 #include "Types.h" 00005 #include "Util.h" 00006 #include "AbstractPropertyContainer.h" 00007 00008 namespace RenderTools { 00009 00010 class TransformNode : public AbstractPropertyContainer { 00011 public: 00012 TransformNode( void ); 00013 00014 static PropertyPtr create( const XMLNodePtr & xml = XMLNodePtr() ); 00015 virtual void createProperties( void ); 00016 virtual const string getTypeName( bool ofComponent = false ) const; 00017 00018 void transform( const Mat4 & global = Mat4() ) ; 00019 virtual void onTransform( const Mat4 & global ); 00020 00021 void setLocal( const Mat4 & matrix ); 00022 const Mat4 & getLocal( void ) const; 00023 Mat4 & getLocal( void ); 00024 const Mat4 & getGlobal( void ) const; 00025 Mat4 & getGlobal( void ); 00026 virtual const Mat4 getGlobal( const RelationalNodePtr root ) const; 00027 void setPreviousLocal( const Mat4 &matrix ); 00028 const Mat4 & getPreviousLocal( void ) const; 00029 Mat4 & getPreviousLocal( void ); 00030 const Mat4 & getPreviousGlobal( void ) const; 00031 Mat4 & getPreviousGlobal( void ); 00032 void setMovement( const Vec3 & v, const Quat & q = Quat(), bool relative = true, bool push = true ); 00033 void setMovement( const Mat4 & matrix, bool relative = true, bool push = true ); 00034 Vec3 getMovement( const Vec3 & global = Vec3(), bool fromPrevious = false ) const; 00035 Vec3 warpVector( const Vec3 & p ) const; 00036 bool needsWarping( const Vec3 & p ) const; 00037 void warp( void ); 00038 void warp( const Vec3 & p ); 00039 void setWarping( bool state, const Vec3 & halfExtent = Vec3() ); 00040 const NAABB & getNAABB( void ) const; 00041 const AABB & getAABB( void ) const; 00042 void setNAABB( const NAABB & box, bool send = true ); 00043 void setAABB( const AABB & box, bool send = true ); 00044 00045 protected: 00046 Mat4 m_local; 00047 Mat4 m_global; 00048 Mat4 m_previousLocal; 00049 Mat4 m_previousGlobal; 00050 bool m_warp; 00051 Vec3 m_warpVector; 00052 NAABB m_naabb; 00053 AABB m_aabb; 00054 }; 00055 00056 };//namespace RenderTools 00057 00058 #endif
1.5.8