BVB Source Codes

CRYENGINE Show VehicleSeatActionPassiveAnimation.h Source code

Return Download CRYENGINE: download VehicleSeatActionPassiveAnimation.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // ===========================================================================
  4. // ====
  5. // ==== Vehicle seat action: Passive animation.
  6. // ====
  7. // ==== This is a simplified version of CVehicleSeatActionPassiveAnimation
  8. // ==== that will only run the animation as long as someone is seated in
  9. // ==== the vehicle.
  10. // ====
  11. // ==== It will also not ForceFinish() on the animation action but justs stops
  12. // ==== it normally, so that we are guaranteed to trigger blend-transitions.
  13. // ====
  14. //
  15.  
  16. #ifndef __VEHICLESEATACTIONPASSIVEANIMATION_H__
  17. #define __VEHICLESEATACTIONPASSIVEANIMATION_H__
  18.  
  19. class CVehicleSeatActionPassiveAnimation
  20.         : public IVehicleSeatAction
  21. {
  22.         IMPLEMENT_VEHICLEOBJECT
  23. public:
  24.  
  25.         CVehicleSeatActionPassiveAnimation();
  26.         ~CVehicleSeatActionPassiveAnimation();
  27.  
  28.         // IVehicleSeatAction
  29.         virtual bool Init(IVehicle* pVehicle, IVehicleSeat* pSeat, const CVehicleParams& table) override;
  30.         virtual void Reset() override;
  31.         virtual void Release() override { delete this; }
  32.  
  33.         virtual void StartUsing(EntityId passengerId) override;
  34.         virtual void ForceUsage() override                                                               {}
  35.         virtual void StopUsing() override;
  36.         virtual void OnAction(const TVehicleActionId actionId, int activationMode, float value) override {}
  37.  
  38.         virtual void Serialize(TSerialize ser, EEntityAspects aspects) override;
  39.         virtual void PostSerialize() override                    {}
  40.         virtual void Update(const float deltaTime) override      {}
  41.  
  42.         virtual void GetMemoryUsage(ICrySizer* s) const override { s->Add(*this); }
  43.         // ~IVehicleSeatAction
  44.  
  45.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override {}
  46.  
  47. private:
  48.  
  49.         // Animation control:
  50.         void StartAnimation();
  51.         void StopAnimation();
  52.  
  53. private:
  54.  
  55.         IVehicle*                   m_pVehicle;
  56.         TAction<SAnimationContext>* m_pAnimationAction;
  57.         FragmentID                  m_animationFragmentID;
  58.  
  59.         // The entity ID of the seated user (0 if none).
  60.         EntityId m_userId;
  61. };
  62.  
  63. #endif // __VEHICLESEATACTIONPASSIVEANIMATION_H__
  64.  
downloadVehicleSeatActionPassiveAnimation.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