BVB Source Codes

CRYENGINE Show MannequinInterface.cpp Source code

Return Download CRYENGINE: download MannequinInterface.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. //
  4. ////////////////////////////////////////////////////////////////////////////
  5.  
  6. #include "StdAfx.h"
  7.  
  8. #include "MannequinInterface.h"
  9.  
  10. #include "ActionController.h"
  11. #include "AnimationDatabaseManager.h"
  12. #include "GameObjects/GameObject.h"
  13. #include "MannequinDebug.h"
  14. #include "ProceduralClipFactory.h"
  15.  
  16. CMannequinInterface::CMannequinInterface()
  17.         : m_pAnimationDatabaseManager(new CAnimationDatabaseManager())
  18.         , m_mannequinGameListeners(0)
  19.         , m_pProceduralClipFactory(new CProceduralClipFactory())
  20.         , m_bSilentPlaybackMode(false)
  21. {
  22.         RegisterCVars();
  23.  
  24.         mannequin::RegisterProceduralClipsForModule(*m_pProceduralClipFactory);
  25. }
  26.  
  27. CMannequinInterface::~CMannequinInterface()
  28. {
  29.         delete m_pAnimationDatabaseManager;
  30. }
  31.  
  32. void CMannequinInterface::UnloadAll()
  33. {
  34.         CActionController::OnShutdown();
  35.         GetAnimationDatabaseManager().UnloadAll();
  36.         GetMannequinUserParamsManager().Clear();
  37. }
  38.  
  39. void CMannequinInterface::ReloadAll()
  40. {
  41.         GetAnimationDatabaseManager().ReloadAll();
  42.         GetMannequinUserParamsManager().ReloadAll(GetAnimationDatabaseManager());
  43. }
  44.  
  45. IAnimationDatabaseManager& CMannequinInterface::GetAnimationDatabaseManager()
  46. {
  47.         CRY_ASSERT(m_pAnimationDatabaseManager != NULL);
  48.         return *m_pAnimationDatabaseManager;
  49. }
  50.  
  51. IActionController* CMannequinInterface::CreateActionController(IEntity* pEntity, SAnimationContext& context)
  52. {
  53.         MEMSTAT_CONTEXT_FMT(EMemStatContextTypes::MSC_Mannequin, 0, "ActionController (%s)", pEntity ? pEntity->GetName() ? pEntity->GetName() : "<unknown>" : "<no entity>");
  54.         return new CActionController(pEntity, context);
  55. }
  56.  
  57. IActionController* CMannequinInterface::FindActionController(const IEntity& entity)
  58. {
  59.         return CActionController::FindActionController(entity);
  60. }
  61.  
  62. IMannequinEditorManager* CMannequinInterface::GetMannequinEditorManager()
  63. {
  64.         return m_pAnimationDatabaseManager;
  65. }
  66.  
  67. void CMannequinInterface::AddMannequinGameListener(IMannequinGameListener* pListener)
  68. {
  69.         m_mannequinGameListeners.push_back(pListener);
  70. }
  71.  
  72. void CMannequinInterface::RemoveMannequinGameListener(IMannequinGameListener* pListener)
  73. {
  74.         m_mannequinGameListeners.erase(std::remove(m_mannequinGameListeners.begin(), m_mannequinGameListeners.end(), pListener), m_mannequinGameListeners.end());
  75. }
  76.  
  77. uint32 CMannequinInterface::GetNumMannequinGameListeners()
  78. {
  79.         return m_mannequinGameListeners.size();
  80. }
  81.  
  82. IMannequinGameListener* CMannequinInterface::GetMannequinGameListener(uint32 idx)
  83. {
  84.         CRY_ASSERT(idx < m_mannequinGameListeners.size());
  85.         return m_mannequinGameListeners[idx];
  86. }
  87.  
  88. CMannequinUserParamsManager& CMannequinInterface::GetMannequinUserParamsManager()
  89. {
  90.         return m_userParamsManager;
  91. }
  92.  
  93. IProceduralClipFactory& CMannequinInterface::GetProceduralClipFactory()
  94. {
  95.         return *m_pProceduralClipFactory;
  96. }
  97.  
  98. void CMannequinInterface::SetSilentPlaybackMode(bool bSilentPlaybackMode)
  99. {
  100.         m_bSilentPlaybackMode = bSilentPlaybackMode;
  101. }
  102.  
  103. bool CMannequinInterface::IsSilentPlaybackMode() const
  104. {
  105.         return m_bSilentPlaybackMode;
  106. }
  107.  
  108. void CMannequinInterface::RegisterCVars()
  109. {
  110.         mannequin::debug::RegisterCommands();
  111.         CAnimationDatabase::RegisterCVars();
  112. #ifndef _RELEASE
  113.         REGISTER_STRING("mn_sequence_path", "Animations/Mannequin/FragmentSequences/", VF_CHEAT, "Default path for CryMannequin sequence files");
  114.         REGISTER_STRING("mn_override_preview_file", "", VF_CHEAT, "Default CryMannequin preview file to use. When set it overrides the corresponding sandbox setting.");
  115. #endif
  116. }
  117.  
downloadMannequinInterface.cpp 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