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
Classes | Public Member Functions | Protected Member Functions | List of all members
OpenSkyNet::Core::TransformInterpolator Class Reference

#include <CTransformInterpolator.h>

Inheritance diagram for OpenSkyNet::Core::TransformInterpolator:
OpenSkyNet::Core::MotionUpdater OpenSkyNet::Core::CollisionListener OpenSkyNet::Core::Updater

Classes

struct  TransformInfo
 

Public Member Functions

 TransformInterpolator ()
 
virtual ~TransformInterpolator ()
 
virtual bool update (float dt_)
 
void setLookAtTarget (Object *obj_, const Object *lookAt_=0, bool doLookAtOpposite_=false)
 
bool translate (Object *obj_, bool doTranslate_, const Math::Point<> &endPos_=Math::g_origin, float speed_=0.0f)
 
bool isTranslating (Object *obj_)
 
bool rotate (Object *obj_, bool doRotate_, const Math::Point<> &centerOfRot_=Math::g_origin, const Math::Point<> &axis_=Math::g_origin, float radians_=0.0f, float speed_=0.0f)
 
bool rotate (Object *obj_, const Math::Point<> &centerOfRot_=Math::g_origin, const Math::Matrix3x3 &endRot_=Math::g_identityMatrix3x3, float speed_=0.0f)
 
bool isRotating (Object *obj_)
 
CollisionListener interface.
virtual void setNonCollidingData (Object *obj_)
 
virtual void handleNonCollidingTransformApplied (Object *obj_)
 
- Public Member Functions inherited from OpenSkyNet::Core::MotionUpdater
 MotionUpdater (Updater::UPDATER_TYPE type_, const char *typeName_, Updater::UPDATER_PRIORITY prio_, float interval_)
 
virtual void addAnchor (Object *base_, Object *anchor_, bool updatePos_, bool updateRot_, const Math::Point<> &localPos_, const Math::Matrix3x3 &localRot_)
 
virtual void addAnchor (Object *base_, Object *anchor_, bool updatePos_, bool updateRot_)
 
virtual void removeAnchor (Object *base_, Object *anchor_)
 
virtual void removeAllAnchors (Object *base_)
 
- Public Member Functions inherited from OpenSkyNet::Core::Updater
 Updater ()
 
 Updater (UPDATER_TYPE type_, const char *typeName_, UPDATER_PRIORITY prio_, float interval_)
 
virtual ~Updater ()
 
UPDATER_TYPE getType () const
 
const std::string & getTypeName () const
 
float getInterval () const
 
void setInterval (float interval_)
 
Utils::uint getNumObjects () const
 
Utils::uint getNumObjectsThatCanUpdate () const
 
bool find (Object *obj_) const
 
UPDATER_PRIORITY getPriority () const
 
OBJECT_PRIORITY getPriority (Object *obj_) const
 
virtual bool setPriority (Object *obj_, OBJECT_PRIORITY prio_)
 
- Public Member Functions inherited from OpenSkyNet::Core::CollisionListener
virtual bool handleCollisions (Object *collidee_, std::vector< CD::HitInfo > &collisions_, float &dt_)
 
virtual void handleNewCollisions (Object *collidee_, std::vector< Object * > &colliders_)
 
virtual void handleDeletedCollisions (Object *collidee_, std::vector< Object * > &colliders_)
 
virtual bool handleWrongSidedness (Object *collidee_, std::vector< CD::HitInfo > &collisions_)
 
virtual bool handleOutOfGrid (Object *obj_)
 

Protected Member Functions

virtual bool addObject (Object *obj_, Updater::OBJECT_PRIORITY prio_=Updater::OBJ_1, bool isOneShot_=false)
 
- Protected Member Functions inherited from OpenSkyNet::Core::MotionUpdater
virtual bool removeObject (Object *obj_)
 
virtual void removeAllObjects ()
 
virtual void updateAnchors (Object *obj_)
 
- Protected Member Functions inherited from OpenSkyNet::Core::Updater
int getNumToUpdate (float dt_)
 
void allObjectsUpdated ()
 
void setPriority (UPDATER_PRIORITY prio_)
 

Additional Inherited Members

- Public Types inherited from OpenSkyNet::Core::MotionUpdater
enum  ATTACH_POINT { BASE, VIEW, NUM_ATTACH_POINTS }
 
- Public Types inherited from OpenSkyNet::Core::Updater
enum  UPDATER_TYPE {
  BASE, AI, CAMERA, PATH_FINDER,
  PATH, TRANSFORM_INTERPOLATOR, PHYSICS, ANIMATION,
  COLLISION_DETECTOR, PHYS_VIS, TRANSFORM_CHANGE_DETECTOR, CORE_MAX,
  MAX =32
}
 
enum  UPDATER_PRIORITY {
  UPD_DISABLED, UPD_1, UPD_2, UPD_3,
  UPD_4, UPD_5, UPD_6, UPD_7,
  UPD_8, UPD_NUM_PRIORITIES
}
 
enum  OBJECT_PRIORITY {
  OBJ_DISABLED, OBJ_1, OBJ_2, OBJ_3,
  OBJ_NUM_PRIORITIES
}
 
typedef std::map< Object
*, UpdateInfo * > 
ObjMap
 
- Static Public Member Functions inherited from OpenSkyNet::Core::MotionUpdater
static void setForward (Math::Matrix3x3 &rot_, Math::Point<> &forward_)
 
- Protected Attributes inherited from OpenSkyNet::Core::MotionUpdater
std::map< Object *, MotionInfo * > _nonCollidingInfoMap
 
- Protected Attributes inherited from OpenSkyNet::Core::Updater
std::list< Object * > _objLists [OBJ_NUM_PRIORITIES]
 
ObjMap _objMap
 
UPDATER_TYPE _type
 
std::string _typeName
 
UPDATER_PRIORITY _prio
 
float _interval
 
float _dtSinceAllWereUpdated
 
float _prevTotalTimeForAllUpdates
 
float _partialUpdate
 
int _currPrio
 
std::list< Object * >::iterator _currObj
 

Detailed Description

Interpolates a game object's position and rotation over time between predefined end values. Also allows for interpolation to a "look at" rotation towards a dynamic target.

Constructor & Destructor Documentation

OpenSkyNet::Core::TransformInterpolator::TransformInterpolator ( )
inline
virtual OpenSkyNet::Core::TransformInterpolator::~TransformInterpolator ( )
inlinevirtual

Member Function Documentation

bool TransformInterpolator::addObject ( Object obj_,
Updater::OBJECT_PRIORITY  prio_ = Updater::OBJ_1,
bool  isOneShot_ = false 
)
protectedvirtual

Returns false if obj_ is already in this updater.

Implements OpenSkyNet::Core::MotionUpdater.

void TransformInterpolator::handleNonCollidingTransformApplied ( Object obj_)
virtual

Called by Core::CollisionDetector update() after the object is set to its "safe" transform.

Reimplemented from OpenSkyNet::Core::CollisionListener.

bool OpenSkyNet::Core::TransformInterpolator::isRotating ( Object obj_)
inline

Precondition: obj_ is in this updater

bool OpenSkyNet::Core::TransformInterpolator::isTranslating ( Object obj_)
inline

Precondition: obj_ is in this updater

bool OpenSkyNet::Core::TransformInterpolator::rotate ( Object obj_,
bool  doRotate_,
const Math::Point<> &  centerOfRot_ = Math::g_origin,
const Math::Point<> &  axis_ = Math::g_origin,
float  radians_ = 0.0f,
float  speed_ = 0.0f 
)

Precondition: obj_ is in this updater. Returns false if doRotate_ is false or the radians to update is less than LerpOverTime3x3::_minRadsToUpdate.

bool OpenSkyNet::Core::TransformInterpolator::rotate ( Object obj_,
const Math::Point<> &  centerOfRot_ = Math::g_origin,
const Math::Matrix3x3 endRot_ = Math::g_identityMatrix3x3,
float  speed_ = 0.0f 
)

Precondition: obj_ is in this updater. Returns false if doRotate_ is false or the radians to update is less than LerpOverTime3x3::_minRadsToUpdate.

void TransformInterpolator::setLookAtTarget ( Object obj_,
const Object lookAt_ = 0,
bool  doLookAtOpposite_ = false 
)

Precondition: obj_ is in this updater

void TransformInterpolator::setNonCollidingData ( Object obj_)
virtual

Saves the motion info for obj_ when it is known not to cause collisions w/ other objects. This data is used in iterative collision detection routines whereby only one object can be tested for a new position/rotation at a time; the rest of the objects have to be at "safe" positions/rotations.

Reimplemented from OpenSkyNet::Core::CollisionListener.

bool TransformInterpolator::translate ( Object obj_,
bool  doTranslate_,
const Math::Point<> &  endPos_ = Math::g_origin,
float  speed_ = 0.0f 
)

Precondition: obj_ is in this updater. Returns false if doTranslate_ is false or the distance to update squared is less than LerpOverTime3::_minSqrdDistToUpdate.

bool TransformInterpolator::update ( float  dt_)
virtual

Returns true if all objects were updated over the current interval (that's interval, not dt_), false if objects are left to be updated (see class description).

Parameters
dt_= seconds to update an object this call. dt_ accumulates for objects not updated.

Reimplemented from OpenSkyNet::Core::Updater.


The documentation for this class was generated from the following files: