This is the core physics engine used by the server.
More...
Classes | |
class | aesop::PhysicsShape |
a shape is a 3D template which can be used to create instances of objects More... | |
class | aesop::PhysicsObject |
an instance of a shape (has position, velocity, etc) More... | |
struct | aesop::physics_meta_t |
basic information to create an instance of a shape (== object) More... | |
class | aesop::PhysicsWorld |
create one of these to support physics simulations etc. More... | |
struct | aesop::PhysicsWorld::collision_iterator_t |
struct | aesop::PhysicsWorld::collision_record_t |
Typedefs | |
typedef void(* | aesop::object_iteration_fn )(IN smart_ptr< PhysicsObject > &obj, IN void *context) |
callback definition | |
Functions | |
void | aesop::getVectorFromEulerAngles (IN const point3d_t &euler, OUT point3d_t &vector) throw () |
Assuming a vector is initially pointing in the (0, 0, 1) direction, return how it is rotated by the given Euler angles. | |
void | aesop::getVectorFromQuaternion (IN const quaternion_t &rotation, OUT point3d_t &vector) throw () |
Assuming a vector is initially pointing in the (0, 0, 1) direction, return how it is rotated by the given quaternion. | |
virtual void | aesop::PhysicsShape::setContext (IN void *ctx)=0 throw () |
virtual void * | aesop::PhysicsShape::getContext (void)=0 throw () |
smart_ptr< PhysicsShape > | aesop::createBoxShape (IN const point3d_t &dimensions) |
smart_ptr< PhysicsShape > | aesop::createCubeShape (IN float edge_length) |
smart_ptr< PhysicsShape > | aesop::createCapsuleShape (IN float height, IN float radius) |
smart_ptr< PhysicsShape > | aesop::createTrimeshShape (IN const trimesh::Trimesh *trimesh) |
smart_ptr< PhysicsShape > | aesop::createHeightfieldShape (IN const hfield::Heightfield *field) |
virtual | aesop::PhysicsObject::~PhysicsObject (void) throw () |
virtual dword_t | aesop::PhysicsObject::getId (void) const =0 throw () |
every physics object has a unique ID | |
virtual int | aesop::PhysicsObject::getFlags (void) const =0 throw () |
object flags | |
virtual void | aesop::PhysicsObject::dump (IN const char *txt) const =0 throw () |
debug information (writes a chunk of information to stderr) | |
virtual point3d_t | aesop::PhysicsObject::getPosition (void) const =0 throw () |
object's current position in world (== map) | |
virtual rect3d_t | aesop::PhysicsObject::getBoundingBox (void) const =0 throw () |
object's axis-aligned bounding box | |
virtual quaternion_t | aesop::PhysicsObject::getOrientation (void) const =0 throw () |
object's current orientation (in Euler angles) | |
virtual point3d_t | aesop::PhysicsObject::getLinearVelocity (void) const =0 throw () |
object's current linear velocity | |
virtual point3d_t | aesop::PhysicsObject::getAngularVelocity (void) const =0 throw () |
object's current angular velocity | |
virtual void | aesop::PhysicsObject::setOrientation (IN const quaternion_t &orient)=0 |
virtual void | aesop::PhysicsObject::setLinearVelocity (IN const point3d_t &linear)=0 |
virtual void | aesop::PhysicsObject::setAngularVelocity (IN const point3d_t &angular)=0 |
virtual void | aesop::PhysicsObject::requestMove (IN const point3d_t &delta, IN float dt)=0 |
can request motion in a particular direction over a time interval | |
virtual void | aesop::PhysicsObject::setPosition (IN const point3d_t &pos)=0 |
jump to a new location, regardless of collisions | |
virtual float | aesop::PhysicsObject::getMass (void) const =0 throw () |
get mass (zero means infinite--immobile) | |
virtual void | aesop::PhysicsObject::iterateOverlappingObjects (IN object_iteration_fn fn, IN void *context)=0 |
iterate over all other overlapping objects | |
virtual void | aesop::PhysicsObject::setUserPointer (void *userPointer)=0 throw () |
set a context pointer | |
virtual void * | aesop::PhysicsObject::getUserPointer (void) const =0 throw () |
retrieve user pointer | |
smart_ptr< PhysicsObject > | aesop::getPhysicsObjectById (IN dword_t id) |
access to static registry of physics objects | |
void | aesop::physics_meta_t::clear (void) throw () |
void | aesop::physics_meta_t::dump (IN const char *msg) const throw () |
smart_ptr< PhysicsObject > | aesop::createObject (IN const physics_meta_t &meta, IN const placement_t &placement) |
create an object from a physics meta and instance information | |
void | aesop::PhysicsWorld::collision_record_t::clear (void) throw () |
virtual | aesop::PhysicsWorld::~PhysicsWorld (void) throw () |
virtual void | aesop::PhysicsWorld::addObject (IN smart_ptr< PhysicsObject > &o)=0 |
virtual void | aesop::PhysicsWorld::removeObject (IN PhysicsObject *obj)=0 |
virtual long | aesop::PhysicsWorld::getObjectCount (void)=0 throw () |
virtual void | aesop::PhysicsWorld::tick (IN float seconds)=0 |
virtual void | aesop::PhysicsWorld::getObjectIterator (OUT object_iterator_t &i)=0 |
virtual bool | aesop::PhysicsWorld::getNextObject (IO object_iterator_t &i, OUT smart_ptr< PhysicsObject > &obj)=0 |
virtual void | aesop::PhysicsWorld::getCollisionIterator (OUT collision_iterator_t &i)=0 |
virtual bool | aesop::PhysicsWorld::getNextCollision (IO collision_iterator_t &i, OUT collision_record_t &cr)=0 |
virtual smart_ptr< PhysicsObject > | aesop::PhysicsWorld::rayTest (IN const point3d_t &from, IN const point3d_t &to)=0 |
static smart_ptr< PhysicsWorld > | aesop::PhysicsWorld::create (IN const Datahash *params) |
smart_ptr< PhysicsObject > | aesop::getObjectHitFromPlacement (IN PhysicsWorld *world, IN const placement_t &placement, IN float half_extent) |
given an object at the given location and view direction (orientation), what is it looking at? (First object hit by a ray cast) Can return null! | |
void | aesop::dumpWorld (IN PhysicsWorld *world) throw () |
expensive debugging function | |
Variables | |
smart_ptr< PhysicsShape > | aesop::physics_meta_t::shape |
float | aesop::physics_meta_t::mass |
int | aesop::physics_meta_t::objectFlags |
smart_ptr< PhysicsObject > | aesop::PhysicsWorld::collision_record_t::obj1 |
smart_ptr< PhysicsObject > | aesop::PhysicsWorld::collision_record_t::obj2 |
This is the core physics engine used by the server.
Note that this library is not intended to contain any actual physics code! That is hard. This library is just to provide a simple interface on top of the very powerful Bullet Physics API. See http://www.bulletphysics.com/
One intention of this layer is to insulate other code from knowing details of the physics engine implementation.
Some concepts that are safe to expose:
Concepts that are NOT safe to expose:
typedef void(* aesop::object_iteration_fn)(IN smart_ptr< PhysicsObject > &obj, IN void *context) |
callback definition
Definition at line 125 of file aesop-physics.h.
void aesop::getVectorFromEulerAngles | ( | IN const point3d_t & | euler, | |
OUT point3d_t & | vector | |||
) | throw () |
Assuming a vector is initially pointing in the (0, 0, 1) direction, return how it is rotated by the given Euler angles.
void aesop::getVectorFromQuaternion | ( | IN const quaternion_t & | rotation, | |
OUT point3d_t & | vector | |||
) | throw () |
Assuming a vector is initially pointing in the (0, 0, 1) direction, return how it is rotated by the given quaternion.
virtual void aesop::PhysicsShape::setContext | ( | IN void * | ctx | ) | throw () [pure virtual, inherited] |
virtual void* aesop::PhysicsShape::getContext | ( | void | ) | throw () [pure virtual, inherited] |
smart_ptr< PhysicsShape > aesop::createBoxShape | ( | IN const point3d_t & | dimensions | ) |
smart_ptr< PhysicsShape > aesop::createCubeShape | ( | IN float | edge_length | ) |
smart_ptr< PhysicsShape > aesop::createCapsuleShape | ( | IN float | height, | |
IN float | radius | |||
) |
smart_ptr< PhysicsShape > aesop::createTrimeshShape | ( | IN const trimesh::Trimesh * | trimesh | ) |
smart_ptr< PhysicsShape > aesop::createHeightfieldShape | ( | IN const hfield::Heightfield * | field | ) |
aesop::PhysicsObject::~PhysicsObject | ( | void | ) | throw () [virtual, inherited] |
Definition at line 46 of file aesop-physics.cpp.
virtual dword_t aesop::PhysicsObject::getId | ( | void | ) | const throw () [pure virtual, inherited] |
every physics object has a unique ID
virtual int aesop::PhysicsObject::getFlags | ( | void | ) | const throw () [pure virtual, inherited] |
object flags
virtual void aesop::PhysicsObject::dump | ( | IN const char * | txt | ) | const throw () [pure virtual, inherited] |
debug information (writes a chunk of information to stderr)
virtual point3d_t aesop::PhysicsObject::getPosition | ( | void | ) | const throw () [pure virtual, inherited] |
object's current position in world (== map)
virtual rect3d_t aesop::PhysicsObject::getBoundingBox | ( | void | ) | const throw () [pure virtual, inherited] |
object's axis-aligned bounding box
virtual quaternion_t aesop::PhysicsObject::getOrientation | ( | void | ) | const throw () [pure virtual, inherited] |
object's current orientation (in Euler angles)
virtual point3d_t aesop::PhysicsObject::getLinearVelocity | ( | void | ) | const throw () [pure virtual, inherited] |
object's current linear velocity
virtual point3d_t aesop::PhysicsObject::getAngularVelocity | ( | void | ) | const throw () [pure virtual, inherited] |
object's current angular velocity
virtual void aesop::PhysicsObject::setOrientation | ( | IN const quaternion_t & | orient | ) | [pure virtual, inherited] |
virtual void aesop::PhysicsObject::setLinearVelocity | ( | IN const point3d_t & | linear | ) | [pure virtual, inherited] |
virtual void aesop::PhysicsObject::setAngularVelocity | ( | IN const point3d_t & | angular | ) | [pure virtual, inherited] |
virtual void aesop::PhysicsObject::requestMove | ( | IN const point3d_t & | delta, | |
IN float | dt | |||
) | [pure virtual, inherited] |
can request motion in a particular direction over a time interval
virtual void aesop::PhysicsObject::setPosition | ( | IN const point3d_t & | pos | ) | [pure virtual, inherited] |
jump to a new location, regardless of collisions
virtual float aesop::PhysicsObject::getMass | ( | void | ) | const throw () [pure virtual, inherited] |
get mass (zero means infinite--immobile)
virtual void aesop::PhysicsObject::iterateOverlappingObjects | ( | IN object_iteration_fn | fn, | |
IN void * | context | |||
) | [pure virtual, inherited] |
iterate over all other overlapping objects
virtual void aesop::PhysicsObject::setUserPointer | ( | void * | userPointer | ) | throw () [pure virtual, inherited] |
set a context pointer
virtual void* aesop::PhysicsObject::getUserPointer | ( | void | ) | const throw () [pure virtual, inherited] |
retrieve user pointer
smart_ptr< PhysicsObject > aesop::getPhysicsObjectById | ( | IN dword_t | id | ) |
access to static registry of physics objects
void aesop::physics_meta_t::clear | ( | void | ) | throw () [inline, inherited] |
Definition at line 208 of file aesop-physics.h.
void aesop::physics_meta_t::dump | ( | IN const char * | msg | ) | const throw () [inline, inherited] |
Definition at line 213 of file aesop-physics.h.
smart_ptr< PhysicsObject > aesop::createObject | ( | IN const physics_meta_t & | meta, | |
IN const placement_t & | placement | |||
) |
create an object from a physics meta and instance information
void aesop::PhysicsWorld::collision_record_t::clear | ( | void | ) | throw () [inline, inherited] |
Definition at line 252 of file aesop-physics.h.
aesop::PhysicsWorld::~PhysicsWorld | ( | void | ) | throw () [virtual, inherited] |
Definition at line 48 of file aesop-physics.cpp.
virtual void aesop::PhysicsWorld::addObject | ( | IN smart_ptr< PhysicsObject > & | o | ) | [pure virtual, inherited] |
virtual void aesop::PhysicsWorld::removeObject | ( | IN PhysicsObject * | obj | ) | [pure virtual, inherited] |
virtual long aesop::PhysicsWorld::getObjectCount | ( | void | ) | throw () [pure virtual, inherited] |
virtual void aesop::PhysicsWorld::tick | ( | IN float | seconds | ) | [pure virtual, inherited] |
virtual void aesop::PhysicsWorld::getObjectIterator | ( | OUT object_iterator_t & | i | ) | [pure virtual, inherited] |
virtual bool aesop::PhysicsWorld::getNextObject | ( | IO object_iterator_t & | i, | |
OUT smart_ptr< PhysicsObject > & | obj | |||
) | [pure virtual, inherited] |
virtual void aesop::PhysicsWorld::getCollisionIterator | ( | OUT collision_iterator_t & | i | ) | [pure virtual, inherited] |
virtual bool aesop::PhysicsWorld::getNextCollision | ( | IO collision_iterator_t & | i, | |
OUT collision_record_t & | cr | |||
) | [pure virtual, inherited] |
virtual smart_ptr<PhysicsObject> aesop::PhysicsWorld::rayTest | ( | IN const point3d_t & | from, | |
IN const point3d_t & | to | |||
) | [pure virtual, inherited] |
smart_ptr< PhysicsWorld > aesop::PhysicsWorld::create | ( | IN const Datahash * | params | ) | [static, inherited] |
Definition at line 1653 of file aesop-physics.cpp.
smart_ptr< PhysicsObject > aesop::getObjectHitFromPlacement | ( | IN PhysicsWorld * | world, | |
IN const placement_t & | placement, | |||
IN float | half_extent | |||
) |
given an object at the given location and view direction (orientation), what is it looking at? (First object hit by a ray cast) Can return null!
void aesop::dumpWorld | ( | IN PhysicsWorld * | world | ) | throw () |
expensive debugging function
smart_ptr<PhysicsShape> aesop::physics_meta_t::shape [inherited] |
Definition at line 221 of file aesop-physics.h.
float aesop::physics_meta_t::mass [inherited] |
Definition at line 222 of file aesop-physics.h.
int aesop::physics_meta_t::objectFlags [inherited] |
Definition at line 223 of file aesop-physics.h.
smart_ptr<PhysicsObject> aesop::PhysicsWorld::collision_record_t::obj1 [inherited] |
Definition at line 258 of file aesop-physics.h.
smart_ptr<PhysicsObject> aesop::PhysicsWorld::collision_record_t::obj2 [inherited] |
Definition at line 259 of file aesop-physics.h.