BVB Source Codes

CRYENGINE Show VehiclePartLight.h Source code

Return Download CRYENGINE: download VehiclePartLight.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 light part
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 24:10:2005: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEPARTLIGHT_H__
  15. #define __VEHICLEPARTLIGHT_H__
  16.  
  17. #include "VehiclePartBase.h"
  18.  
  19. class CVehiclePartLight
  20.         : public CVehiclePartBase
  21. {
  22.         IMPLEMENT_VEHICLEOBJECT
  23. public:
  24.  
  25.         CVehiclePartLight();
  26.         ~CVehiclePartLight();
  27.  
  28.         // IVehiclePart
  29.         virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table, IVehiclePart* parent, CVehicle::SPartInitInfo& initInfo, int partType) override;
  30.         virtual void PostInit() override;
  31.         virtual void Reset() override;
  32.  
  33.         virtual void OnEvent(const SVehiclePartEvent& event) override;
  34.  
  35.         virtual void Physicalize() override {}
  36.  
  37.         virtual void Update(const float frameTime) override;
  38.  
  39.         virtual void Serialize(TSerialize serialize, EEntityAspects) override;
  40.         virtual void RegisterSerializer(IGameObjectExtension* gameObjectExt) override {}
  41.         virtual void GetMemoryUsage(ICrySizer* s) const override
  42.         {
  43.                 s->Add(*this);
  44.                 s->AddObject(m_components);
  45.                 s->AddObject(m_pHelper);
  46.                 CVehiclePartBase::GetMemoryUsageInternal(s);
  47.         }
  48.         // ~IVehiclePart
  49.  
  50.         virtual void  ToggleLight(bool enable);
  51.         bool          IsEnabled()          { return m_enabled; }
  52.         const string& GetLightType() const { return m_lightType; }
  53.  
  54. protected:
  55.  
  56.         virtual void UpdateLight(const float frameTime);
  57.  
  58.         string                          m_lightType;
  59.         CDLight                         m_light;
  60.         int                             m_lightViewDistanceRatio;
  61.         _smart_ptr<IMaterial>           m_pMaterial;
  62.  
  63.         std::vector<IVehicleComponent*> m_components;
  64.  
  65.         IVehicleHelper*                 m_pHelper;
  66.  
  67.         float                           m_diffuseMult[2];
  68.         Vec3                            m_diffuseCol;
  69.  
  70.         bool                            m_enabled;
  71. };
  72.  
  73. #endif
  74.  
downloadVehiclePartLight.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