BVB Source Codes

CRYENGINE Show VehiclePartAnimated.h Source code

Return Download CRYENGINE: download VehiclePartAnimated.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 uses CGA files
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 24:08:2005: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEPARTANIMATED_H__
  15. #define __VEHICLEPARTANIMATED_H__
  16.  
  17. #include "VehiclePartBase.h"
  18.  
  19. class CScriptBind_VehiclePart;
  20. class CVehicle;
  21. class CVehiclePartAnimatedJoint;
  22.  
  23. class CVehiclePartAnimated
  24.         : public CVehiclePartBase
  25. {
  26.         IMPLEMENT_VEHICLEOBJECT
  27. public:
  28.  
  29.         CVehiclePartAnimated();
  30.         ~CVehiclePartAnimated();
  31.  
  32.         // IVehiclePart
  33.         virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table, IVehiclePart* parent, CVehicle::SPartInitInfo& initInfo, int partType) override;
  34.         virtual void Release() override;
  35.         virtual void Reset() override;
  36.  
  37.         virtual void SetMaterial(IMaterial* pMaterial) override;
  38.  
  39.         virtual void OnEvent(const SVehiclePartEvent& event) override;
  40.  
  41.         virtual bool ChangeState(EVehiclePartState state, int flags = 0) override;
  42.         virtual void Physicalize() override;
  43.  
  44.         virtual void Update(const float frameTime) override;
  45.  
  46.         virtual void Serialize(TSerialize serialize, EEntityAspects) override;
  47.         virtual void PostSerialize() override;
  48.  
  49.         virtual void GetMemoryUsage(ICrySizer* s) const override;
  50.         // ~IVehiclePart
  51.  
  52.         virtual IStatObj* GetSubGeometry(CVehiclePartBase* pPart, EVehiclePartState state, Matrix34& position, bool removeFromParent) override;
  53.         IStatObj*         GetGeometryForState(CVehiclePartAnimatedJoint* pPart, EVehiclePartState state);
  54.         IStatObj*         GetDestroyedGeometry(const char* pJointName, unsigned int index = 0);
  55.         Matrix34          GetDestroyedGeometryTM(const char* pJointName, unsigned int index);
  56.  
  57.         virtual void      SetDrivingProxy(bool bDrive);
  58.  
  59.         void              RotationChanged(CVehiclePartAnimatedJoint* pJoint);
  60.  
  61.         int               AssignAnimationLayer() { return ++m_lastAnimLayerAssigned; }
  62.  
  63. #if ENABLE_VEHICLE_DEBUG
  64.         void Dump();
  65. #endif
  66.  
  67.         int  GetNextFreeLayer();
  68.         bool ChangeChildState(CVehiclePartAnimatedJoint* pPart, EVehiclePartState state, int flags);
  69.  
  70. protected:
  71.  
  72.         virtual void              InitGeometry();
  73.         void                      FlagSkeleton(ISkeletonPose* pSkeletonPose, IDefaultSkeleton& rIDefaultSkeleton);
  74.         virtual EVehiclePartState GetStateForDamageRatio(float ratio) override;
  75.  
  76.         typedef std::map<string, /*_smart_ptr<*/ IStatObj*> TStringStatObjMap;
  77.         TStringStatObjMap m_intactStatObjs;
  78.  
  79.         typedef std::map<string, IVehiclePart*> TStringVehiclePartMap;
  80.         TStringVehiclePartMap          m_jointParts;
  81.  
  82.         _smart_ptr<ICharacterInstance> m_pCharInstance;
  83.         ICharacterInstance*            m_pCharInstanceDestroyed;
  84.  
  85.         int                            m_hullMatId[2];
  86.  
  87.         int                            m_lastAnimLayerAssigned;
  88.         int                            m_iRotChangedFrameId;
  89.         bool                           m_serializeForceRotationUpdate;
  90.         bool                           m_initialiseOnChangeState;
  91.         bool                           m_ignoreDestroyedState;
  92. };
  93.  
  94. #endif
  95.  
downloadVehiclePartAnimated.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