Emergency 20 Dokumentation  4.2.0
em5::VehicleComponent Class Reference

Vehicle component base class. More...

#include <VehicleComponent.h>

Inheritance diagram for em5::VehicleComponent:
em5::DamageComponent qsf::game::PrototypeContainer qsf::Component qsf::JobProxyMovableObjectRenderingListener qsf::InheritedObject qsf::WeakPtrTarget qsf::MovableObjectRenderingListener qsf::Object em5::BoatComponent em5::HelicopterComponent em5::RoadVehicleComponent

Public Types

typedef std::vector< uint64EntityIdArray
 Array of entity IDs. More...
 
typedef boost::container::flat_map< DoorComponent::DoorType, std::vector< uint64 > > DoorMap
 
- Public Types inherited from em5::DamageComponent
enum  DamageState {
  DAMAGESTATE_INTACT, DAMAGESTATE_DAMAGE_LEVEL1, DAMAGESTATE_DAMAGE_LEVEL2, DAMAGESTATE_DESTROYED,
  DAMAGESTATE_INVALID
}
 
- Public Types inherited from qsf::Component
enum  TransformChangeFlag {
  TRANSFORM_CHANGE_POSITION = 0x01, TRANSFORM_CHANGE_ROTATION = 0x02, TRANSFORM_CHANGE_SCALE = 0x04, TRANSFORM_CHANGE_TRANSFORM = 0x07,
  TRANSFORM_CHANGE_FOR_SIMULATION = 0x08, TRANSFORM_CHANGE_FOR_ANIMATION = 0x10
}
 
typedef BitFlagSet< uint8, TransformChangeFlagTransformChangeFlags
 
- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 
- Public Types inherited from qsf::MovableObjectRenderingListener
enum  State { SLEEPING, AWAKE }
 State of the listener. More...
 

Public Member Functions

 VehicleComponent (qsf::Prototype *prototype)
 Default constructor. More...
 
virtual ~VehicleComponent ()
 Destructor. More...
 
uint64 getSpecialEntity () const
 Get/set special child entity ID. More...
 
void setSpecialEntity (uint64 specialEntityId)
 
DoorComponent::DoorType getMainDoorType () const
 Get/set the mainly used door type, used for entering/leaving the vehicle. More...
 
void setMainDoorType (DoorComponent::DoorType mainDoorType)
 
void openDoor (DoorComponent::DoorType doorType, bool open)
 Open/close the doors with the given from the vehicle. More...
 
bool areAllDoorsOfTypeInState (DoorComponent::DoorType doorType, DoorComponent::DoorState doorState, float percent=1.0f) const
 Check all doors of the type are in the given state. More...
 
bool getFirstDoorTransformByType (uint32 doorType, qsf::Transform &outDoorTransform) const
 
qsf::EntityfindNearestDoor (DoorComponent::DoorType doorType, const glm::vec3 &targetPoint) const
 
const std::vector< uint64 > & getVehicleDoors () const
 
const std::vector< uint64 > & getVehicleDoorIdsByType (DoorComponent::DoorType doorType) const
 
uint64 getDriverVehicleDoorId () const
 
void closeAllDoors ()
 
void personsFleeFromFire (bool allowSpawning)
 Let persons flee from this burning vehicle. More...
 
void trapPersons (FreeplayEvent *freeplayEvent=nullptr, const std::vector< uint32 > &injuryPool=std::vector< uint32 >())
 Trap persons inside this vehicle. More...
 
float getLifeEnergy () const
 Get vehicle life energy. More...
 
void applyDamage (float damageValue, FreeplayEvent *freeplayEvent=nullptr)
 Apply damage to the vehicle. Or repair with negative damageValues. More...
 
bool canBeRepaired () const
 Check if vehicle can be repaired. More...
 
bool isMovable () const
 Return "true" if the vehicle is allowed to move. More...
 
bool getCanBeCut () const
 Check if the vehicle can be cut using the rescue scissors. More...
 
void setCanBeCut (bool canBeCut, FreeplayEvent *freeplayEvent=nullptr)
 Set whether the vehicle can be cut using the rescue scissors. More...
 
void setCanBeRepaired (bool canBeRepaired, FreeplayEvent *freeplayEvent=nullptr)
 Set whether the vehicle can be repaired by an engineer. More...
 
qsf::Time getCutDuration () const
 Gets the duration needed to cut the vehicle open. More...
 
void setCutDuration (const qsf::Time &duration)
 Configures the duration needed to cut the vehicle open. More...
 
bool getCanBeTowed () const
 Check if the vehicle can be picked up by the towcar. More...
 
bool getCanBeTowedFlag () const
 Check if the vehicle's "CAN_BE_TOWED" flag is set (this is only a part of the check whether the vehicle can be towed) More...
 
void setCanBeTowed (bool canBeTowed, FreeplayEvent *freeplayEvent=nullptr)
 Set whether the vehicle can be picked up by the towcar. More...
 
bool getCanReallyNotBeTowed () const
 Check if the vehicle is set as totally untowable. More...
 
void setCanReallyNotBeTowed (bool canReallyNotBeTowed, FreeplayEvent *freeplayEvent=nullptr)
 Set whether the vehicle can be picked up by the towcar. More...
 
bool getMustBeRecovered () const
 Check if the vehicle can and must be recovered by the crane vehicle. More...
 
void setMustBeRecovered (bool mustBeRecovered, FreeplayEvent *freeplayEvent=nullptr)
 Set whether the vehicle can and must be recovered by the crane vehicle. More...
 
void hideParticleChildrenAtMapSave ()
 
bool isInvincible () const
 Set/Get if this vehicle can be damaged or not. More...
 
void setInvincible (bool invincible)
 
bool getIsParkingEntity () const
 
void setIsParkingEntity (bool isParkingEntity)
 
void stopActions () const
 Stop possible actions. More...
 
void precalculateDoorsToEntitiesMap () const
 
const float getFireResistance () const
 Returns the fire resistance. More...
 
const float getDamageResistance () const
 Returns the damage resistance. More...
 
std::string getResistancesAsString () const
 
void setResistancesByString (const std::string &resistances)
 
bool getIsOnEmergencyOperations () const
 
void setIsOnEmergencyOperations (bool enable)
 
const qsf::AssetProxygetSignalAudioAsset () const
 
void setSignalAudioAsset (const qsf::AssetProxy &signalSound)
 
bool isSirenEnabled () const
 
void setSirenEnabled (bool sirenEnabled)
 
void playSirenOnce ()
 Play siren. More...
 
void playSirenLoop ()
 
void stopSiren ()
 
void stopSirenLoop ()
 
AudioProxygetSirenSFX ()
 
virtual bool getDoorPositions (DoorComponent::DoorType doorType, std::vector< qsf::Transform > &outDoorTransform, const qsf::Transform &worldTransform) const
 
virtual bool getDoorPosition (uint32 doorIndex, glm::vec3 &outDoorPosition) const
 
virtual void receiveDamage (float amount, damagetype::DamageType damageType, qsf::Component *sender=nullptr) override
 
virtual bool isReadyForCleanup () const override
 Check if vehicle can be reset by cleanup. More...
 
virtual bool onStartup () override
 Startup the component. More...
 
virtual void onShutdown () override
 Shutdown the component. More...
 
virtual void onSetSimulating (bool simulating) override
 Set whether or not the component is in simulating mode. More...
 
virtual void serialize (qsf::BinarySerializer &serializer) override
 Serialize or deserialize the component using a binary serializer. More...
 
- Public Member Functions inherited from em5::DamageComponent
 DamageComponent (qsf::Prototype *prototype)
 Constructor. More...
 
virtual ~DamageComponent ()
 Destructor. More...
 
DamageState getDamageState () const
 
void setDamageState (DamageState damageState)
 
float getFireGlowIntensity () const
 
void setFireGlowIntensity (float fireGlowIntensity)
 
bool getDamageSimulation () const
 
void setDamageSimulation (bool damageSimulation)
 
const FireComponentgetBurningFireComponent () const
 Helper function to retrieve a burning FireComponent with the highest energy. More...
 
float getFireLifePercentage () const
 
void showExplosionFireParticles ()
 Show the explosion fire particles without doing any damage. More...
 
void setFireExtinguishBlocked (bool blocked)
 Set if we want to block the fire from being extinguished. More...
 
virtual bool isIntact () const
 
virtual bool isDamaged () const
 
virtual bool isDamagedLevel1 () const
 
virtual bool isDamagedLevel2 () const
 
virtual bool isDestroyed () const
 
virtual bool isBurning () const
 
virtual bool checkReceiveDamage (damagetype::DamageType damageType, qsf::Component *sender=nullptr)
 
virtual void cleanup ()
 
- Public Member Functions inherited from qsf::Component
virtual ~Component ()
 Destructor. More...
 
PrototypegetPrototype () const
 Return the prototype this component is in. More...
 
EntitygetEntity () const
 Return a reference to the entity this component is in. More...
 
uint32 getId () const
 Return the unique component identifier. More...
 
ComponentManagergetComponentManager () const
 Return the component manager that's responsible for this component instance. More...
 
ComponentCollectiongetComponentCollection () const
 Return the component collection that's responsible for this component instance. More...
 
bool isSimulating () const
 Return whether or not the component is in simulating mode. More...
 
bool isActive () const
 Return whether or not the component is considered to be active. More...
 
void setActive (bool active)
 Set whether or not the component is considered to be active. More...
 
bool isDebug () const
 Return whether or not the component is considered to be in debug mode. More...
 
bool isHidden () const
 Return whether or not the component is hidden. More...
 
void setHidden (bool hidden)
 Set whether or not the component is hidden. More...
 
bool isGloballyHidden () const
 Return whether or not the component is globally hidden. More...
 
void setGloballyHidden (bool globallyHidden)
 Set whether or not the component is globally hidden. More...
 
bool isReallyHidden () const
 Return whether or not the component is really hidden. More...
 
bool startup (bool ownerIsRunning)
 Startup the component. More...
 
bool isRunning () const
 Return whether or not the component is up-and-running. More...
 
void shutdown ()
 Shutdown the component. More...
 
uint64 getPrototypeId () const
 Return the ID of the prototype this component is in. More...
 
uint64 getEntityId () const
 Return the ID of the entity this component is in. More...
 
virtual void onInvalidation ()
 Invalidate the component. More...
 
virtual void setDebug (bool debugMode)
 Set whether or not the component is considered to be in debug mode. More...
 
- Public Member Functions inherited from qsf::InheritedObject
void copyPropertyOverrideStateFrom (const InheritedObject &object, bool add=false)
 
void setAllPropertyOverrideFlags (bool value)
 
void autoCreatePropertyOverrideState ()
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const override
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const override
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState) override
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 
- Public Member Functions inherited from qsf::JobProxyMovableObjectRenderingListener
 JobProxyMovableObjectRenderingListener ()
 Constructor. More...
 
virtual ~JobProxyMovableObjectRenderingListener ()
 Destructor. More...
 
const TimegetNonvisibleUpdateTimeout () const
 Return the nonvisible update timeout. More...
 
void setNonvisibleUpdateTimeout (const Time &nonvisibleUpdateTimeout)
 Set the nonvisible update timeout. More...
 
- Public Member Functions inherited from qsf::MovableObjectRenderingListener
 MovableObjectRenderingListener ()
 Constructor. More...
 
virtual ~MovableObjectRenderingListener ()
 Destructor. More...
 
bool isMovableObjectRenderingListenerRegistered () const
 Return whether or not the movable object rendering listener is registered. More...
 
State getState () const
 Return the state of the listener. More...
 
- Public Member Functions inherited from qsf::game::PrototypeContainer
 PrototypeContainer (Prototype &prototype)
 Constructor. More...
 
virtual ~PrototypeContainer ()
 Destructor. More...
 
const LinkProxygetLinkProxy () const
 Get the link proxy instance holding references to all connected container links. More...
 
const boost::container::flat_map< LinkAnchorId, ContainerLink * > & getLinks () const
 Get the map of all connected container links. More...
 
bool isInContainer (Prototype &prototype) const
 Check whether the given prototype is inside this container. More...
 
uint32 getContainerType (Prototype &prototype) const
 Get the container type of a contained prototype, or getUninitialized<uint32>() if it is not contained. More...
 
void addToContainer (Prototype &prototype, uint32 category)
 Add the given prototype to this container. More...
 
bool removeFromContainer (const Prototype &prototype)
 Remove the given prototype from this container. More...
 
std::vector< Entity * > getAllLinksByContainerType (uint32 containerType) const
 
void serialize (BinarySerializer &serializer)
 Serialize the list of contained entities. More...
 

Static Public Attributes

static const uint32 COMPONENT_ID
 "em5::VehicleComponent" unique component ID More...
 
static const uint32 CATEGORY_PASSENGER
 "0" unique identifier for the passenger door category More...
 
static const uint32 CATEGORY_PERSONNEL
 "1" unique identifier for the personnel door category More...
 
static const uint32 CATEGORY_VEHICLE
 "2" unique identifier for the vehicle door category – TODO(fw): What is this for actually? More...
 
- Static Public Attributes inherited from em5::DamageComponent
static const uint32 COMPONENT_ID
 "em5::DamageComponent" unique component ID More...
 
static const uint32 DAMAGE
 "Damage" unique class property ID inside the class More...
 
static const uint32 DAMAGE_STATE
 "DamageState" unique class property ID inside the class More...
 
static const uint32 DAMAGE_SIMULATION
 "DamageSimulation" unique class property ID inside the class More...
 
- Static Public Attributes inherited from qsf::Component
static const uint32 COMPONENT_ID
 "qsf::Component" unique component ID More...
 

Protected Types

enum  InternalFlags {
  CAN_REALLY_NOT_BE_TOWED, CAN_BE_CUT, CAN_BE_TOWED, MUST_BE_RECOVERED,
  CAN_BE_REPAIRED
}
 
typedef qsf::EnumBitmask< uint8, InternalFlagsInternalFlagSet
 

Protected Member Functions

virtual qsf::ComponentgetMovableObjectRenderingListenerComponent () override
 Return the component the listener will spy on. More...
 
virtual void onObjectRenderingStartup () override
 Called when an OGRE movable object is about to be rendered for the first time after it has not been rendered for some time. More...
 
virtual void onUpdateMovableObjectRenderingJob (const qsf::JobArguments &jobArguments) override
 Main update function that is passed to the job manager. More...
 
virtual void onSetDamageState (DamageState damageState) override
 
virtual void onSetIntact () override
 
virtual void onSetDamagedLevel1 () override
 
virtual void onSetDamagedLevel2 () override
 
virtual void onSetDestroyed () override
 
virtual void onSetFireLifePercentage (float fireLifePercentage) override
 
virtual void onFireStarted (FreeplayEvent *freeplayEvent) override
 
virtual void onFireStopped () override
 In case the fire component is not a null pointer, only explosions of that fire component explode, otherwise explode all. More...
 
virtual void onExplosion (FireComponent *fireComponent) override
 
virtual void restoreEntitiesFromPrefab (const qsf::Prototype &prototype, std::unordered_map< uint64, uint64 > &prototypeIdMap)
 
virtual void initializePrefabClearComponentExceptions ()
 
InternalFlagSetgetInternalFlags ()
 
void setVehiclePrefab (const qsf::AssetProxy &prefabAssetProxy)
 
void cloneEntitiesFromPrefabByComponentId (qsf::Map &map, const qsf::Entity &parentEntity, const std::vector< uint32 > &componentIds, const qsf::LinkComponent &prototypeLinkComponent, std::unordered_map< uint64, uint64 > &prototypeIdMap)
 
void cloneEntitiesFromPrefab (qsf::Map &map, const qsf::Entity &parentEntity, const std::vector< uint64 > &sourceEntityIds, std::vector< uint64 > &destinationEntityIds, const qsf::LinkComponent &prototypeLinkComponent, std::unordered_map< uint64, uint64 > &prototypeIdMap)
 
void setDamageOverlaysActive (bool smutActive, bool emissiveActive)
 
void switchToDamagePrefab (bool prefabActive)
 
void switchFromCombinedToNormalPrefab ()
 
- Protected Member Functions inherited from em5::DamageComponent
virtual void onFireDamageReceived (float amount, qsf::Component *sender, bool damageJustStarted)
 
virtual void setCustomParametersForFireGlowAndSmutOverlay (const qsf::MeshComponent &meshComponent)
 
void setFireStateIntact ()
 
void setFireStateDestroyed ()
 
void setFireLifePercentage (float fireLifePercentage)
 
void updateTintableMesh ()
 
void setupFireFadeAnimation ()
 
- Protected Member Functions inherited from qsf::Component
 Component (Prototype *prototype)
 Constructor. More...
 
void promotePropertyChange (uint32 propertyId)
 A component property value was changed. More...
 
template<typename T , typename S >
bool assignAndPromoteChange (T &variable, const S &newValue, uint32 propertyId)
 Comfort function for updating an exported member variable and promoting any change that happened. More...
 
void setRegisterForSimulationTransformChanges (bool enable)
 Register or unregister this component as simulation transform listener. More...
 
void setRegisterForAnimationTransformChanges (bool enable)
 Register or unregister this component as animation transform listener. More...
 
virtual const ObjectgetPropertyDefaultsProvider () const override
 
virtual bool ignoreOwnerRunningState () const
 Return whether or not the component will only startup if the owner is in running state. More...
 
virtual bool implementsOnComponentPropertyChange () const
 Signal whether this component needs the "onComponentPropertyChange" callback at all. More...
 
virtual void onComponentPropertyChange (const Component &component, uint32 propertyId)
 Called in case a component property value was changed. More...
 
virtual void onComponentTransformChange (const Transform &transform, TransformChangeFlags flags)
 Called in case a component transformation value was changed. More...
 
virtual void onSetActive (bool active)
 Set whether or not the component is considered to be active. More...
 
virtual void onSetDebug (bool debug)
 Set whether or not the component is considered to be in debug mode. More...
 
virtual void onSetHidden (bool hidden)
 Set whether or not the component is considered to be hidden. More...
 
- Protected Member Functions inherited from qsf::InheritedObject
 InheritedObject ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 
 ~WeakPtrTarget ()
 Destructor. More...
 
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
 
void operator= (const WeakPtrTarget &other)
 Copy operator. More...
 
- Protected Member Functions inherited from qsf::JobProxyMovableObjectRenderingListener
virtual void onObjectRendering (const Component &component, const Ogre::Camera &ogreCamera) override
 Called when an OGRE movable object of the camera to be used for rendering. More...
 
virtual void onObjectRenderingShutdown () override
 Called when an OGRE movable object is no longer be rendered for some time. More...
 
- Protected Member Functions inherited from qsf::MovableObjectRenderingListener
virtual void registerMovableObjectRenderingListener ()
 Register movable object rendering listener. More...
 
virtual void unregisterMovableObjectRenderingListener ()
 Unregister movable object rendering listener. More...
 
virtual void onObjectDestroyed ()
 Movable object has been destroyed. More...
 
- Protected Member Functions inherited from qsf::game::PrototypeContainer
void enableSimulatingMode (bool simulating)
 Enable simulating mode. More...
 

Protected Attributes

EntityIdArray mVehicleDoorsIds
 
std::vector< uint32mComponentExceptionIds
 
- Protected Attributes inherited from em5::DamageComponent
float mPeakFireEnergyPercent
 
- Protected Attributes inherited from qsf::InheritedObject
std::bitset< 128 > mPropertyOverrideFlags
 One bit for each property; if set, the property is overridden. More...
 
- Protected Attributes inherited from qsf::JobProxyMovableObjectRenderingListener
JobProxy mAnimationJobProxy
 Regular animation job proxy; for updates once a frame. More...
 
- Protected Attributes inherited from qsf::MovableObjectRenderingListener
bool mAllowRegistration
 Actually only for internal builds (additional check to find erroneous behavior), but we need to make sure end-user SDK is the same with or without ENDUSER define. More...
 

Static Protected Attributes

static std::vector< uint64EMPTY_ENTITY_VECTOR
 

Additional Inherited Members

- Static Protected Member Functions inherited from em5::DamageComponent
static void exchangeDamageMaterials (qsf::Entity &entity, bool setDamaged)
 
static qsf::GlobalAssetId getDamageMaterialName (qsf::GlobalAssetId originalMaterialGlobalAssetId)
 

Detailed Description

Vehicle component base class.

Member Typedef Documentation

typedef boost::container::flat_map<DoorComponent::DoorType, std::vector<uint64> > em5::VehicleComponent::DoorMap

Array of entity IDs.

Member Enumeration Documentation

Enumerator
CAN_REALLY_NOT_BE_TOWED 

The vehicle can not be towed under any circumstances.

CAN_BE_CUT 

Can be cut open with the fireman's rescue scissors.

CAN_BE_TOWED 

Can be picked up by the tow car.

MUST_BE_RECOVERED 

Has to be recovered by the crane vehicle before any other interaction.

CAN_BE_REPAIRED 

Can be repaired by an engineer.

Constructor & Destructor Documentation

em5::VehicleComponent::VehicleComponent ( qsf::Prototype prototype)
inlineexplicit

Default constructor.

Parameters
[in]prototypeThe prototype this component is in, no null pointer allowed
em5::VehicleComponent::~VehicleComponent ( )
inlinevirtual

Destructor.

Member Function Documentation

void em5::VehicleComponent::applyDamage ( float  damageValue,
FreeplayEvent freeplayEvent = nullptr 
)

Apply damage to the vehicle. Or repair with negative damageValues.

bool em5::VehicleComponent::areAllDoorsOfTypeInState ( DoorComponent::DoorType  doorType,
DoorComponent::DoorState  doorState,
float  percent = 1.0f 
) const

Check all doors of the type are in the given state.

Parameters
[in]doorTypeDoor type to check
[in]doorStateState of the door
bool em5::VehicleComponent::canBeRepaired ( ) const

Check if vehicle can be repaired.

void em5::VehicleComponent::cloneEntitiesFromPrefab ( qsf::Map map,
const qsf::Entity parentEntity,
const std::vector< uint64 > &  sourceEntityIds,
std::vector< uint64 > &  destinationEntityIds,
const qsf::LinkComponent prototypeLinkComponent,
std::unordered_map< uint64, uint64 > &  prototypeIdMap 
)
protected
void em5::VehicleComponent::cloneEntitiesFromPrefabByComponentId ( qsf::Map map,
const qsf::Entity parentEntity,
const std::vector< uint32 > &  componentIds,
const qsf::LinkComponent prototypeLinkComponent,
std::unordered_map< uint64, uint64 > &  prototypeIdMap 
)
protected
void em5::VehicleComponent::closeAllDoors ( )
qsf::Entity* em5::VehicleComponent::findNearestDoor ( DoorComponent::DoorType  doorType,
const glm::vec3 &  targetPoint 
) const
bool em5::VehicleComponent::getCanBeCut ( ) const

Check if the vehicle can be cut using the rescue scissors.

bool em5::VehicleComponent::getCanBeTowed ( ) const
inline

Check if the vehicle can be picked up by the towcar.

bool em5::VehicleComponent::getCanBeTowedFlag ( ) const
inline

Check if the vehicle's "CAN_BE_TOWED" flag is set (this is only a part of the check whether the vehicle can be towed)

bool em5::VehicleComponent::getCanReallyNotBeTowed ( ) const
inline

Check if the vehicle is set as totally untowable.

qsf::Time em5::VehicleComponent::getCutDuration ( ) const

Gets the duration needed to cut the vehicle open.

const float em5::VehicleComponent::getDamageResistance ( ) const

Returns the damage resistance.

virtual bool em5::VehicleComponent::getDoorPosition ( uint32  doorIndex,
glm::vec3 &  outDoorPosition 
) const
virtual
virtual bool em5::VehicleComponent::getDoorPositions ( DoorComponent::DoorType  doorType,
std::vector< qsf::Transform > &  outDoorTransform,
const qsf::Transform worldTransform 
) const
virtual
uint64 em5::VehicleComponent::getDriverVehicleDoorId ( ) const
const float em5::VehicleComponent::getFireResistance ( ) const

Returns the fire resistance.

bool em5::VehicleComponent::getFirstDoorTransformByType ( uint32  doorType,
qsf::Transform outDoorTransform 
) const
VehicleComponent::InternalFlagSet & em5::VehicleComponent::getInternalFlags ( )
inlineprotected
bool em5::VehicleComponent::getIsOnEmergencyOperations ( ) const
inline
bool em5::VehicleComponent::getIsParkingEntity ( ) const
inline
float em5::VehicleComponent::getLifeEnergy ( ) const
inline

Get vehicle life energy.

DoorComponent::DoorType em5::VehicleComponent::getMainDoorType ( ) const
inline

Get/set the mainly used door type, used for entering/leaving the vehicle.

virtual qsf::Component* em5::VehicleComponent::getMovableObjectRenderingListenerComponent ( )
overrideprotectedvirtual

Return the component the listener will spy on.

Returns
The component the listener will spy on, can be a null pointer, do not destroy the instance
Note
  • The default implementation is empty and returns a null pointer
  • Ease of use method in case a listener just listens to a single movable object (the common use case)

Reimplemented from em5::DamageComponent.

bool em5::VehicleComponent::getMustBeRecovered ( ) const
inline

Check if the vehicle can and must be recovered by the crane vehicle.

std::string em5::VehicleComponent::getResistancesAsString ( ) const
const qsf::AssetProxy & em5::VehicleComponent::getSignalAudioAsset ( ) const
inline
AudioProxy& em5::VehicleComponent::getSirenSFX ( )
inline
uint64 em5::VehicleComponent::getSpecialEntity ( ) const
inline

Get/set special child entity ID.

const std::vector<uint64>& em5::VehicleComponent::getVehicleDoorIdsByType ( DoorComponent::DoorType  doorType) const
const std::vector< uint64 > & em5::VehicleComponent::getVehicleDoors ( ) const
inline
void em5::VehicleComponent::hideParticleChildrenAtMapSave ( )
virtual void em5::VehicleComponent::initializePrefabClearComponentExceptions ( )
protectedvirtual
bool em5::VehicleComponent::isInvincible ( ) const

Set/Get if this vehicle can be damaged or not.

bool em5::VehicleComponent::isMovable ( ) const
inline

Return "true" if the vehicle is allowed to move.

virtual bool em5::VehicleComponent::isReadyForCleanup ( ) const
overridevirtual

Check if vehicle can be reset by cleanup.

Reimplemented from em5::DamageComponent.

bool em5::VehicleComponent::isSirenEnabled ( ) const
inline
virtual void em5::VehicleComponent::onExplosion ( FireComponent fireComponent)
overrideprotectedvirtual

Reimplemented from em5::DamageComponent.

Reimplemented in em5::RoadVehicleComponent.

virtual void em5::VehicleComponent::onFireStarted ( FreeplayEvent freeplayEvent)
overrideprotectedvirtual
virtual void em5::VehicleComponent::onFireStopped ( )
overrideprotectedvirtual

In case the fire component is not a null pointer, only explosions of that fire component explode, otherwise explode all.

Reimplemented from em5::DamageComponent.

Reimplemented in em5::BoatComponent.

virtual void em5::VehicleComponent::onObjectRenderingStartup ( )
overrideprotectedvirtual

Called when an OGRE movable object is about to be rendered for the first time after it has not been rendered for some time.

Note
  • The default implementation is empty

Reimplemented from em5::DamageComponent.

Reimplemented in em5::RoadVehicleComponent.

virtual void em5::VehicleComponent::onSetDamagedLevel1 ( )
overrideprotectedvirtual

Reimplemented from em5::DamageComponent.

Reimplemented in em5::RoadVehicleComponent.

virtual void em5::VehicleComponent::onSetDamagedLevel2 ( )
overrideprotectedvirtual

Reimplemented from em5::DamageComponent.

Reimplemented in em5::HelicopterComponent, and em5::RoadVehicleComponent.

virtual void em5::VehicleComponent::onSetDamageState ( DamageState  damageState)
overrideprotectedvirtual

Reimplemented from em5::DamageComponent.

virtual void em5::VehicleComponent::onSetDestroyed ( )
overrideprotectedvirtual
virtual void em5::VehicleComponent::onSetFireLifePercentage ( float  fireLifePercentage)
overrideprotectedvirtual

Reimplemented from em5::DamageComponent.

virtual void em5::VehicleComponent::onSetIntact ( )
overrideprotectedvirtual

Reimplemented from em5::DamageComponent.

Reimplemented in em5::RoadVehicleComponent.

virtual void em5::VehicleComponent::onSetSimulating ( bool  simulating)
overridevirtual

Set whether or not the component is in simulating mode.

Parameters
[in]active"true" if the component is in simulating mode, else "false"
Note
  • The default implementation is empty
  • This method is only called in case there's a real state change
  • In contrast to internal flags (e.g. Active, Debug), the simulating mode state can only be changed globally for a whole map
  • On component shutdown and simulating enabled, "onSetSimulating()" is automatically called with "false" before calling "onShutdown()"

Reimplemented from em5::DamageComponent.

Reimplemented in em5::HelicopterComponent, and em5::RoadVehicleComponent.

virtual void em5::VehicleComponent::onShutdown ( )
overridevirtual

Shutdown the component.

Note
  • Only called in case "onStartup()" returned successfully
  • The default implementation is empty

Reimplemented from em5::DamageComponent.

Reimplemented in em5::HelicopterComponent, and em5::RoadVehicleComponent.

virtual bool em5::VehicleComponent::onStartup ( )
overridevirtual

Startup the component.

Returns
"true" if all went fine, else "false"
Note
  • The default implementation is empty
  • Only components which are part of entities (concrete prototype instances) get started
  • When this method gets called, the properties might still be on default values but it's also possible that properties already have customized values. Take this into account when implementing your method.

Reimplemented from em5::DamageComponent.

Reimplemented in em5::RoadVehicleComponent, and em5::BoatComponent.

virtual void em5::VehicleComponent::onUpdateMovableObjectRenderingJob ( const qsf::JobArguments jobArguments)
overrideprotectedvirtual

Main update function that is passed to the job manager.

Parameters
[in]jobArgumentsJob arguments
Note
  • The default implementation checks the time since last visible and puts the listener to sleep if required

Reimplemented from em5::DamageComponent.

Reimplemented in em5::RoadVehicleComponent.

void em5::VehicleComponent::openDoor ( DoorComponent::DoorType  doorType,
bool  open 
)

Open/close the doors with the given from the vehicle.

Parameters
[in]doorTypeDoor type to open/close
[in]openState of the door
void em5::VehicleComponent::personsFleeFromFire ( bool  allowSpawning)

Let persons flee from this burning vehicle.

void em5::VehicleComponent::playSirenLoop ( )
void em5::VehicleComponent::playSirenOnce ( )

Play siren.

void em5::VehicleComponent::precalculateDoorsToEntitiesMap ( ) const
virtual void em5::VehicleComponent::receiveDamage ( float  amount,
damagetype::DamageType  damageType,
qsf::Component sender = nullptr 
)
overridevirtual

Reimplemented from em5::DamageComponent.

virtual void em5::VehicleComponent::restoreEntitiesFromPrefab ( const qsf::Prototype prototype,
std::unordered_map< uint64, uint64 > &  prototypeIdMap 
)
protectedvirtual
virtual void em5::VehicleComponent::serialize ( qsf::BinarySerializer serializer)
overridevirtual

Serialize or deserialize the component using a binary serializer.

Parameters
[in]serializerThe serializer, which can be either in read or write mode

Reimplemented from em5::DamageComponent.

Reimplemented in em5::HelicopterComponent, em5::RoadVehicleComponent, and em5::BoatComponent.

void em5::VehicleComponent::setCanBeCut ( bool  canBeCut,
FreeplayEvent freeplayEvent = nullptr 
)

Set whether the vehicle can be cut using the rescue scissors.

void em5::VehicleComponent::setCanBeRepaired ( bool  canBeRepaired,
FreeplayEvent freeplayEvent = nullptr 
)

Set whether the vehicle can be repaired by an engineer.

void em5::VehicleComponent::setCanBeTowed ( bool  canBeTowed,
FreeplayEvent freeplayEvent = nullptr 
)

Set whether the vehicle can be picked up by the towcar.

void em5::VehicleComponent::setCanReallyNotBeTowed ( bool  canReallyNotBeTowed,
FreeplayEvent freeplayEvent = nullptr 
)

Set whether the vehicle can be picked up by the towcar.

void em5::VehicleComponent::setCutDuration ( const qsf::Time duration)

Configures the duration needed to cut the vehicle open.

void em5::VehicleComponent::setDamageOverlaysActive ( bool  smutActive,
bool  emissiveActive 
)
protected
void em5::VehicleComponent::setInvincible ( bool  invincible)
void em5::VehicleComponent::setIsOnEmergencyOperations ( bool  enable)
inline
void em5::VehicleComponent::setIsParkingEntity ( bool  isParkingEntity)
inline
void em5::VehicleComponent::setMainDoorType ( DoorComponent::DoorType  mainDoorType)
void em5::VehicleComponent::setMustBeRecovered ( bool  mustBeRecovered,
FreeplayEvent freeplayEvent = nullptr 
)

Set whether the vehicle can and must be recovered by the crane vehicle.

void em5::VehicleComponent::setResistancesByString ( const std::string &  resistances)
void em5::VehicleComponent::setSignalAudioAsset ( const qsf::AssetProxy signalSound)
inline
void em5::VehicleComponent::setSirenEnabled ( bool  sirenEnabled)
void em5::VehicleComponent::setSpecialEntity ( uint64  specialEntityId)
void em5::VehicleComponent::setVehiclePrefab ( const qsf::AssetProxy prefabAssetProxy)
protected
void em5::VehicleComponent::stopActions ( ) const

Stop possible actions.

void em5::VehicleComponent::stopSiren ( )
void em5::VehicleComponent::stopSirenLoop ( )
void em5::VehicleComponent::switchFromCombinedToNormalPrefab ( )
protected
void em5::VehicleComponent::switchToDamagePrefab ( bool  prefabActive)
protected
void em5::VehicleComponent::trapPersons ( FreeplayEvent freeplayEvent = nullptr,
const std::vector< uint32 > &  injuryPool = std::vector< uint32 >() 
)

Trap persons inside this vehicle.

Member Data Documentation

const uint32 em5::VehicleComponent::CATEGORY_PASSENGER
static

"0" unique identifier for the passenger door category

const uint32 em5::VehicleComponent::CATEGORY_PERSONNEL
static

"1" unique identifier for the personnel door category

const uint32 em5::VehicleComponent::CATEGORY_VEHICLE
static

"2" unique identifier for the vehicle door category – TODO(fw): What is this for actually?

const uint32 em5::VehicleComponent::COMPONENT_ID
static

"em5::VehicleComponent" unique component ID

std::vector<uint64> em5::VehicleComponent::EMPTY_ENTITY_VECTOR
staticprotected
std::vector<uint32> em5::VehicleComponent::mComponentExceptionIds
protected
EntityIdArray em5::VehicleComponent::mVehicleDoorsIds
protected

The documentation for this class was generated from the following files: