#include <cBuilding.h>
Public Member Functions | |
cBuilding (int x, int y, int z, int rooms_x, int rooms_y, int rooms_z) | |
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 void | onSpawn () |
Called right after object was spawned into the world. | |
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. | |
Protected Attributes | |
bool | dirtyBase |
Need to re-setup base matrix for explosion (true/false)? | |
float | baseMatrix [16] |
Base matrix for explosion ie. at center. | |
cExplosion | explosionObject |
Explosion to be triggered on destruction of the building. | |
float | buildingRooms [3] |
Dimensions of the building. | |
Static Protected Attributes | |
static int | sInstances = 0 |
static std::map< int, long > | sTextures |
Models a building of varring size.
float cBuilding::constrainParticle | ( | float * | worldpos, | |
float | radius = 0.0f , |
|||
float * | localpos = NULL , |
|||
cObject * | enactor = NULL | |||
) | [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.
Reimplemented from cObject.
void cBuilding::damageByParticle | ( | float * | localpos, | |
float | damage, | |||
cObject * | enactor = NULL | |||
) | [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 from cObject.