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.

51 lines
1.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef FRICTION_H
  7. #define FRICTION_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. // NOTE: This is an iterator for the contact points on an object
  12. // NOTE: This should only be used temporarily. Holding one of these
  13. // NOTE: across collision callbacks or calls into simulation will cause errors!
  14. // NOTE: VPHYSICS may choose to make the data contained within this object invalid
  15. // NOTE: any time simulation is run.
  16. class IPhysicsFrictionSnapshot
  17. {
  18. public:
  19. virtual ~IPhysicsFrictionSnapshot() {}
  20. virtual bool IsValid() = 0;
  21. // Object 0 is this object, Object 1 is the other object
  22. virtual IPhysicsObject *GetObject( int index ) = 0;
  23. virtual int GetMaterial( int index ) = 0;
  24. virtual void GetContactPoint( Vector &out ) = 0;
  25. // points away from source object
  26. virtual void GetSurfaceNormal( Vector &out ) = 0;
  27. virtual float GetNormalForce() = 0;
  28. virtual float GetEnergyAbsorbed() = 0;
  29. // recompute friction (useful if dynamically altering materials/mass)
  30. virtual void RecomputeFriction() = 0;
  31. // clear all friction force at this contact point
  32. virtual void ClearFrictionForce() = 0;
  33. virtual void MarkContactForDelete() = 0;
  34. virtual void DeleteAllMarkedContacts( bool wakeObjects ) = 0;
  35. // Move to the next friction data for this object
  36. virtual void NextFrictionData() = 0;
  37. virtual float GetFrictionCoefficient() = 0;
  38. };
  39. #endif // FRICTION_H