nswingshapenode.h
Go to the documentation of this file.00001 #ifndef N_SWINGSHAPENODE_H 00002 #define N_SWINGSHAPENODE_H 00003 //------------------------------------------------------------------------------ 00013 #include "scene/nshapenode.h" 00014 #include "variable/nvariable.h" 00015 00016 //------------------------------------------------------------------------------ 00017 class nSwingShapeNode : public nShapeNode 00018 { 00019 public: 00021 nSwingShapeNode(); 00023 virtual ~nSwingShapeNode(); 00025 virtual bool SaveCmds(nPersistServer* ps); 00027 virtual bool LoadResources(); 00029 virtual void UnloadResources(); 00031 virtual int GetMeshUsage() const; 00033 virtual bool ApplyShader(nSceneServer* sceneServer); 00035 virtual bool RenderShader(nSceneServer* sceneServer, nRenderContext* renderContext); 00037 void SetSwingAngle(float f); 00039 float GetSwingAngle() const; 00041 void SetSwingTime(float t); 00043 float GetSwingTime() const; 00044 00045 private: 00047 float ComputeAngle(const vector3& pos, nTime time) const; 00048 00049 nVariable::Handle timeVarHandle; 00050 nVariable::Handle windVarHandle; 00051 float swingAngle; 00052 float swingTime; 00053 }; 00054 00055 //------------------------------------------------------------------------------ 00058 inline 00059 void 00060 nSwingShapeNode::SetSwingAngle(float f) 00061 { 00062 this->swingAngle = f; 00063 } 00064 00065 //------------------------------------------------------------------------------ 00068 inline 00069 float 00070 nSwingShapeNode::GetSwingAngle() const 00071 { 00072 return this->swingAngle; 00073 } 00074 00075 //------------------------------------------------------------------------------ 00078 inline 00079 void 00080 nSwingShapeNode::SetSwingTime(float t) 00081 { 00082 this->swingTime = t; 00083 } 00084 00085 //------------------------------------------------------------------------------ 00088 inline 00089 float 00090 nSwingShapeNode::GetSwingTime() const 00091 { 00092 return this->swingTime; 00093 } 00094 00095 //------------------------------------------------------------------------------ 00096 #endif