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.

49 lines
1.5 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // A class representing a procedural texture
  4. //
  5. //=============================================================================
  6. #ifndef DMECYCLE_H
  7. #define DMECYCLE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/dmelement.h"
  12. //-----------------------------------------------------------------------------
  13. // Forward declarations
  14. //-----------------------------------------------------------------------------
  15. class CDmeDag;
  16. //-----------------------------------------------------------------------------
  17. // A class representing a cycle, which can arbitrarily break C1 continuity.
  18. // When these jumps occur, we need to make sure we interpolate properly.
  19. //-----------------------------------------------------------------------------
  20. class CDmeCycle : public CDmElement
  21. {
  22. DEFINE_ELEMENT( CDmeCycle, CDmElement );
  23. public:
  24. float GetCycle( float flCurTime ) const;
  25. float GetCycleRate() const;
  26. float GetPrevCycle() const;
  27. void SetCycle( float flCycle, float flCurTime );
  28. void SetCycleRate( float flCycleRate );
  29. // If transform is contained inside some kind of CDmeDag, return that (it's "parent")
  30. CDmeDag *GetDag();
  31. private:
  32. void SetPrevCycle( float flPrevCycle );
  33. CDmaVar<float> m_cycleRate;
  34. CDmaVar<int> m_prevCycle; // NOTE: Stored as an integers so they will not be interpolated
  35. CDmaVar<int> m_lastCycleResetTime;
  36. CDmaVar<int> m_lastCycleResetValue;
  37. };
  38. #endif // DMECYCLE_H