IVehicleDamageBehavior

Vehicle Damage Behavior interface

C++
struct IVehicleDamageBehavior : public IVehicleObject {
};
File

IVehicleSystem.h

Description

Interface used to implement a damage behavior for vehicles.

IVehicleDamageBehavior::GetId Method

Returns the id of the vehicle object

C++
virtual TVehicleObjectId GetId() = 0;
IVehicleDamageBehavior::GetMemoryUsage Method
C++
virtual void GetMemoryUsage(ICrySizer * pSizer) const = 0;
IVehicleDamageBehavior::Init Method

Initializes the damage behavior

C++
virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table) = 0;
Parameters
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
Returns

A boolean which indicate if the function succeeded

Description

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.

IVehicleDamageBehavior::OnDamageEvent Method

Sends an event message to the damage behavior

C++
virtual void OnDamageEvent(EVehicleDamageBehaviorEvent event, const SVehicleDamageBehaviorEventParams& params) = 0;
Parameters
Parameters
Description
EVehicleDamageBehaviorEvent event
event type
value
a float value used for the event
Description

Used to send different events to the damage behavior implementation. The EVehicleDamageBehaviorEvent enum lists all the event which a damage behavior can receive.

IVehicleDamageBehavior::Release Method

Releases the damage behavior

C++
virtual void Release() = 0;
Description

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;".

IVehicleDamageBehavior::Reset Method

Resets the damage behavior

C++
virtual void Reset() = 0;
Description

Used to reset a damage behavior to its initial state. Is usually being called when the Editor enter and exit the game mode.

IVehicleDamageBehavior::Serialize Method

Serialize the vehicle object

C++
virtual void Serialize(TSerialize ser, EEntityAspects aspects) = 0;
IVehicleDamageBehavior::Update Method

Update the vehicle object

C++
virtual void Update(const float deltaTime) = 0;
Parameters
Parameters
Description
const float deltaTime
total time for the update, in seconds
Description

Used to handle any time sensitive updates. In example, rotation for turret parts is implemented in this function.