From 290e0b6eedcd81cae2ef03c7c9ed3c9d4248e145 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 10 Oct 2005 09:17:22 +0000 Subject: [PATCH] From Alberto Jaspe, added double precision interpolation method --- include/osg/AnimationPath | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/osg/AnimationPath b/include/osg/AnimationPath index 62b744df8..b5d17aaf3 100644 --- a/include/osg/AnimationPath +++ b/include/osg/AnimationPath @@ -81,6 +81,14 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object _scale = first._scale*one_minus_ratio + second._scale*ratio; } + inline void interpolate(double ratio,const ControlPoint& first, const ControlPoint& second) + { + double one_minus_ratio = 1.0f-ratio; + _position = first._position*one_minus_ratio + second._position*ratio; + _rotation.slerp(ratio,first._rotation,second._rotation); + _scale = first._scale*one_minus_ratio + second._scale*ratio; + } + inline void getMatrix(Matrixf& matrix) const { matrix.makeScale(_scale);