Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.9 KiB

  1. //===== Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ====
  2. //
  3. // Animation/Sequence events
  4. //
  5. //==========================================================================
  6. // Valve includes
  7. #include "mdlobjects/dmemotioncontrol.h"
  8. #include "datamodel/dmelementfactoryhelper.h"
  9. #include "studio.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. //-----------------------------------------------------------------------------
  13. // Expose this class to the scene database
  14. //-----------------------------------------------------------------------------
  15. IMPLEMENT_ELEMENT_FACTORY( DmeMotionControl, CDmeMotionControl );
  16. //-----------------------------------------------------------------------------
  17. //
  18. //-----------------------------------------------------------------------------
  19. void CDmeMotionControl::OnConstruction()
  20. {
  21. m_bX.Init( this, "X" );
  22. m_bY.Init( this, "Y" );
  23. m_bZ.Init( this, "Z" );
  24. m_bXR.Init( this, "XR" );
  25. m_bYR.Init( this, "YR" );
  26. m_bZR.Init( this, "ZR" );
  27. m_bLX.Init( this, "LX" );
  28. m_bLY.Init( this, "LY" );
  29. m_bLZ.Init( this, "LZ" );
  30. m_bLXR.Init( this, "LXR" );
  31. m_bLYR.Init( this, "LYR" );
  32. m_bLZR.Init( this, "LZR" );
  33. m_bLM.Init( this, "LM" );
  34. }
  35. //-----------------------------------------------------------------------------
  36. //
  37. //-----------------------------------------------------------------------------
  38. void CDmeMotionControl::OnDestruction()
  39. {
  40. }
  41. //-----------------------------------------------------------------------------
  42. //
  43. //-----------------------------------------------------------------------------
  44. void CDmeMotionControl::SetStudioMotionControl( int nStudioMotionControl )
  45. {
  46. m_bX = ( nStudioMotionControl & STUDIO_X ) != 0;
  47. m_bY = ( nStudioMotionControl & STUDIO_Y ) != 0;
  48. m_bZ = ( nStudioMotionControl & STUDIO_Z ) != 0;
  49. m_bXR = ( nStudioMotionControl & STUDIO_XR ) != 0;
  50. m_bYR = ( nStudioMotionControl & STUDIO_YR ) != 0;
  51. m_bZR = ( nStudioMotionControl & STUDIO_ZR ) != 0;
  52. m_bLX = ( nStudioMotionControl & STUDIO_LX ) != 0;
  53. m_bLY = ( nStudioMotionControl & STUDIO_LY ) != 0;
  54. m_bLZ = ( nStudioMotionControl & STUDIO_LZ ) != 0;
  55. m_bLXR = ( nStudioMotionControl & STUDIO_LXR ) != 0;
  56. m_bLYR = ( nStudioMotionControl & STUDIO_LYR ) != 0;
  57. m_bLZR = ( nStudioMotionControl & STUDIO_LZR ) != 0;
  58. m_bLM = ( nStudioMotionControl & STUDIO_LINEAR ) != 0;
  59. }
  60. //-----------------------------------------------------------------------------
  61. //
  62. //-----------------------------------------------------------------------------
  63. int CDmeMotionControl::GetStudioMotionControl() const
  64. {
  65. return ( m_bX ? STUDIO_X : 0 ) |
  66. ( m_bY ? STUDIO_Y : 0 ) |
  67. ( m_bZ ? STUDIO_Z : 0 ) |
  68. ( m_bXR ? STUDIO_XR : 0 ) |
  69. ( m_bYR ? STUDIO_YR : 0 ) |
  70. ( m_bZR ? STUDIO_ZR : 0 ) |
  71. ( m_bLX ? STUDIO_LX : 0 ) |
  72. ( m_bLY ? STUDIO_LY : 0 ) |
  73. ( m_bLZ ? STUDIO_LZ : 0 ) |
  74. ( m_bLXR ? STUDIO_LXR : 0 ) |
  75. ( m_bLYR ? STUDIO_LYR : 0 ) |
  76. ( m_bLZR ? STUDIO_LZR : 0 ) |
  77. ( m_bLM ? STUDIO_LINEAR : 0 );
  78. }