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
CPathUpdater.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 CPATH_UPDATER_H
22 #define CPATH_UPDATER_H
23 
24 #include "IMotionUpdater.h"
25 #include "ICollisionListener.h"
26 #include "../Math_LIB/MInterpolator.h"
27 #include "../Math_LIB/MPath.h"
28 
29 namespace OpenSkyNet {
30  namespace Core {
33  protected:
34  virtual bool addObject(Object* obj_, Updater::OBJECT_PRIORITY prio_=Updater::OBJ_1, bool isOneShot_=false);
35  public:
37  const Math::Path* _path;
39  float _speed;
41  bool _lookAtEnd;
44 
45  PathInfo(Updater::OBJECT_PRIORITY prio_=Updater::OBJ_DISABLED, bool isOneShot_=false) :
46  MotionUpdater::MotionInfo(prio_,isOneShot_), _path(0),
47  _pathInterpolator(Math::Interpolator(Math::Interpolator::END)),
48  _speed(0), _usePercentOfPoints(false), _lookAtEnd(true),
49  _lookPercentAhead(0.0f) {}
50  };
51 
52  PathUpdater() : MotionUpdater(Updater::PATH, "PATH", Updater::UPD_5, 0.033f) {}
53  virtual ~PathUpdater() {}
54 
55  virtual bool update(float dt_);
56 
59  virtual void setNonCollidingData(Object* obj_);
60  virtual void handleNonCollidingTransformApplied(Object* obj_);
62 
63  void setPath(Object* obj_, const Math::Path* path_, const float& speed_,
64  Math::Interpolator::TYPE interpolatorType_=Math::Interpolator::END, float interpolatorValue_=0.0f,
65  bool lookAtEnd_=false, float lookPercentAhead_=0.0f, bool usePercentOfPoints_=false);
66 
67  inline const Math::Interpolator& getInterpolator(Object* obj_) { return static_cast<PathInfo*>(_objMap[obj_])->_pathInterpolator; }
68 
69  inline const Math::Point<>& getInitialDriverPos(Object* obj_) { return static_cast<PathInfo*>(_objMap[obj_])->_drivPos; }
70 
71  bool isPathAtEnd(Object* obj_);
72  };
73  }
74 }
75 
76 #endif //CPATH_UPDATER_H
float _speed
Definition: CPathUpdater.h:39
Definition: CCamera.h:32
const Math::Path * _path
Definition: CPathUpdater.h:37
TYPE
Definition: MInterpolator.h:37
const Math::Point & getInitialDriverPos(Object *obj_)
Definition: CPathUpdater.h:69
Definition: IMotionUpdater.h:78
Definition: CUpdater.h:49
Definition: CUpdater.h:40
const Math::Interpolator & getInterpolator(Object *obj_)
Definition: CPathUpdater.h:67
OBJECT_PRIORITY
Definition: CUpdater.h:49
#define CORE_DLL
Definition: CCoreDLL.h:57
PathUpdater()
Definition: CPathUpdater.h:52
Definition: MPoint.h:33
Definition: CPathUpdater.h:32
Definition: IObject.h:36
Math::Point _drivPos
Definition: CPathUpdater.h:43
float _lookPercentAhead
Definition: CPathUpdater.h:42
Definition: IMotionUpdater.h:33
Definition: MInterpolator.h:41
PathInfo(Updater::OBJECT_PRIORITY prio_=Updater::OBJ_DISABLED, bool isOneShot_=false)
Definition: CPathUpdater.h:45
Definition: ICollisionListener.h:34
Definition: MInterpolator.h:35
Math::Interpolator _pathInterpolator
Definition: CPathUpdater.h:38
bool _lookAtEnd
Definition: CPathUpdater.h:41
bool _usePercentOfPoints
Definition: CPathUpdater.h:40
Definition: CPathUpdater.h:36
virtual ~PathUpdater()
Definition: CPathUpdater.h:53
Definition: MPath.h:31