BVB Source Codes

CRYENGINE Show VehiclePartEntity.h Source code

Return Download CRYENGINE: download VehiclePartEntity.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: Vehicle part class that spawns an entity and attaches it to the vehicle.
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 01:09:2010: Created by Paul Slinger
  12.  
  13. *************************************************************************/
  14.  
  15. #ifndef __VEHICLEPARTENTITY_H__
  16. #define __VEHICLEPARTENTITY_H__
  17.  
  18. #include "IGameObject.h"
  19. #include "VehiclePartBase.h"
  20.  
  21. class CVehiclePartEntity : public CVehiclePartBase
  22. {
  23. public:
  24.         // Suppressed duplInheritedMember warnings due to static m_objectId also defined in base class
  25.         // cppcheck-suppress duplInheritedMember
  26.         IMPLEMENT_VEHICLEOBJECT
  27.  
  28.         CVehiclePartEntity();
  29.  
  30.         ~CVehiclePartEntity();
  31.  
  32.         virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table, IVehiclePart* parent, CVehicle::SPartInitInfo& initInfo, int partType) override;
  33.         virtual void PostInit() override;
  34.         virtual void Reset() override;
  35.         virtual void Update(const float frameTime) override;
  36.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override;
  37.  
  38.         void         TryDetachPart(const SVehicleEventParams& params);
  39.  
  40.         virtual void Serialize(TSerialize serializer, EEntityAspects aspects) override;
  41.         virtual void PostSerialize() override;
  42.         virtual void GetMemoryUsage(ICrySizer* pSizer) const override;
  43.  
  44.         IEntity*     GetPartEntity() const;
  45.  
  46. protected:
  47.  
  48.         bool     EntityAttached() const  { return m_entityAttached; }
  49.         EntityId GetPartEntityId() const { return m_entityId; }
  50.  
  51. private:
  52.  
  53.         struct Flags
  54.         {
  55.                 enum
  56.                 {
  57.                         Hidden         = 1,
  58.                         EntityAttached = 2,
  59.                         Destroyed      = 4,
  60.  
  61.                 };
  62.         };
  63.  
  64.         void UpdateEntity();
  65.         void DestroyEntity();
  66.  
  67.         void SafeRemoveBuddyConstraint();
  68.  
  69.         uint            m_constraintId;
  70.  
  71.         string          m_entityName, m_entityArchetype, m_helperName;
  72.  
  73.         EntityId        m_entityId;
  74.         IVehicleHelper* m_pHelper;
  75.         IEntityLink*    m_pLink;
  76.         uint16          m_entityNetId;
  77.  
  78.         bool            m_hidden                       : 1;
  79.         bool            m_entityAttached               : 1;
  80.         bool            m_destroyed                    : 1;
  81.         bool            m_CollideWithParent            : 1;
  82.         bool            m_createBuddyConstraint        : 1;
  83.         bool            m_shouldDetachInsteadOfDestroy : 1;
  84. };
  85.  
  86. #endif //__VEHICLEPARTENTITY_H__
  87.  
downloadVehiclePartEntity.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