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
CTransformInterpolator.h
Go to the documentation of this file.
1 // Copyright (C) 2004-2013 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 CTRANSFORM_INTERPOLATOR_H
22 #define CTRANSFORM_INTERPOLATOR_H
23 
24 #include "IMotionUpdater.h"
25 #include "ICollisionListener.h"
26 #include "../Math_LIB/MInterpolator.h"
27 
28 namespace OpenSkyNet {
29  namespace Core {
34  protected:
35  virtual bool addObject(Object* obj_, Updater::OBJECT_PRIORITY prio_=Updater::OBJ_1, bool isOneShot_=false);
36  public:
44  bool _doRotate;
45  const Object* _lookAt;
47 
49  bool isOneShot_=false) : MotionUpdater::MotionInfo(prio_,isOneShot_),
50  _doTranslate(false), _doRotate(false), _lookAt(0), _doLookAtOpposite(false) {}
51  };
52 
53  TransformInterpolator() : MotionUpdater(Updater::TRANSFORM_INTERPOLATOR, "TRANSFORM_INTERPOLATOR", Updater::UPD_5, 0.033f) {}
55 
56  virtual bool update(float dt_);
57 
60  virtual void setNonCollidingData(Object* obj_);
61  virtual void handleNonCollidingTransformApplied(Object* obj_);
63 
65  void setLookAtTarget(Object* obj_, const Object* lookAt_=0, bool doLookAtOpposite_=false);
66 
70  bool translate(Object* obj_, bool doTranslate_, const Math::Point<>& endPos_=Math::g_origin, float speed_=0.0f);
71 
73  inline bool isTranslating(Object* obj_) { return static_cast<TransformInfo*>(_objMap[obj_])->_doTranslate; }
74 
78  bool rotate(Object* obj_, bool doRotate_, const Math::Point<>& centerOfRot_=Math::g_origin,
79  const Math::Point<>& axis_=Math::g_origin, float radians_=0.0f, float speed_=0.0f);
80 
84  bool rotate(Object* obj_, const Math::Point<>& centerOfRot_=Math::g_origin,
85  const Math::Matrix3x3& endRot_=Math::g_identityMatrix3x3, float speed_=0.0f);
86 
88  inline bool isRotating(Object* obj_) { return static_cast<TransformInfo*>(_objMap[obj_])->_doRotate; }
89  };
90  }
91 }
92 
93 #endif //CTRANSFORM_INTERPOLATOR_H
bool isRotating(Object *obj_)
Definition: CTransformInterpolator.h:88
Definition: CTransformInterpolator.h:37
TransformInfo(Updater::OBJECT_PRIORITY prio_=Updater::OBJ_DISABLED, bool isOneShot_=false)
Definition: CTransformInterpolator.h:48
Math::Point _pos
Definition: CTransformInterpolator.h:38
bool _doTranslate
Definition: CTransformInterpolator.h:43
Definition: IMotionUpdater.h:78
const Matrix3x3 g_identityMatrix3x3
Definition: MMatrix3x3.cpp:5
Math::LerpOverTime3 _posControl
Definition: CTransformInterpolator.h:40
Definition: CTransformInterpolator.h:33
Definition: CUpdater.h:49
Definition: MInterpolator.h:72
bool _doLookAtOpposite
Definition: CTransformInterpolator.h:46
bool isTranslating(Object *obj_)
Definition: CTransformInterpolator.h:73
Definition: CUpdater.h:40
const Point g_origin
Definition: MPoint.cpp:5
const Object * _lookAt
Definition: CTransformInterpolator.h:45
OBJECT_PRIORITY
Definition: CUpdater.h:49
#define CORE_DLL
Definition: CCoreDLL.h:57
TransformInterpolator()
Definition: CTransformInterpolator.h:53
Definition: MPoint.h:33
Definition: IObject.h:36
Definition: MInterpolator.h:83
Definition: IMotionUpdater.h:33
bool _doRotate
Definition: CTransformInterpolator.h:44
Math::Matrix3x3 _rot
Definition: CTransformInterpolator.h:39
Definition: ICollisionListener.h:34
Definition: MMatrix3x3.h:32
Math::LerpOverTime3x3 _rotControl
Definition: CTransformInterpolator.h:42
Math::Point _centerOfRot
Definition: CTransformInterpolator.h:41
virtual ~TransformInterpolator()
Definition: CTransformInterpolator.h:54