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.

43 lines
1.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef PERFORMANCE_H
  7. #define PERFORMANCE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. const float k_flMaxVelocity = 2000.0f;
  12. const float k_flMaxAngularVelocity = 360.0f * 10.0f;
  13. const float DEFAULT_MIN_FRICTION_MASS = 10.0f;
  14. const float DEFAULT_MAX_FRICTION_MASS = 2500.0f;
  15. struct physics_performanceparams_t
  16. {
  17. int maxCollisionsPerObjectPerTimestep; // object will be frozen after this many collisions (visual hitching vs. CPU cost)
  18. int maxCollisionChecksPerTimestep; // objects may penetrate after this many collision checks (can be extended in AdditionalCollisionChecksThisTick)
  19. float maxVelocity; // limit world space linear velocity to this (in / s)
  20. float maxAngularVelocity; // limit world space angular velocity to this (degrees / s)
  21. float lookAheadTimeObjectsVsWorld; // predict collisions this far (seconds) into the future
  22. float lookAheadTimeObjectsVsObject; // predict collisions this far (seconds) into the future
  23. float minFrictionMass; // min mass for friction solves (constrains dynamic range of mass to improve stability)
  24. float maxFrictionMass; // mas mass for friction solves
  25. void Defaults()
  26. {
  27. maxCollisionsPerObjectPerTimestep = 6;
  28. maxCollisionChecksPerTimestep = 250;
  29. maxVelocity = k_flMaxVelocity;
  30. maxAngularVelocity = k_flMaxAngularVelocity;
  31. lookAheadTimeObjectsVsWorld = 1.0f;
  32. lookAheadTimeObjectsVsObject = 0.5f;
  33. minFrictionMass = DEFAULT_MIN_FRICTION_MASS;
  34. maxFrictionMass = DEFAULT_MAX_FRICTION_MASS;
  35. }
  36. };
  37. #endif // PERFORMANCE_H