BVB Source Codes

CRYENGINE Show FlowVehicleMovement.h Source code

Return Download CRYENGINE: download FlowVehicleMovement.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 flow node to handle a vehicle movement features
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 11:07:2006: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __FLOWVEHICLEMOVEMENT_H__
  15. #define __FLOWVEHICLEMOVEMENT_H__
  16.  
  17. #include "FlowVehicleBase.h"
  18.  
  19. class CFlowVehicleMovement
  20.         : public CFlowVehicleBase
  21. {
  22. public:
  23.  
  24.         CFlowVehicleMovement(SActivationInfo* pActivationInfo)
  25.         {
  26.                 Init(pActivationInfo);
  27.                 m_shouldZeroMass = false;
  28.         }
  29.         ~CFlowVehicleMovement() { Delete(); }
  30.  
  31.         // CFlowBaseNode
  32.         virtual IFlowNodePtr Clone(SActivationInfo* pActivationInfo);
  33.         virtual void         GetConfiguration(SFlowNodeConfig& nodeConfig);
  34.         virtual void         ProcessEvent(EFlowEvent flowEvent, SActivationInfo* pActivationInfo);
  35.         virtual void         Serialize(SActivationInfo* pActivationInfo, TSerialize ser);
  36.         // ~CFlowBaseNode
  37.  
  38.         // IVehicleEventListener
  39.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) {}
  40.         // ~IVehicleEventListener
  41.  
  42.         virtual void GetMemoryUsage(ICrySizer* s) const
  43.         {
  44.                 s->Add(*this);
  45.         }
  46.  
  47. protected:
  48.  
  49.         enum EInputs
  50.         {
  51.                 In_WarmupEngine,
  52.                 In_ZeroMass,
  53.                 In_RestoreMass,
  54.         };
  55.  
  56.         enum EOutputs
  57.         {
  58.         };
  59.  
  60.         void ZeroMass(bool enable);
  61.  
  62.         struct SPartMass
  63.         {
  64.                 int   partid;
  65.                 float mass;
  66.  
  67.                 SPartMass() : partid(0), mass(0.0f) {}
  68.                 SPartMass(int id, float m) : partid(id), mass(m) {}
  69.         };
  70.  
  71.         std::vector<SPartMass> m_partMass;
  72.         bool                   m_shouldZeroMass; // on loading defer ZeroMass(true) call to next update (after vehicle physicalisation)
  73. };
  74.  
  75. //////////////////////////////////////////////////////////////////////////
  76.  
  77. class CFlowVehicleMovementParams
  78.         : public CFlowVehicleBase
  79. {
  80. public:
  81.  
  82.         CFlowVehicleMovementParams(SActivationInfo* pActivationInfo)
  83.         {
  84.                 Init(pActivationInfo);
  85.         }
  86.         ~CFlowVehicleMovementParams() { Delete(); }
  87.  
  88.         // CFlowBaseNode
  89.         virtual IFlowNodePtr Clone(SActivationInfo* pActivationInfo);
  90.         virtual void         GetConfiguration(SFlowNodeConfig& nodeConfig);
  91.         virtual void         ProcessEvent(EFlowEvent flowEvent, SActivationInfo* pActivationInfo);
  92.         // ~CFlowBaseNode
  93.  
  94.         // IVehicleEventListener
  95.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) {}
  96.         // ~IVehicleEventListener
  97.  
  98.         virtual void GetMemoryUsage(ICrySizer* s) const
  99.         {
  100.                 s->Add(*this);
  101.         }
  102.  
  103. protected:
  104.  
  105.         enum EInputs
  106.         {
  107.                 In_Trigger = 0,
  108.                 In_MaxSpeedFactor,
  109.                 In_MaxAcceleration
  110.         };
  111.  
  112.         enum EOutputs
  113.         {
  114.         };
  115. };
  116.  
  117. #endif
  118.  
downloadFlowVehicleMovement.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