forked from teamnwah/openmw-tes3coop
[Client] Add MechanicsHelper and move linear interpolation code to it
parent
2565816b22
commit
cf155c9279
@ -0,0 +1,22 @@
|
||||
#include <components/openmw-mp/Log.hpp>
|
||||
|
||||
#include "MechanicsHelper.hpp"
|
||||
#include "Main.hpp"
|
||||
using namespace mwmp;
|
||||
|
||||
mwmp::MechanicsHelper::MechanicsHelper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
mwmp::MechanicsHelper::~MechanicsHelper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
osg::Vec3f MechanicsHelper::getLinearInterpolation(osg::Vec3f start, osg::Vec3f end, float percent)
|
||||
{
|
||||
osg::Vec3f position(percent, percent, percent);
|
||||
|
||||
return (start + osg::componentMultiply(position, (end - start)));
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
#ifndef OPENMW_MECHANICSHELPER_HPP
|
||||
#define OPENMW_MECHANICSHELPER_HPP
|
||||
|
||||
#include <osg/Vec3f>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class MechanicsHelper
|
||||
{
|
||||
public:
|
||||
|
||||
MechanicsHelper();
|
||||
~MechanicsHelper();
|
||||
|
||||
osg::Vec3f getLinearInterpolation(osg::Vec3f start, osg::Vec3f end, float percent);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_MECHANICSHELPER_HPP
|
Loading…
Reference in New Issue