BVB Source Codes

CRYENGINE Show LookAtSimple.h Source code

Return Download CRYENGINE: download LookAtSimple.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef LookAtSimple_h
  4. #define LookAtSimple_h
  5.  
  6. #include <CryExtension/ClassWeaver.h>
  7.  
  8. namespace AnimPoseModifier {
  9.  
  10. class CRY_ALIGN(32) CLookAtSimple:
  11.         public IAnimationPoseModifier
  12. {
  13. private:
  14.         struct State
  15.         {
  16.                 int32 jointId;
  17.                 Vec3  jointOffsetRelative;
  18.                 Vec3  targetGlobal;
  19.                 f32   weight;
  20.         };
  21.  
  22. public:
  23.         CRYINTERFACE_BEGIN()
  24.         CRYINTERFACE_ADD(IAnimationPoseModifier)
  25.         CRYINTERFACE_END()
  26.  
  27.         CRYGENERATE_CLASS(CLookAtSimple, "AnimationPoseModifier_LookAtSimple", 0xba7e2a809970435f, 0xb6679c08df616d74);
  28.  
  29.         CLookAtSimple();
  30.         virtual ~CLookAtSimple() {}
  31.  
  32. public:
  33.         void SetJointId(uint32 id)                      { m_state.jointId = id; }
  34.         void SetJointOffsetRelative(const Vec3& offset) { m_state.jointOffsetRelative = offset; }
  35.  
  36.         void SetTargetGlobal(const Vec3& target)        { m_state.targetGlobal = target; }
  37.  
  38.         void SetWeight(f32 weight)                      { m_state.weight = weight; }
  39.  
  40. private:
  41.         bool ValidateJointId(IDefaultSkeleton & pModelSkeleton);
  42.  
  43.         // IAnimationPoseModifier
  44. public:
  45.         virtual bool Prepare(const SAnimationPoseModifierParams &params) override;
  46.         virtual bool Execute(const SAnimationPoseModifierParams &params) override;
  47.         virtual void Synchronize() override;
  48.  
  49.         void GetMemoryUsage(ICrySizer* pSizer) const override
  50.         {
  51.                 pSizer->AddObject(this, sizeof(*this));
  52.         }
  53.  
  54. private:
  55.         State m_state;
  56.         State m_stateExecute;
  57. };
  58.  
  59. } // namespace AnimPoseModifier
  60.  
  61. #endif // LookAtSimple_h
  62.  
downloadLookAtSimple.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