BVB Source Codes

CRYENGINE Show VehicleSeatActionLights.h Source code

Return Download CRYENGINE: download VehicleSeatActionLights.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Implements a seat action to head/spot lights
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 01:03:2006: Created by Mathieu Pinard
  12.    - 20:07:2010: Refactored by Paul Slinger
  13.  
  14. *************************************************************************/
  15. #ifndef __VEHICLESEATACTIONLIGHTS_H__
  16. #define __VEHICLESEATACTIONLIGHTS_H__
  17.  
  18. #include "SharedParams/ISharedParams.h"
  19.  
  20. class CVehiclePartLight;
  21.  
  22. class CVehicleSeatActionLights : public IVehicleSeatAction
  23. {
  24.         IMPLEMENT_VEHICLEOBJECT
  25.  
  26. public:
  27.         ~CVehicleSeatActionLights();
  28.  
  29.         // IVehicleSeatAction
  30.  
  31.         virtual bool Init(IVehicle* pVehicle, IVehicleSeat* pSeat, const CVehicleParams& table) override;
  32.         virtual void Reset() override;
  33.         virtual void Release() override                        { delete this; }
  34.         virtual void StartUsing(EntityId passengerId) override {}
  35.         virtual void ForceUsage() override                     {}
  36.         virtual void StopUsing() override                      {}
  37.         virtual void OnAction(const TVehicleActionId actionId, int activationMode, float value) override;
  38.         virtual void GetMemoryUsage(ICrySizer* pSizer) const override;
  39.  
  40.         // ~IVehicleSeatAction
  41.  
  42.         // IVehicleObject
  43.  
  44.         virtual void Serialize(TSerialize ser, EEntityAspects aspects) override;
  45.         virtual void PostSerialize() override               {}
  46.         virtual void Update(const float deltaTime) override {}
  47.  
  48.         // IVehicleObject
  49.  
  50.         // IVehicleEventListener
  51.  
  52.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override;
  53.  
  54.         // ~IVehicleEventListener
  55.  
  56. protected:
  57.  
  58.         enum ELightActivation
  59.         {
  60.                 eLA_Toggle = 0,
  61.                 eLA_Brake,
  62.                 eLA_Reversing
  63.         };
  64.  
  65.         BEGIN_SHARED_PARAMS(SSharedParams)
  66.  
  67.         TVehicleSeatId seatId;
  68.  
  69.         ELightActivation activation;
  70.  
  71.         string           onSound, offSound;
  72.  
  73.         END_SHARED_PARAMS
  74.  
  75.         struct SLightPart
  76.         {
  77.                 inline SLightPart() : pPart(NULL)
  78.                 {
  79.                 }
  80.  
  81.                 inline SLightPart(CVehiclePartLight* pPart) : pPart(pPart)
  82.                 {
  83.                 }
  84.  
  85.                 CVehiclePartLight* pPart;
  86.  
  87.                 void               GetMemoryUsage(ICrySizer* pSizer) const {}
  88.         };
  89.  
  90.         typedef std::vector<SLightPart> TVehiclePartLightVector;
  91.  
  92.         void ToggleLights(bool enable);
  93.         void PlaySound(const string& name);
  94.  
  95.         IVehicle*               m_pVehicle;
  96.  
  97.         SSharedParamsConstPtr   m_pSharedParams;
  98.  
  99.         TVehiclePartLightVector m_lightParts;
  100.  
  101.         bool                    m_enabled;
  102. };
  103.  
  104. #endif //__VEHICLESEATACTIONLIGHTS_H__
  105.  
downloadVehicleSeatActionLights.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top