cObject Class Reference

#include <cObject.h>

Inheritance diagram for cObject:
cAlert cBuilding cMech cPadmap cPlanetmap cScatterfield cTile cTree

List of all members.

Public Member Functions

 cObject (cObject *original)
bool anyRoles (std::set< OID > *test)
bool allRoles (std::set< OID > *test)
bool hasRole (OID role)
 Check wether this Object is playing the given role.
void addRole (OID role, rRole *roleobj=NULL)
 Add a role this objects has to play.
void remRole (OID role, bool deleteobj=false)
 Remove a role this object wont play anymore.
virtual void onSpawn ()
 Called right after object was spawned into the world.
virtual void onMessage (void *message)
 Called when a message was sent to (a group) this object (is a member of).
virtual void onFrag ()
 Called right after object has been removed from object list and index.
virtual void multEyeMatrix ()
 glMultiplies in the Object's camera matrix.
virtual void setAsAudioListener ()
 Sets this Object's location, orientation and vel. as Audio listener.
virtual void animate (float dt)
 Advance internal timers,animation state and pose, check gamepad.
virtual void transform ()
 Precalculate neccessary transformations - matrices, mountpoints, pos ..
virtual void drawSolid ()
 Render solid non-translucent parts of the object.
virtual void drawEffect ()
 Render translucent object-parts and visual effects.
virtual void drawHUD ()
 Render HUD-contents as seen when looking through the objects-eyes.
virtual void damageByParticle (float *localpos, float damage, cObject *enactor=NULL)
virtual float constrainParticle (float *worldpos, float radius=0.0f, float *localpos=NULL, cObject *enactor=NULL)
virtual OID enemyNearby ()
 Search through world-database to find nearest enemy, returns OID.
virtual OID disturbedBy ()
 If object was disturbed by an enemy this may return it's OID.
virtual float inDestinationRange ()
 Has this object reached it's destination position? Fuzzyvalue in [0,1].
virtual float inMeeleRange ()
 Is this object in "hand-to-hand"-combat range? Fuzzyvalue in [0,1].
virtual float inWeaponRange ()
 Is this object in firing range. Fuzzyvalue in [0,1].
virtual float inTargetRange ()
 Is this object in targeting/visual distance? Fuzzyvalue in [0,1].
virtual void do_moveTowards ()
 Move towards move-target as fast as possible.
virtual void do_moveNear ()
 Move to move-target throttling down as target comes near.
virtual void do_aimAt ()
 Aim at aim-target.
virtual void do_fireAt ()
 Fire at aim-target - ie. just fire where object is aiming at right now.
virtual void do_idle ()
 Nothing to do for object - possibly idle animation.
virtual void do_aimFor (OID target)
 Set aim towards given object - ie. set aim-target.
virtual void do_moveFor (float *dest)
 Set movement towards given location. if aim target NULL then same.

Static Public Member Functions

static void registerRole (OID id, std::string name)

Public Attributes

rBasebase
rNameablenameable
rSocialisedsocialised
rTraceabletraceable
rCollideablecollideable
rDamageabledamageable
rEntityentity
std::map< OID, rRole * > roles
std::set< OID > roleset

Static Public Attributes

static int ENABLE_TEXTURE_3D = 1
 Switches 3D-Texturing on and off.
static std::map< std::string, OID > roleids
static std::map< OID, std::string > rolenames

Friends

class cWorld

Detailed Description

Generic Game-Object (Object with Roles) which collects as much common attributes as needed by the different roles and as needed by World-Filtering (Worldsense for subclasses implementing the roles). This object does again hold as much methods as needed but without (real) implementation (which is subclass-responsibility). Nevertheless every method has an empty body or a body returning some default value, so that callers need not care about the kind of the object (roles) too much.


Member Function Documentation

virtual float cObject::constrainParticle ( float *  worldpos,
float  radius = 0.0f,
float *  localpos = NULL,
cObject enactor = NULL 
) [inline, virtual]

Constrain the given world position particle (with radius) to the object boundary hull ie. place the worldpos to the nearest boundary hull position if the worldpos is inside the object's hull. localpos delivers in case of impact the local position relative to the object of the corrected worldpos. input location vector in world coordinates. radius of the checked particle in world dimensions. output adjusted location vector.

Returns:
the intrusion depth.

Reimplemented in cAlert, cBuilding, cPadmap, cMech, cPlanetmap, and cTree.

virtual void cObject::damageByParticle ( float *  localpos,
float  damage,
cObject enactor = NULL 
) [inline, virtual]

Deal damage to the object with the damage arriving at or from the given local position ie. relative to the object itself. input location vector relative to the object. amount of damage to deal to the object. the object dealing the damage to this object.

Reimplemented in cBuilding, and cMech.


The documentation for this class was generated from the following files:
Generated on Fri Aug 27 16:01:36 2010 for Linwarrior 3D by  doxygen 1.6.3