Changeset 13041 for OpenSceneGraph/trunk/include/osgSim/BlinkSequence
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osgSim/BlinkSequence (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgSim/BlinkSequence
r11438 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 37 37 38 38 META_Object(osgSim,SequenceGroup); 39 39 40 40 inline void setBaseTime( double t ) { _baseTime = t; } 41 41 inline double getBaseTime() const { return _baseTime; } … … 81 81 inline void setPhaseShift(double ps) { _phaseShift = ps; } 82 82 83 /** get the pahse shift.*/ 83 /** get the pahse shift.*/ 84 84 inline double getPhaseShift() const { return _phaseShift; } 85 85 … … 89 89 /** compute the color for the time interval sepecifed. Averages the colors if the length is greater than the current pulse.*/ 90 90 inline osg::Vec4 color(double time,double length) const; 91 91 92 92 93 93 protected: … … 96 96 typedef std::pair<double,osg::Vec4> IntervalColor; 97 97 typedef std::vector<IntervalColor> PulseData; 98 98 99 99 double _pulsePeriod; 100 100 double _phaseShift; … … 146 146 } 147 147 148 // if time interval fits inside the current pulse 148 // if time interval fits inside the current pulse 149 149 // then simply return this pulses color value. 150 150 if (lt+length<=itr->first) … … 175 175 color += itr->second*len; 176 176 177 // normalise the time waited color. 177 // normalise the time waited color. 178 178 color /= length; 179 179
