BVB Source Codes

CRYENGINE Show MannequinGoalOp.cpp Source code

Return Download CRYENGINE: download MannequinGoalOp.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4. #include "MannequinGoalOp.h"
  5. #include "PipeUser.h"
  6. #include "AIBubblesSystem/AIBubblesSystem.h"
  7.  
  8. //////////////////////////////////////////////////////////////////////////
  9. CMannequinTagGoalOp::CMannequinTagGoalOp()
  10.         : m_tagCrc(0)
  11. {
  12. }
  13.  
  14. CMannequinTagGoalOp::CMannequinTagGoalOp(const char* tagName)
  15.         : m_tagCrc(0)
  16. {
  17.         assert(tagName);
  18.         assert(tagName[0] != 0);
  19.  
  20.         m_tagCrc = CCrc32::ComputeLowercase(tagName);
  21. }
  22.  
  23. CMannequinTagGoalOp::CMannequinTagGoalOp(const uint32 tagCrc)
  24.         : m_tagCrc(tagCrc)
  25. {
  26. }
  27.  
  28. CMannequinTagGoalOp::CMannequinTagGoalOp(const XmlNodeRef& node)
  29.         : m_tagCrc(0)
  30. {
  31.         assert(node != 0);
  32.  
  33.         const char* tagName = 0;
  34.         if (node->getAttr("name", &tagName))
  35.         {
  36.                 m_tagCrc = CCrc32::ComputeLowercase(tagName);
  37.         }
  38.         else
  39.         {
  40.                 CryWarning(VALIDATOR_MODULE_AI, VALIDATOR_ERROR, "Animation tag GoalOp doesn't have a 'name' attribute.");
  41.         }
  42. }
  43.  
  44. //////////////////////////////////////////////////////////////////////////
  45. CSetAnimationTagGoalOp::CSetAnimationTagGoalOp()
  46.         : CMannequinTagGoalOp()
  47. {
  48. }
  49.  
  50. CSetAnimationTagGoalOp::CSetAnimationTagGoalOp(const char* tagName)
  51.         : CMannequinTagGoalOp(tagName)
  52. {
  53. }
  54.  
  55. CSetAnimationTagGoalOp::CSetAnimationTagGoalOp(const uint32 tagCrc)
  56.         : CMannequinTagGoalOp(tagCrc)
  57. {
  58. }
  59.  
  60. CSetAnimationTagGoalOp::CSetAnimationTagGoalOp(const XmlNodeRef& node)
  61.         : CMannequinTagGoalOp(node)
  62. {
  63. }
  64.  
  65. void CSetAnimationTagGoalOp::Update(CPipeUser& pipeUser)
  66. {
  67.         SOBJECTSTATE& state = pipeUser.GetState();
  68.         const uint32 tagCrc = GetTagCrc();
  69.  
  70.         const aiMannequin::SCommand* pCommand = state.mannequinRequest.CreateSetTagCommand(tagCrc);
  71.         if (pCommand != NULL)
  72.         {
  73.                 GoalOpSucceeded();
  74.         }
  75.         else
  76.         {
  77.                 const EntityId entityId = pipeUser.GetEntityID();
  78.                 AIQueueBubbleMessage("CMannequinSetTagGoalOp::Update", entityId, "Could not add a set tag command to the mannequin request this frame.", eBNS_LogWarning);
  79.         }
  80. }
  81.  
  82. //////////////////////////////////////////////////////////////////////////
  83. CClearAnimationTagGoalOp::CClearAnimationTagGoalOp()
  84.         : CMannequinTagGoalOp()
  85. {
  86. }
  87.  
  88. CClearAnimationTagGoalOp::CClearAnimationTagGoalOp(const char* tagName)
  89.         : CMannequinTagGoalOp(tagName)
  90. {
  91. }
  92.  
  93. CClearAnimationTagGoalOp::CClearAnimationTagGoalOp(const uint32 tagCrc)
  94.         : CMannequinTagGoalOp(tagCrc)
  95. {
  96. }
  97.  
  98. CClearAnimationTagGoalOp::CClearAnimationTagGoalOp(const XmlNodeRef& node)
  99.         : CMannequinTagGoalOp(node)
  100. {
  101. }
  102.  
  103. void CClearAnimationTagGoalOp::Update(CPipeUser& pipeUser)
  104. {
  105.         SOBJECTSTATE& state = pipeUser.GetState();
  106.         const uint32 tagCrc = GetTagCrc();
  107.  
  108.         const aiMannequin::SCommand* pCommand = state.mannequinRequest.CreateClearTagCommand(tagCrc);
  109.         if (pCommand != NULL)
  110.         {
  111.                 GoalOpSucceeded();
  112.         }
  113.         else
  114.         {
  115.                 const EntityId entityId = pipeUser.GetEntityID();
  116.                 AIQueueBubbleMessage("CMannequinClearTagGoalOp::Update", entityId, "Could not add a clear tag command to the mannequin request this frame.", eBNS_LogWarning);
  117.         }
  118. }
  119.  
downloadMannequinGoalOp.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