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.

48 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=============================================================================
  4. // Valve includes
  5. #include "datamodel/dmelementfactoryhelper.h"
  6. #include "movieobjects/dmeeyeball.h"
  7. // memdbgon must be the last include file in a .cpp file!!!
  8. #include "tier0/memdbgon.h"
  9. //-----------------------------------------------------------------------------
  10. // Expose this class to the scene database
  11. //-----------------------------------------------------------------------------
  12. IMPLEMENT_ELEMENT_FACTORY( DmeEyeball, CDmeEyeball );
  13. //-----------------------------------------------------------------------------
  14. //
  15. //-----------------------------------------------------------------------------
  16. void CDmeEyeball::OnConstruction()
  17. {
  18. m_flDiameter.InitAndSet( this, "diameter", 1.0 );
  19. m_flYawAngle.InitAndSet( this, "angle", 2.0 );
  20. m_flPupilScale.InitAndSet( this, "pupilScale", 1.0 );
  21. }
  22. //-----------------------------------------------------------------------------
  23. //
  24. //-----------------------------------------------------------------------------
  25. void CDmeEyeball::OnDestruction()
  26. {
  27. }
  28. //-----------------------------------------------------------------------------
  29. // Returns the model relative position of the eyeball Position
  30. //-----------------------------------------------------------------------------
  31. void CDmeEyeball::GetWorldPosition( Vector &worldPosition )
  32. {
  33. matrix3x4_t mWorld;
  34. GetShapeToWorldTransform( mWorld );
  35. MatrixPosition( mWorld, worldPosition );
  36. }