![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtEffectModelInstance.h,v $ $Revision: 1.24 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtEffectModelInstance_H_ 00014 #define DtEffectModelInstance_H_ 00015 00016 #include <vrvOsg/vrvOsg.h> 00017 #include <vrvOsg/DtOsgModelInstance.h> 00018 #include <vrvOsg/DtParticleEffect.h> 00019 #include <vrvOsg/DtOsgRibbon.h> 00020 #include <matrix/vlVector.h> 00021 00022 #include <osg/ref_ptr> 00023 #include <osg/BoundingBox> 00024 00025 namespace osg 00026 { 00027 class Geode; 00028 class Group; 00029 } 00030 00031 namespace makVrv 00032 { 00033 class DtParticleEffect; 00034 class DtOsgRibbon; 00035 class DtOsgSceneConnector; 00036 00039 class DT_DLL_VRVOSG DtEffectModelInstance : public DtOsgModelInstance 00040 { 00041 public: 00042 00043 friend class DtEffectModelInstanceCreator; 00044 00046 virtual ~DtEffectModelInstance(); 00047 00049 virtual void setIntensity(float intensity); 00050 00052 virtual void setScale(float scale); 00053 00055 virtual void setDuration(double seconds); 00056 00058 virtual void setWind(const DtVector& windVector); 00059 00062 virtual void setPosition( const DtVector& position); 00063 00066 virtual bool realize(DtModelDefinition& definition); 00067 00069 virtual void addToConnector( DtOsgSceneConnector* connector ); 00070 00072 virtual bool removeFromConnector( DtOsgSceneConnector* connector ); 00073 00075 virtual void stop(); 00076 00078 virtual void start(); 00079 00081 virtual void pause(); 00082 00083 virtual void resume(); 00084 00085 virtual void setLoopMode(bool loopOn); 00086 00087 virtual void setReverseAnimation(bool reverse); 00088 00090 virtual void setVisible(bool isVisible); 00091 00092 protected: 00093 00095 DtOsgRibbon* createRibbonEffect(const osg::Vec3& pointA, const osg::Vec3& pointB); 00096 DtEffectModelInstance(DtDe& de); 00097 00098 osg::BoundingBox calculateParentExtents(osg::Node* parent); 00099 00101 osg::Node* findFromCache(DtModelDefinition& definition); 00102 00104 osg::ref_ptr<osg::Node> loadNode(const std::string& filenameParam); 00105 00106 osg::ref_ptr<DtParticleEffect> myEffect; 00107 bool myParentIsDynamic; 00108 bool myScaleToParentY; 00109 std::string myDefinition; 00110 osg::ref_ptr<DtOsgRibbon> myRibbon; 00111 DtOsgSceneConnector* mySceneConnector; 00112 }; 00113 00116 class DT_DLL_VRVOSG DtEffectModelInstanceCreator : public DtModelInstanceCreator 00117 { 00118 public: 00119 00121 static void registerCreator(DtDe& de); 00122 00124 virtual ~DtEffectModelInstanceCreator (); 00125 00127 virtual DtModelInstance* create(DtDe& de); 00128 00129 protected: 00130 00131 DtEffectModelInstanceCreator (); 00132 }; 00133 } 00134 00135 #endif 00136