Team Fortress 2 Source Code as on 22/4/2020
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.

98 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "movieobjects/dmetransforminput.h"
  7. #include "movieobjects_interfaces.h"
  8. #include "datamodel/dmelementfactoryhelper.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // Expose this class to the scene database
  13. //-----------------------------------------------------------------------------
  14. IMPLEMENT_ELEMENT_FACTORY( DmeTranslationInput, CDmeTranslationInput );
  15. void CDmeTranslationInput::OnConstruction()
  16. {
  17. m_translation.Init( this, "translation" );
  18. }
  19. void CDmeTranslationInput::OnDestruction()
  20. {
  21. }
  22. bool CDmeTranslationInput::IsDirty()
  23. {
  24. return true;
  25. }
  26. void CDmeTranslationInput::Operate()
  27. {
  28. }
  29. void CDmeTranslationInput::GetInputAttributes( CUtlVector< CDmAttribute * > &attrs )
  30. {
  31. }
  32. void CDmeTranslationInput::GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs )
  33. {
  34. attrs.AddToTail( m_translation.GetAttribute() );
  35. }
  36. //-----------------------------------------------------------------------------
  37. // Expose this class to the scene database
  38. //-----------------------------------------------------------------------------
  39. IMPLEMENT_ELEMENT_FACTORY( DmeRotationInput, CDmeRotationInput );
  40. void CDmeRotationInput::OnConstruction()
  41. {
  42. m_orientation.Init( this, "orientation" );
  43. m_angles.Init( this, "angles" );
  44. }
  45. void CDmeRotationInput::OnDestruction()
  46. {
  47. }
  48. bool CDmeRotationInput::IsDirty()
  49. {
  50. return true;
  51. }
  52. void CDmeRotationInput::Operate()
  53. {
  54. }
  55. void CDmeRotationInput::GetInputAttributes( CUtlVector< CDmAttribute * > &attrs )
  56. {
  57. }
  58. void CDmeRotationInput::GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs )
  59. {
  60. attrs.AddToTail( m_orientation.GetAttribute() );
  61. attrs.AddToTail( m_angles.GetAttribute() );
  62. }
  63. void CDmeRotationInput::SetRotation( const Quaternion& quat )
  64. {
  65. QAngle qangle;
  66. QuaternionAngles( quat, qangle );
  67. m_angles = qangle;
  68. m_orientation = quat;
  69. }
  70. void CDmeRotationInput::SetRotation( const QAngle& qangle )
  71. {
  72. Quaternion quat;
  73. AngleQuaternion( qangle, quat );
  74. m_orientation = quat;
  75. m_angles = qangle;
  76. }