BVB Source Codes

CRYENGINE Show AnimationTrigger.h Source code

Return Download CRYENGINE: download AnimationTrigger.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // defines a spacial target for exact positioning, with operations we need to perform on these things
  4.  
  5. #ifndef __ANIMATIONTRIGGER_H__
  6. #define __ANIMATIONTRIGGER_H__
  7.  
  8. #pragma once
  9.  
  10. class CAnimationTrigger
  11. {
  12. public:
  13.         CAnimationTrigger();
  14.         CAnimationTrigger(const Vec3& pos, float width, const Vec3& triggerSize, const Quat& orient, float orientTolerance, float animMovementLength);
  15.  
  16.         void Update(float frameTime, Vec3 userPos, Quat userOrient, bool allowTriggering);
  17.         void DebugDraw();
  18.  
  19.         bool IsReached() const   { return m_state >= eS_Optimizing; }
  20.         bool IsTriggered() const { return m_state >= eS_Triggered; }
  21.  
  22.         void ResetRadius(const Vec3& triggerSize, float orientTolerance);
  23.         void SetDistanceErrorFactor(float factor) { m_distanceErrorFactor = factor; }
  24.  
  25. private:
  26.         enum EState
  27.         {
  28.                 eS_Invalid,
  29.                 eS_Initializing,
  30.                 eS_Before,
  31.                 eS_Optimizing,
  32.                 eS_Triggered
  33.         };
  34.  
  35.         Vec3   m_pos;
  36.         float  m_width;
  37.         Vec3   m_posSize;
  38.         Quat   m_orient;
  39.         float  m_cosOrientTolerance;
  40.         float  m_sideTime;
  41.         float  m_distanceErrorFactor;
  42.  
  43.         float  m_animMovementLength;
  44.         float  m_distanceError;
  45.         float  m_orientError;
  46.         float  m_oldFwdDir;
  47.  
  48.         EState m_state;
  49.  
  50.         Vec3   m_userPos;
  51.         Quat   m_userOrient;
  52. };
  53.  
  54. #endif
  55.  
downloadAnimationTrigger.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