BVB Source Codes

CRYENGINE Show VehiclePartSubPart.h Source code

Return Download CRYENGINE: download VehiclePartSubPart.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 part for vehicles which is the an attachment
  8.    of a parent Animated part
  9.  
  10.    -------------------------------------------------------------------------
  11.    History:
  12.    - 25:08:2005: Created by Mathieu Pinard
  13.  
  14. *************************************************************************/
  15.  
  16. #ifndef __VEHICLEPARTSUBPART_H__
  17. #define __VEHICLEPARTSUBPART_H__
  18.  
  19. #include "VehiclePartBase.h"
  20.  
  21. class CVehicle;
  22.  
  23. class CVehiclePartSubPart : public CVehiclePartBase
  24. {
  25.         IMPLEMENT_VEHICLEOBJECT
  26.  
  27. public:
  28.  
  29.         CVehiclePartSubPart();
  30.  
  31.         virtual ~CVehiclePartSubPart();
  32.  
  33.         // IVehiclePart
  34.         virtual bool            Init(IVehicle* pVehicle, const CVehicleParams& table, IVehiclePart* pParent, CVehicle::SPartInitInfo& initInfo, int partType) override;
  35.         virtual void            Reset() override;
  36.         virtual void            Release() override;
  37.         virtual void            OnEvent(const SVehiclePartEvent& event) override;
  38.         virtual bool            ChangeState(EVehiclePartState state, int flags = 0) override;
  39.         virtual void            Physicalize() override;
  40.         virtual void            Update(const float frameTime) override;
  41.         virtual void            GetMemoryUsage(ICrySizer* pSizer) const override;
  42.         virtual void            GetMemoryUsageInternal(ICrySizer* pSizer) const;
  43.         virtual const Matrix34& GetLocalInitialTM() override;
  44.         // ~IVehiclePart
  45.  
  46. protected:
  47.  
  48.         virtual void InitGeometry();
  49.  
  50.         void         RegisterStateGeom(EVehiclePartState state, IStatObj* pStatObj);
  51.  
  52.         Matrix34 m_savedTM;
  53.  
  54. private:
  55.  
  56.         struct StateGeom
  57.         {
  58.                 inline StateGeom() : state(eVGS_Default), pStatObj(NULL)
  59.                 {
  60.                 }
  61.  
  62.                 inline StateGeom(EVehiclePartState state, IStatObj* pStatObj) : state(state), pStatObj(pStatObj)
  63.                 {
  64.                         if (pStatObj)
  65.                         {
  66.                                 pStatObj->AddRef();
  67.                         }
  68.                 }
  69.  
  70.                 inline StateGeom(const StateGeom& other) : state(other.state), pStatObj(other.pStatObj)
  71.                 {
  72.                         if (pStatObj)
  73.                         {
  74.                                 pStatObj->AddRef();
  75.                         }
  76.                 }
  77.  
  78.                 ~StateGeom()
  79.                 {
  80.                         if (pStatObj)
  81.                         {
  82.                                 pStatObj->Release();
  83.                         }
  84.                 }
  85.  
  86.                 inline StateGeom& operator=(const StateGeom& other)
  87.                 {
  88.                         state = other.state;
  89.                         pStatObj = other.pStatObj;
  90.  
  91.                         if (pStatObj)
  92.                         {
  93.                                 pStatObj->AddRef();
  94.                         }
  95.  
  96.                         return *this;
  97.                 }
  98.  
  99.                 EVehiclePartState state;
  100.                 IStatObj*         pStatObj;
  101.         };
  102.  
  103.         typedef std::vector<StateGeom> TStateGeomVector;
  104.  
  105.         TStateGeomVector m_stateGeoms;
  106. };
  107.  
  108. #endif //__VEHICLEPARTSUBPART_H__
  109.  
downloadVehiclePartSubPart.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