OpenSceneGraph 3.6.5
LinearInterpolator
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13//osgParticle - Copyright (C) 2002 Marco Jez
14
15#ifndef OSGPARTICLE_LINEARINTERPOLATOR
16#define OSGPARTICLE_LINEARINTERPOLATOR
17
19
20#include <osg/CopyOp>
21#include <osg/Object>
22#include <osg/Vec3>
23#include <osg/Vec4>
24
25namespace osgParticle
26{
27
30 {
31 public:
34
36 : Interpolator(copy, copyop) {}
37
39
40 virtual float interpolate(float t, float y1, float y2) const
41 {
42 return y1 + (y2 - y1) * t;
43 }
44
45 virtual osg::Vec2 interpolate(float t, const osg::Vec2& y1, const osg::Vec2& y2) const
46 {
47 return y1 + (y2 - y1) * t;
48 }
49
50 virtual osg::Vec3 interpolate(float t, const osg::Vec3& y1, const osg::Vec3& y2) const
51 {
52 return y1 + (y2 - y1) * t;
53 }
54
55 virtual osg::Vec4 interpolate(float t, const osg::Vec4& y1, const osg::Vec4& y2) const
56 {
57 return y1 + (y2 - y1) * t;
58 }
59
60 protected:
62 };
63
64}
65
66#endif
Vec2f Vec2
Definition Vec2:21
Vec3f Vec3
Definition Vec3:21
Vec4f Vec4
Definition Vec4:21
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Interpolator()
Definition Interpolator:32
virtual osg::Vec2 interpolate(float t, const osg::Vec2 &y1, const osg::Vec2 &y2) const
Interpolate between 2-dimensional vectors. Default behavior is to interpolate each component separate...
Definition LinearInterpolator:45
LinearInterpolator(const LinearInterpolator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition LinearInterpolator:35
virtual osg::Vec4 interpolate(float t, const osg::Vec4 &y1, const osg::Vec4 &y2) const
Interpolate between 4-dimensional vectors. Default behavior is to interpolate each component separate...
Definition LinearInterpolator:55
META_Object(osgParticle, LinearInterpolator)
virtual ~LinearInterpolator()
Definition LinearInterpolator:61
virtual float interpolate(float t, float y1, float y2) const
Interpolate between floats. Must be overridden in descendant classes.
Definition LinearInterpolator:40
virtual osg::Vec3 interpolate(float t, const osg::Vec3 &y1, const osg::Vec3 &y2) const
Interpolate between 3-dimensional vectors. Default behavior is to interpolate each component separate...
Definition LinearInterpolator:50
LinearInterpolator()
Definition LinearInterpolator:32

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.