SarahNorthway

Untitled

Jun 18th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. /*
  2. * Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. * Permission is granted to anyone to use this software for any purpose,
  8. * including commercial applications, and to alter it and redistribute it
  9. * freely, subject to the following restrictions:
  10. * 1. The origin of this software must not be misrepresented; you must not
  11. * claim that you wrote the original software. If you use this software
  12. * in a product, an acknowledgment in the product documentation would be
  13. * appreciated but is not required.
  14. * 2. Altered source versions must be plainly marked as such, and must not be
  15. * misrepresented as being the original software.
  16. * 3. This notice may not be removed or altered from any source distribution.
  17. */
  18.  
  19. package Box2D.Common{
  20.  
  21.  
  22. import Box2D.Common.Math.*
  23.  
  24.  
  25. public class b2Settings{
  26.  
  27. static public const USHRT_MAX:int = 0x0000ffff;
  28.  
  29. static public const b2_pi:Number = Math.PI;
  30.  
  31. // Define your unit system here. The default system is
  32. // meters-kilograms-seconds. For the tuning to work well,
  33. // your dynamic objects should be bigger than a pebble and smaller
  34. // than a house.
  35. //static public const b2_lengthUnitsPerMeter:Number = 1.0;
  36. static public const b2_massUnitsPerKilogram:Number = 1.0;
  37. static public const b2_timeUnitsPerSecond:Number = 1.0;
  38.  
  39. // Use this for pixels:
  40. static public const b2_lengthUnitsPerMeter:Number = 30.0;
  41.  
  42. // Global tuning constants based on MKS units.
  43.  
  44. // Collision
  45. static public const b2_maxManifoldPoints:int = 2;
  46. static public const b2_maxShapesPerBody:int = 64;
  47. static public const b2_maxPolyVertices:int = 8;
  48. // Sarah 2020 fix the black hole bug
  49. static public const b2_maxProxies:int = 4096; // this must be a power of two
  50. //static public const b2_maxProxies:int = 1024; // this must be a power of two
  51. static public const b2_maxPairs:int = 8 * b2_maxProxies; // this must be a power of two
  52.  
  53. // Dynamics
  54. static public const b2_linearSlop:Number = 0.005 * b2_lengthUnitsPerMeter; // 0.5 cm
  55. static public const b2_angularSlop:Number = 2.0 / 180.0 * b2_pi; // 2 degrees
  56. static public const b2_velocityThreshold:Number = 1.0 * b2_lengthUnitsPerMeter / b2_timeUnitsPerSecond; // 1 m/s
  57. static public const b2_maxLinearCorrection:Number = 0.2 * b2_lengthUnitsPerMeter; // 20 cm
  58. static public const b2_maxAngularCorrection:Number = 8.0 / 180.0 * b2_pi; // 8 degrees
  59. static public const b2_contactBaumgarte:Number = 0.2;
  60.  
  61. // Sleep
  62. static public const b2_timeToSleep:Number = 0.5 * b2_timeUnitsPerSecond; // half a second
  63. static public const b2_linearSleepTolerance:Number = 0.01 * b2_lengthUnitsPerMeter / b2_timeUnitsPerSecond; // 1 cm/s
  64. static public const b2_angularSleepTolerance:Number = 2.0 / 180.0 / b2_timeUnitsPerSecond; // 2 degrees/s
  65.  
  66. // assert
  67. static public function b2Assert(a:Boolean) : void
  68. {
  69. if (!a){
  70. var nullVec:b2Vec2;
  71. nullVec.x++;
  72. }
  73. }
  74. }
  75.  
  76. }
Add Comment
Please, Sign In to add comment