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::PhysicsUpdater Class Reference

#include <CPhysicsUpdater.h>

Inheritance diagram for OpenSkyNet::Core::PhysicsUpdater:
OpenSkyNet::Core::Updater OpenSkyNet::Core::CollisionListener

Classes

struct  PhysicsInfo
 

Public Member Functions

 PhysicsUpdater ()
 
virtual ~PhysicsUpdater ()
 
virtual bool update (float dt_)
 
CollisionListener interface.
virtual void setNonCollidingData (Object *obj_)
 
virtual bool handleCollisions (Object *collidee_, std::vector< CD::HitInfo > &colliders_, float &dt_)
 
- 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 void handleNonCollidingTransformApplied (Object *obj_)
 
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::Updater
virtual bool removeObject (Object *obj_)
 
virtual void removeAllObjects ()
 
int getNumToUpdate (float dt_)
 
void allObjectsUpdated ()
 
void setPriority (UPDATER_PRIORITY prio_)
 

Additional Inherited Members

- 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
 
- 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

Newtonian physics simulation of rigid bodies.

Constructor & Destructor Documentation

PhysicsUpdater::PhysicsUpdater ( )
virtual OpenSkyNet::Core::PhysicsUpdater::~PhysicsUpdater ( )
inlinevirtual

Member Function Documentation

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

Returns false if obj_ is already in this updater.

Reimplemented from OpenSkyNet::Core::Updater.

bool PhysicsUpdater::handleCollisions ( Object collidee_,
std::vector< CD::HitInfo > &  collisions_,
float &  dt_ 
)
virtual

Called every Core::CollisionDetector update() when a collision is detected.

Parameters
dt_An IN param signifying the time delta for all collision tests and an OUT param signifying the time left for any future recalculations
Returns
true if collisions should be recalculated for this object, false otherwise.

Reimplemented from OpenSkyNet::Core::CollisionListener.

void PhysicsUpdater::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 PhysicsUpdater::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: