Vehicle Damage Behavior interface
struct IVehicleDamageBehavior : public IVehicleObject { };
IVehicleSystem.h
Interface used to implement a damage behavior for vehicles.
Returns the id of the vehicle object
virtual TVehicleObjectId GetId() = 0;
virtual void GetMemoryUsage(ICrySizer * pSizer) const = 0;
Initializes the damage behavior
virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table) = 0;
Parameters |
Description |
IVehicle* pVehicle |
pointer to the vehicle instance for which will own this damage behavior |
const CVehicleParams& table |
script table which hold all the parameters |
A boolean which indicate if the function succeeded
Will initialize a newly allocated instance of the damage behavior class according to the parameter table which is passed. This function should only be called once.
Sends an event message to the damage behavior
virtual void OnDamageEvent(EVehicleDamageBehaviorEvent event, const SVehicleDamageBehaviorEventParams& params) = 0;
Parameters |
Description |
EVehicleDamageBehaviorEvent event |
event type |
value |
a float value used for the event |
Used to send different events to the damage behavior implementation. The EVehicleDamageBehaviorEvent enum lists all the event which a damage behavior can receive.
Releases the damage behavior
virtual void Release() = 0;
Used to release a damage behavior, usually at the same time than the vehicle is being released. A damage behavior implementation should then deallocate any memory or object that it dynamically allocated. In addition, the part implementation or its base class should include "delete this;".
Resets the damage behavior
virtual void Reset() = 0;
Used to reset a damage behavior to its initial state. Is usually being called when the Editor enter and exit the game mode.
Serialize the vehicle object
virtual void Serialize(TSerialize ser, EEntityAspects aspects) = 0;
Update the vehicle object
virtual void Update(const float deltaTime) = 0;
Parameters |
Description |
const float deltaTime |
total time for the update, in seconds |
Used to handle any time sensitive updates. In example, rotation for turret parts is implemented in this function.