BVB Source Codes

CRYENGINE Show ControllerTCB.cpp Source code

Return Download CRYENGINE: download ControllerTCB.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 "ControllerTCB.h"
  5.  
  6. #include "CharacterManager.h"
  7.  
  8. JointState CControllerTCB::GetOPS(f32 time, Quat& quat, Vec3& pos, Diag33& scl) const
  9. {
  10.         return
  11.           CControllerTCB::GetO(time, quat) |
  12.           CControllerTCB::GetP(time, pos) |
  13.           CControllerTCB::GetS(time, scl);
  14. }
  15.  
  16. JointState CControllerTCB::GetOP(f32 time, Quat& quat, Vec3& pos) const
  17. {
  18.         return
  19.           CControllerTCB::GetO(time, quat) |
  20.           CControllerTCB::GetP(time, pos);
  21. }
  22.  
  23. JointState CControllerTCB::GetO(f32 key, Quat& rot) const
  24. {
  25.         if (m_active & eJS_Orientation)
  26.         {
  27.                 rot = static_cast<spline::TCBAngleAxisSpline>(m_rotTrack).interpolate(key);
  28.                 rot.Invert();
  29.         }
  30.         return m_active & eJS_Orientation;
  31. }
  32.  
  33. JointState CControllerTCB::GetP(f32 key, Vec3& pos) const
  34. {
  35.         if (m_active & eJS_Position)
  36.         {
  37.                 static_cast<spline::TCBSpline<Vec3>>(m_posTrack).interpolate(key, pos);
  38.                 pos /= 100.0f; // Position controller from Max must be scaled 100 times down.
  39.         }
  40.         return m_active & eJS_Position;
  41. }
  42.  
  43. JointState CControllerTCB::GetS(f32 key, Diag33& scl) const
  44. {
  45.         if (m_active & eJS_Scale)
  46.         {
  47.                 Vec3 out;
  48.                 static_cast<spline::TCBSpline<Vec3>>(m_sclTrack).interpolate(key, out);
  49.                 scl = Diag33(out);
  50.         }
  51.         return m_active & eJS_Scale;
  52. }
  53.  
downloadControllerTCB.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