BVB Source Codes

CRYENGINE Show LipSync_FacialInstance.h Source code

Return Download CRYENGINE: download LipSync_FacialInstance.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  File name:   LipSync_FacialInstance.h
  5. //  Version:     v1.00
  6. //  Created:     2014-08-29 by Christian Werle.
  7. //  Description: Automatic start of facial animation when a sound is being played back.
  8. //               Legacy version that uses CryAnimation's FacialInstance.
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #pragma once
  15.  
  16. #include <CryAction/ILipSyncProvider.h>
  17.  
  18. class CLipSyncProvider_FacialInstance : public ILipSyncProvider
  19. {
  20. public:
  21.         explicit CLipSyncProvider_FacialInstance(EntityId entityId);
  22.  
  23.         // ILipSyncProvider
  24.         virtual void RequestLipSync(IEntityAudioComponent* pProxy, const AudioControlId audioTriggerId, const ELipSyncMethod lipSyncMethod) override;
  25.         virtual void StartLipSync(IEntityAudioComponent* pProxy, const AudioControlId audioTriggerId, const ELipSyncMethod lipSyncMethod) override;
  26.         virtual void PauseLipSync(IEntityAudioComponent* pProxy, const AudioControlId audioTriggerId, const ELipSyncMethod lipSyncMethod) override;
  27.         virtual void UnpauseLipSync(IEntityAudioComponent* pProxy, const AudioControlId audioTriggerId, const ELipSyncMethod lipSyncMethod) override;
  28.         virtual void StopLipSync(IEntityAudioComponent* pProxy, const AudioControlId audioTriggerId, const ELipSyncMethod lipSyncMethod) override;
  29.         virtual void UpdateLipSync(IEntityAudioComponent* pProxy, const AudioControlId audioTriggerId, const ELipSyncMethod lipSyncMethod) override;
  30.         // ~ILipSyncProvider
  31.  
  32.         void FullSerialize(TSerialize ser);
  33.  
  34. private:
  35.         void LipSyncWithSound(const AudioControlId audioTriggerId, bool bStop = false);
  36.         EntityId m_entityId;
  37. };
  38. DECLARE_SHARED_POINTERS(CLipSyncProvider_FacialInstance);
  39.  
  40. class CLipSync_FacialInstance : public CGameObjectExtensionHelper<CLipSync_FacialInstance, IGameObjectExtension>
  41. {
  42. public:
  43.         // IGameObjectExtension
  44.         virtual void                 Initialize() override {};
  45.         virtual void                 GetMemoryUsage(ICrySizer* pSizer) const override;
  46.         virtual bool                 Init(IGameObject* pGameObject) override;
  47.         virtual void                 PostInit(IGameObject* pGameObject) override;
  48.         virtual void                 InitClient(int channelId) override;
  49.         virtual void                 PostInitClient(int channelId) override;
  50.         virtual bool                 ReloadExtension(IGameObject* pGameObject, const SEntitySpawnParams& params) override;
  51.         virtual void                 PostReloadExtension(IGameObject* pGameObject, const SEntitySpawnParams& params) override;
  52.         virtual void                 FullSerialize(TSerialize ser) override;
  53.         virtual bool                 NetSerialize(TSerialize ser, EEntityAspects aspect, uint8 profile, int pflags) override;
  54.         virtual void                 PostSerialize() override;
  55.         virtual void                 SerializeSpawnInfo(TSerialize ser) override;
  56.         virtual ISerializableInfoPtr GetSpawnInfo() override;
  57.         virtual void                 Update(SEntityUpdateContext& ctx, int updateSlot) override;
  58.         virtual void                 HandleEvent(const SGameObjectEvent& event) override;
  59.         virtual void                 ProcessEvent(SEntityEvent& event) override;
  60.         virtual uint64               GetEventMask() const override;
  61.         virtual void                 SetChannelId(uint16 id) override;
  62.         virtual void                 SetAuthority(bool auth) override;
  63.         virtual void                 PostUpdate(float frameTime) override;
  64.         virtual void                 PostRemoteSpawn() override;
  65.         // ~IGameObjectExtension
  66.  
  67.         // IEntityComponent
  68.         virtual void OnShutDown() override;
  69.         // ~IEntityComponent
  70.  
  71. private:
  72.         void InjectLipSyncProvider();
  73.  
  74. private:
  75.         CLipSyncProvider_FacialInstancePtr m_pLipSyncProvider;
  76. };
  77.  
downloadLipSync_FacialInstance.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