#include <cMech.h>
Classes | |
struct | rComputerised |
struct | rRigged |
Public Member Functions | |
cMech (float *pos=NULL, float *rot=NULL) | |
virtual void | onMessage (void *message) |
Called when a message was sent to (a group) this object (is a member of). | |
virtual void | onSpawn () |
Called right after object was spawned into the world. | |
void | multEyeMatrix () |
glMultiplies in the Object's camera matrix. | |
void | setAsAudioListener () |
Sets this Object's location, orientation and vel. as Audio listener. | |
void | animatePhysics (float spf) |
void | poseRunning (float spf) |
void | poseJumping (float spf) |
void | ChassisLR (float radians) |
void | ChassisUD (float radians) |
float | TowerLR (float radians) |
void | TowerUD (float radians) |
void | fireAllWeapons () |
void | fireWeapon (unsigned n) |
void | mountWeapon (char *point, cWeapon *weapon, bool add=true) |
virtual void | animate (float spf) |
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) |
float | constrainParticleToWorld (float *worldpos, float radius=0.0f) |
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. | |
Protected Types | |
enum | { MAX_CAMERAMODES = 6 } |
# of camera modes: ISO C++ forbids const int with initialization >:( | |
Protected Attributes | |
std::vector< cWeapon * > | mWeapons |
int | mCurrentWeapon |
cExplosion | mExplosion |
float | mBse [3] |
float | mTwr [3] |
float | mJetOn |
float | mThrottle |
int | mCameraState |
Current Camera mode, negative number is indicating transition. | |
rComputerised * | computerised |
rRigged * | rigged |
Static Protected Attributes | |
static int | sInstances = 0 |
Instance counter. | |
static long | sTextures [1] |
Texture Binds shared between instances. | |
Friends | |
class | cWepcom |
class | cForcom |
Models Mechlike Objects.
float cMech::constrainParticle | ( | float * | worldpos, | |
float | radius = 0.0f , |
|||
float * | localpos = NULL | |||
) | [virtual] |
Constrain the given world position particle or given 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.
Reimplemented from cObject.