![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtOsgDecalRibbon.h,v $ $Revision: 1.13 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvOsg/vrvOsg.h> 00016 #include <vrvOsg/DtOsgRibbon.h> 00017 00018 namespace osg 00019 { 00020 class DrawElementsUInt; 00021 class Texture; 00022 } 00023 00024 namespace makVrv 00025 { 00030 class DT_DLL_VRVOSG DtOsgDecalRibbon 00031 : public DtOsgRibbon 00032 { 00033 public: 00035 DtOsgDecalRibbon(float segmentSpacing, 00036 const osg::Vec4& color, osg::Texture* tex, float maxLength = 2000); 00037 00040 virtual void setTextureRepeat(float textureRepeat); 00041 00042 protected: 00044 virtual ~DtOsgDecalRibbon(); 00045 00047 virtual void addParticle(const osg::Vec3d & left, const osg::Vec3d & right, 00048 double simTime); 00049 00051 virtual float currentSegmentLength(); 00052 00054 virtual void extendCurrentSegment(osg::Vec3d const& left, 00055 osg::Vec3d const& right, double simTime); 00056 00058 virtual osg::Drawable* getDrawable(); 00059 00061 virtual int particleIndexAtOffset(int offset); 00062 00064 virtual void rotateDrawableIndices(int amount); 00065 00067 virtual osg::Vec2 getTextureCoordinateFor(int pointIndex, float vScale); 00068 00070 virtual osg::Geode* createGeode(); 00071 00072 private: 00073 osg::ref_ptr<osg::Vec3Array> myPoints; 00074 osg::ref_ptr<osg::Vec2Array> myTextureCoordinates; 00075 osg::ref_ptr<osg::DrawElementsUInt> myRibbon; 00076 osg::ref_ptr<osg::Geometry> myGeometry; 00077 osg::ref_ptr<osg::Texture> myTexture; 00078 00079 bool myWrappingVertices; 00080 std::string myTextureFilename; 00081 int myParticleIndex; 00082 float myTextureRepeat; 00083 }; 00084 } 00085