BVB Source Codes

CRYENGINE Show VehiclePartAnimatedJoint.h Source code

Return Download CRYENGINE: download VehiclePartAnimatedJoint.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.    - 05:09:2005: Created by Mathieu Pinard
  13.  
  14. *************************************************************************/
  15. #ifndef __VEHICLEPARTANIMATEDJOINT_H__
  16. #define __VEHICLEPARTANIMATEDJOINT_H__
  17.  
  18. #include "VehicleSystem/VehiclePartBase.h"
  19.  
  20. #define VEH_USE_RPM_JOINT
  21.  
  22. class CVehicle;
  23.  
  24. class CVehiclePartAnimatedJoint
  25.         : public CVehiclePartBase
  26. {
  27.         IMPLEMENT_VEHICLEOBJECT
  28. public:
  29.  
  30.         CVehiclePartAnimatedJoint();
  31.         virtual ~CVehiclePartAnimatedJoint();
  32.  
  33.         // IVehiclePart
  34.         virtual bool            Init(IVehicle* pVehicle, const CVehicleParams& table, IVehiclePart* parent, CVehicle::SPartInitInfo& initInfo, int partType) override;
  35.         virtual void            InitGeometry(const CVehicleParams& table);
  36.         virtual void            PostInit() override;
  37.         virtual void            Reset() override;
  38.         virtual bool            ChangeState(EVehiclePartState state, int flags) override;
  39.         virtual void            SetMaterial(IMaterial* pMaterial) override;
  40.         virtual void            OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override;
  41.  
  42.         virtual void            OnEvent(const SVehiclePartEvent& event) override;
  43.  
  44.         virtual const Matrix34& GetLocalTM(bool relativeToParentPart, bool forced = false) override;
  45.         virtual const Matrix34& GetWorldTM() override;
  46.         virtual const AABB&     GetLocalBounds() override;
  47.         virtual const Matrix34& GetLocalInitialTM() override { return m_initialTM; }
  48.  
  49.         virtual void            Physicalize() override;
  50.         virtual void            Update(const float frameTime) override;
  51.  
  52.         virtual void            InvalidateTM(bool invalidate) override;
  53.         virtual void            SetMoveable(bool allowTranslationMovement = false) override;
  54.  
  55.         virtual void            GetMemoryUsage(ICrySizer* s) const override;
  56.         // ~IVehiclePart
  57.  
  58.         virtual void            SetLocalTM(const Matrix34& localTM) override;
  59.         virtual void            ResetLocalTM(bool recursive) override;
  60.  
  61.         virtual int             GetJointId() { return m_jointId; }
  62.  
  63.         virtual IStatObj*       GetStatObj() override;
  64.         virtual bool            SetStatObj(IStatObj* pStatObj) override;
  65.  
  66.         virtual IMaterial*      GetMaterial() override;
  67.  
  68.         virtual const Matrix34& GetLocalBaseTM() override { return m_baseTM; }
  69.         virtual void            SetLocalBaseTM(const Matrix34& tm) override;
  70.  
  71.         virtual void            SerMatrix(TSerialize ser, Matrix34& mat);
  72.         virtual void            Serialize(TSerialize ser, EEntityAspects aspects) override;
  73.  
  74.         virtual IStatObj*       GetExternalGeometry(bool destroyed) override { return destroyed ? m_pDestroyedGeometry.get() : m_pGeometry.get(); }
  75.  
  76. protected:
  77.         Matrix34 m_baseTM;
  78.         Matrix34 m_initialTM;
  79.         Matrix34 m_worldTM;
  80.         Matrix34 m_localTM;
  81.         Matrix34 m_nextFrameLocalTM;
  82.         AABB     m_localBounds;
  83.  
  84.         // if using external geometry
  85.         _smart_ptr<IStatObj>           m_pGeometry;
  86.         _smart_ptr<IStatObj>           m_pDestroyedGeometry;
  87.         _smart_ptr<IMaterial>          m_pMaterial;
  88.  
  89.         _smart_ptr<ICharacterInstance> m_pCharInstance;
  90.         CVehiclePartAnimated*          m_pAnimatedPart;
  91.         int                            m_jointId;
  92.  
  93. #ifdef VEH_USE_RPM_JOINT
  94.         float m_dialsRotMax;
  95.         float m_initialRotOfs;
  96. #endif
  97.  
  98.         bool                       m_localTMInvalid;
  99.         bool                       m_isMoveable;
  100.         bool                       m_isTransMoveable;
  101.         bool                       m_bUsePaintMaterial;
  102.  
  103.         IAnimationOperatorQueuePtr m_operatorQueue;
  104.  
  105.         friend class CVehiclePartAnimated;
  106. };
  107.  
  108. #endif
  109.  
downloadVehiclePartAnimatedJoint.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