BVB Source Codes

CRYENGINE Show VehiclePartSuspensionPart.h Source code

Return Download CRYENGINE: download VehiclePartSuspensionPart.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 suspension part
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 16:11:2011: Created by Stan Fichele
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEPARTSUSPENSIONPART_H__
  15. #define __VEHICLEPARTSUSPENSIONPART_H__
  16.  
  17. #include "VehicleSystem/VehiclePartSubPart.h"
  18.  
  19. class CVehicle;
  20. class CVehiclePartAnimated;
  21.  
  22. class CVehiclePartSuspensionPart : public CVehiclePartSubPart
  23. {
  24.         IMPLEMENT_VEHICLEOBJECT
  25.  
  26. private:
  27.         typedef CVehiclePartSubPart inherited;
  28.  
  29. public:
  30.         CVehiclePartSuspensionPart();
  31.         virtual ~CVehiclePartSuspensionPart();
  32.  
  33.         // IVehiclePart
  34.         virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table, IVehiclePart* pParent, CVehicle::SPartInitInfo& initInfo, int partType) override;
  35.         virtual void PostInit() override;
  36.         virtual void Reset() override;
  37.         virtual void Release() override;
  38.         virtual void OnEvent(const SVehiclePartEvent& event) override;
  39.         virtual bool ChangeState(EVehiclePartState state, int flags = 0) override;
  40.         virtual void Physicalize() override;
  41.         virtual void Update(const float frameTime) override;
  42.         // ~IVehiclePart
  43.  
  44. protected:
  45.         enum
  46.         {
  47.                 k_modeRotate = 0,       // Rotate towards the target, but dont translate or stretch the joint
  48.                 k_modeStretch,          // Rotate towards EF and stretch so that the end-effector hits the target
  49.                 k_modeSnapToEF,         // Rotate and translate so that the end-effector hits the target
  50.         };
  51.         enum
  52.         {
  53.                 k_flagTargetHelper         = 0x1,      // Target was specified using a helper
  54.                 k_flagIgnoreTargetRotation = 0x2,      // Dont use the target's rotation (i.e. for wheels)
  55.         };
  56.         CVehiclePartAnimated* m_animatedRoot;
  57.         CVehiclePartBase*     m_targetPart;          // The part the target lies on
  58.         Quat                  m_initialRot;          // This is not always ID, so need to store it
  59.         Vec3                  m_targetOffset;        // target position on target part
  60.         Vec3                  m_pos0;                // Initial position, relative to parent
  61.         Vec3                  m_direction0;          // The initial direction vector
  62.         float                 m_invLength0;          // Inverse length of direction0
  63.         int16                 m_jointId;             // Joint ID of cga statobj that was overridden
  64.         int8                  m_mode;                // IK mode
  65.         uint8                 m_ikFlags;
  66. };
  67.  
  68. #endif
  69.  
downloadVehiclePartSuspensionPart.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