Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
/* -*-c++-*-
|
||||
/* -*-c++-*-
|
||||
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*
|
||||
*
|
||||
* Authors:
|
||||
* Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||
* Michael Platings <mplatings@pixelpower.com>
|
||||
@@ -38,7 +38,7 @@ namespace osgAnimation
|
||||
TemplateInterpolatorBase() : _lastKeyAccess(-1) {}
|
||||
|
||||
void reset() { _lastKeyAccess = -1; }
|
||||
int getKeyIndexFromTime(const TemplateKeyframeContainer<KEY>& keys, double time) const
|
||||
int getKeyIndexFromTime(const TemplateKeyframeContainer<KEY>& keys, double time) const
|
||||
{
|
||||
// todo use a cache
|
||||
int key_size = keys.size();
|
||||
@@ -52,7 +52,7 @@ namespace osgAnimation
|
||||
double time0 = keysVector[i].getTime();
|
||||
double time1 = keysVector[i+1].getTime();
|
||||
|
||||
if ( time >= time0 && time < time1 )
|
||||
if ( time >= time0 && time < time1 )
|
||||
{
|
||||
_lastKeyAccess = i;
|
||||
return i;
|
||||
@@ -70,15 +70,15 @@ namespace osgAnimation
|
||||
public:
|
||||
|
||||
TemplateStepInterpolator() {}
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
{
|
||||
|
||||
if (time >= keyframes.back().getTime())
|
||||
|
||||
if (time >= keyframes.back().getTime())
|
||||
{
|
||||
result = keyframes.back().getValue();
|
||||
return;
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
{
|
||||
result = keyframes.front().getValue();
|
||||
return;
|
||||
@@ -96,20 +96,20 @@ namespace osgAnimation
|
||||
public:
|
||||
|
||||
TemplateLinearInterpolator() {}
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
{
|
||||
|
||||
if (time >= keyframes.back().getTime())
|
||||
|
||||
if (time >= keyframes.back().getTime())
|
||||
{
|
||||
result = keyframes.back().getValue();
|
||||
return;
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
{
|
||||
result = keyframes.front().getValue();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int i = this->getKeyIndexFromTime(keyframes,time);
|
||||
float blend = (time - keyframes[i].getTime()) / ( keyframes[i+1].getTime() - keyframes[i].getTime());
|
||||
const TYPE& v1 = keyframes[i].getValue();
|
||||
@@ -124,14 +124,14 @@ namespace osgAnimation
|
||||
{
|
||||
public:
|
||||
TemplateSphericalLinearInterpolator() {}
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
{
|
||||
if (time >= keyframes.back().getTime())
|
||||
if (time >= keyframes.back().getTime())
|
||||
{
|
||||
result = keyframes.back().getValue();
|
||||
return;
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
else if (time <= keyframes.front().getTime())
|
||||
{
|
||||
result = keyframes.front().getValue();
|
||||
return;
|
||||
@@ -152,14 +152,14 @@ namespace osgAnimation
|
||||
public:
|
||||
|
||||
TemplateLinearPackedInterpolator() {}
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
{
|
||||
if (time >= keyframes.back().getTime())
|
||||
if (time >= keyframes.back().getTime())
|
||||
{
|
||||
keyframes.back().getValue().uncompress(keyframes.mScale, keyframes.mMin, result);
|
||||
return;
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
else if (time <= keyframes.front().getTime())
|
||||
{
|
||||
keyframes.front().getValue().uncompress(keyframes.mScale, keyframes.mMin, result);
|
||||
return;
|
||||
@@ -182,22 +182,22 @@ namespace osgAnimation
|
||||
public:
|
||||
|
||||
TemplateCubicBezierInterpolator() {}
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
void getValue(const TemplateKeyframeContainer<KEY>& keyframes, double time, TYPE& result) const
|
||||
{
|
||||
|
||||
if (time >= keyframes.back().getTime())
|
||||
|
||||
if (time >= keyframes.back().getTime())
|
||||
{
|
||||
result = keyframes.back().getValue().getPosition();
|
||||
return;
|
||||
}
|
||||
else if (time <= keyframes.front().getTime())
|
||||
else if (time <= keyframes.front().getTime())
|
||||
{
|
||||
result = keyframes.front().getValue().getPosition();
|
||||
return;
|
||||
}
|
||||
|
||||
int i = this->getKeyIndexFromTime(keyframes,time);
|
||||
|
||||
|
||||
float t = (time - keyframes[i].getTime()) / ( keyframes[i+1].getTime() - keyframes[i].getTime());
|
||||
float one_minus_t = 1.0-t;
|
||||
float one_minus_t2 = one_minus_t * one_minus_t;
|
||||
|
||||
Reference in New Issue
Block a user