Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Enki::PhysicalObject Class Reference
[Core Enki classes]

#include <PhysicalEngine.h>

Inheritance diagram for Enki::PhysicalObject:

Enki::Robot Enki::Alice Enki::Khepera Enki::Sbot Enki::SbotActiveObject Enki::FeedableSbot List of all members.

Detailed Description

A situated object in the world with mass, geometry properties, physical properties, ...


Public Member Functions

 PhysicalObject ()
 Constructor.
virtual ~PhysicalObject ()
 Destructor.
void setBoundingSurface (const An::Polygone *bs)
 Set the shape of the object to bs, recompute r, assign color to faces. bs must exists during all object's life.
const An::Polygone & getTrueBoundingSurface (void) const
 Return the shape of the object in object coordinates.
virtual void step (double dt)
 A simulation step for this object. It is considered as deinterlaced. The position and orientation are updated, and speed is reduced according to global dynamic friction coefficient.
virtual void initLocalInteractions ()
 Initialize the collision logic.
virtual void doLocalInteractions (World *w, PhysicalObject *o, double dt, bool firstInteraction)
 Do the collision with the other PhysicalObject. firstInteraction controls which object collides with which, dt is not used.
virtual void doLocalWallsInteraction (World *w)
 Do the collisions with the walls of world w.
virtual void finalizeLocalInteractions (double dt)
 All collisions are finished, deinterlace the object.
virtual void initGlobalInteractions ()
 Initialize the global interactions, do nothing for PhysicalObject.
virtual void doGlobalInteractions (World *w, double dt)
 Do the global interactions with the world, do nothing for PhysicalObject.
virtual void finalizeGlobalInteractions ()
 All global interactions are finished, do nothing for PhysicalObject.
void collideWithStaticObject (const An::Point &cp1, const An::Point &cp2, const An::Vector &n1, const An::Vector &n2, const An::Vector &dist)
 Dynamics for collision with a static object at points cp1 and cp2 with normals vectors n1 and n2 and a penetrated distance of dist.
void collideWithObject (PhysicalObject &object, const An::Point &cp, const An::Vector &dist)
 Dynamics for collision with object at point cp with a penetrated distance of dist.

Public Attributes

An::Point pos
 The position of the object.
double height
 The height of the object, used for interaction with robot's sensors.
double angle
 The orientation of the object in the world, standard trigonometric orientation.
An::Vector speed
 The speed of the object.
double angSpeed
 The rotation speed of the object, standard trigonometric orientation.
double mass
 The mass of the object. If below zero, the object can't move (infinite mass).
double staticFrictionThreshold
 The static friction threshold of the object. If a force is smaller than it, the object will not move.
double viscousFrictionTau
 The viscous friction time constant. Half-life of speed when object is free. If lower than timestep, speed is forced to zero.
double viscousMomentFrictionTau
 The viscous friction moment time constant. Half-life of angular speed when object is free. If lower than timestep, angular speed is forced to zero.
double collisionAngularFrictionFactor
 Upon collision with static objects. The amount of rotation transmitted to the moving object. If zero, moving object slides over static one. If one, moving object is fully rotated.
const An::Polygone * boundingSurface
 The shape of the object in object coordinates. If NULL, the object is circular and its radius is given by r .
An::Polygone absBoundingSurface
 The shape of the object in world coordinates, updated on initLocalInteractions(). Invalid if boundingSurface is NULL.
double r
 The radius of circular objects. If boundingSurface is not NULL, it is automatically computed.
An::Color color
 The color of the object.
std::valarray< An::Texture > textures
 Texture for several faces of this object.

Protected Member Functions

void collideWithStaticObject (const An::Vector &n)
 Do the real rotation due to collision.
void computeAbsBoundingSurface (void)
 Compute the shape of its object in world coordinates.

Protected Attributes

An::Vector deinterlaceVector
 Vector used for object collisions. If its norm is greater than staticFrictionThreshold, the object is moved.


The documentation for this class was generated from the following files:
Generated on Mon Oct 24 17:33:58 2005 for Enki by  doxygen 1.4.2