Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/Interpolator
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/Interpolator
r5328 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 */ … … 32 32 Interpolator() 33 33 : osg::Object() {} 34 34 35 35 Interpolator(const Interpolator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) 36 36 : osg::Object(copy, copyop) {} 37 37 38 38 virtual const char* libraryName() const { return "osgParticle"; } 39 39 virtual const char* className() const { return "Interpolator"; } 40 40 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Interpolator* >(obj) != 0; } 41 41 42 42 /// Interpolate between floats. Must be overriden in descendant classes. 43 virtual float interpolate(float t, float y1, float y2) const = 0; 44 43 virtual float interpolate(float t, float y1, float y2) const = 0; 44 45 45 /// Interpolate between 2-dimensional vectors. Default behavior is to interpolate each component separately. 46 46 virtual osg::Vec2 interpolate(float t, const osg::Vec2& y1, const osg::Vec2& y2) const … … 61 61 ); 62 62 } 63 63 64 64 /// Interpolate between 4-dimensional vectors. Default behavior is to interpolate each component separately. 65 65 virtual osg::Vec4 interpolate(float t, const osg::Vec4& y1, const osg::Vec4& y2) const … … 72 72 ); 73 73 } 74 74 75 75 template<class ValueType> 76 76 ValueType interpolate(float t, const range<ValueType>& r) const … … 78 78 return interpolate(t, r.minimum, r.maximum); 79 79 } 80 80 81 81 protected: 82 82 virtual ~Interpolator() {}
