Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MInterpolator.h
Go to the documentation of this file.
1 // Copyright (C) 2004-2006 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 
21 #ifndef MINTERPOLATOR_H
22 #define MINTERPOLATOR_H
23 
24 #include "MMatrix3x3.h"
25 
26 namespace OpenSkyNet {
27  namespace Math {
35  class Interpolator {
36  public:
37  enum TYPE {
42  } _type;
43  float _value;
44 
45  Interpolator() : _type(LOOP), _value(0.0f) {}
46  Interpolator(TYPE type_) : _type(type_), _value(0.0f) {}
47  bool operator+(float amount_);
48  operator float() { return _value; }
49  };
50 
53  struct ILerpOverTime {
56 
58  virtual bool update(float dt_) = 0;
59  virtual ~ILerpOverTime() {}
60  };
61 
63  struct LerpOverTime1 : public ILerpOverTime {
64  float* _control;
65  float _begin, _end;
66 
67  virtual void init(float& begin_, float end_, float speed_);
68  virtual bool update(float dt_);
69  };
70 
72  struct LerpOverTime3 : public ILerpOverTime {
75 
76  static const float _minSqrdDistToUpdate;
77 
78  virtual void init(Math::Point<>& begin_, const Math::Point<>& end_, float speed_);
79  virtual bool update(float dt_);
80  };
81 
83  struct LerpOverTime3x3 : public ILerpOverTime {
87  float _endRads;
88 
89  static const float _minRadsToUpdate;
90 
91  virtual void init(Math::Matrix3x3& begin_, const Math::Point<>& axis_, float radians_, float speed_);
92  virtual void init(Math::Matrix3x3& begin_, const Math::Matrix3x3& end_, float speed_);
93  virtual bool update(float dt_);
94  };
95  }
96 }
97 
98 #endif //MINTERPOLATOR_H
enum OpenSkyNet::Math::Interpolator::TYPE _type
Interpolator(TYPE type_)
Definition: MInterpolator.h:46
Definition: MInterpolator.h:53
float _value
Definition: MInterpolator.h:43
virtual bool update(float dt_)=0
Definition: MInterpolator.h:39
ILerpOverTime()
Definition: MInterpolator.h:57
TYPE
Definition: MInterpolator.h:37
virtual bool update(float dt_)
Definition: MInterpolator.cpp:50
Definition: MInterpolator.h:40
Definition: MInterpolator.h:63
bool operator+(float amount_)
Definition: MInterpolator.cpp:6
Math::Point * _control
Definition: MInterpolator.h:73
Math::Point _rotAxis
Definition: MInterpolator.h:86
Math::Interpolator _interpolator
Definition: MInterpolator.h:55
Definition: MInterpolator.h:72
float _begin
Definition: MInterpolator.h:65
float _percentAdditive
Definition: MInterpolator.h:54
float * _control
Definition: MInterpolator.h:64
virtual bool update(float dt_)
Definition: MInterpolator.cpp:120
float _end
Definition: MInterpolator.h:65
static const float _minSqrdDistToUpdate
Definition: MInterpolator.h:76
Interpolator()
Definition: MInterpolator.h:45
virtual void init(Math::Point<> &begin_, const Math::Point<> &end_, float speed_)
Definition: MInterpolator.cpp:65
Definition: MPoint.h:33
Math::Point _begin
Definition: MInterpolator.h:74
Definition: MInterpolator.h:83
virtual ~ILerpOverTime()
Definition: MInterpolator.h:59
Definition: MInterpolator.h:41
virtual bool update(float dt_)
Definition: MInterpolator.cpp:74
Math::Point _end
Definition: MInterpolator.h:74
Definition: MInterpolator.h:35
Definition: MMatrix3x3.h:32
float _endRads
Definition: MInterpolator.h:87
Math::Matrix3x3 * _control
Definition: MInterpolator.h:84
Math::Matrix3x3 _begin
Definition: MInterpolator.h:85
virtual void init(float &begin_, float end_, float speed_)
Definition: MInterpolator.cpp:41
Definition: MInterpolator.h:38
virtual void init(Math::Matrix3x3 &begin_, const Math::Point<> &axis_, float radians_, float speed_)
static const float _minRadsToUpdate
Definition: MInterpolator.h:89