home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 89 / CDPowerplay89Disc1.iso / Demos / ui_hulk_demo_en.exe / Disk1 / data1.cab / App_Levels / scripts / physics.lua < prev   
Encoding:
Text File  |  2003-05-09  |  3.1 KB  |  72 lines

  1. -- Set up physics parameters
  2.  
  3. --  Here are the rule for creating physics properties:
  4. --
  5. --  The parameters are:
  6. --
  7. --  RestCoeff, restitution coefficient, indicates the bounciness of the material.
  8. --      1.0: means not bouncy at all, a value lower than 0 not be physically plausible
  9. --      2.0: very bouncy, bounce as high as the initial, a value larger than 2 would not be physically plausible
  10. --
  11. --  FrictCoeff, the friction coefficient.
  12. --      0.0: indicates no friction at all.
  13. --      The higher the value, the more friction there is.
  14. --
  15. --  TangRestCoeff, the tangential restitution of coefficient. 
  16. --  Indicates the collision response tangential to the collision normal.
  17. --      -1: no response, this cause the friction to be null.
  18. --          -0.5 will cause the final relative tangential velocity (rtv) to be 0.5 the initial one. etc.
  19. --      0.: the rtv at the contact points is absorbed. They stick together. There is no sliding. etc.
  20. --          0.5 will cause the final relative tangential velocity (rtv) to be 0.5 the initial one in the opposite direction.
  21. --      1.0:The rtv is reversed. 
  22. --          A rotating rubber ball bouncing will see its rotation speed to be reversed if there is enough friction.
  23. --  *This parameter will act as long as the combined friction is high enough.
  24. --
  25. --  Density:
  26. --      1.0 is water, the density is larger than 0.
  27.  
  28. -- THESE ARE MARTIN'S DEFAULT VALUES FOR REFERENCE, DO NOT EDIT
  29. --"hardwood", 1.5f, 2.0f, -0.75f, 0.97f
  30. --"softwood", 1.2f, 2.0f, -0.75f, 0.5f
  31. --"hardrubber", 1.9f, 100.0f, 0.5f, 1.3f
  32. --"softrubber", 1.1f, 100.0f, 0.5f, 1.3f
  33. --"hardmetal", 1.4f, 100.0f, -0.85f, 10.0f
  34. --"softmetal", 1.1f, 100.0f, -0.85f, 2.7f
  35. --"concrete", 1.05f, 1000.0f, -0.8f, 2.3f
  36. --"sticky", 1.05f, 100000.0f, 0.0f, 1.0f
  37. --"icy", 1.05f, 0.0f, -1.0f); // at -1.0 for tanrest, friction is ignored
  38.  
  39. -- spm_PhysicsProperty(name, restitution, friction, tangentialRestitution, density); 
  40.  
  41. spm_PhysicsProperty("defaultPhysicsProperties", 1.0, 10000.0, -0.2, 10000.0);  -- used for the floor
  42. spm_PhysicsProperty("hardwood", 1.5, 2.0, -.75, 0.97);
  43. spm_PhysicsProperty("softwood", 1.2, 2.0, -.75, 0.5);
  44. spm_PhysicsProperty("hardrubber", 1.9, 100.0, 0.5, 1.3);
  45. spm_PhysicsProperty("softrubber", 1.1, 100.0, 0.5, 1.3);
  46. spm_PhysicsProperty("hardmetal", 1.4, 100.0, -0.85, 8.0);
  47. spm_PhysicsProperty("softmetal", 1.1, 100.0, -0.85, 2.7);
  48. spm_PhysicsProperty("concrete", 1.05, 1000.0, -0.8, 2.3);
  49. spm_PhysicsProperty("sticky", 1.05, 100000.0, 0.0, 1.0);
  50. spm_PhysicsProperty("icy", 1.05, 0.0, -1.0, 1.0);
  51. spm_PhysicsProperty("glass", 1.4, 100.0, -0.85, 1.0);
  52.  
  53. -- This is Earth Gravity
  54. --cm_SetGravity(0,-980,0);  
  55.  
  56. -- This is Hulk Gravity
  57. cm_SetGravity(0,-3000,0);
  58.  
  59. -- Set the distance key objects will be thrown.  Other objects will have their throw distances
  60. -- calculated (interpolated by mass) based on these values. 
  61. -- spm_ThrowDistance("object", distance)
  62.  
  63. --"tank"
  64. spm_SetThrowPair(500, 18.5);
  65. --"car"
  66. spm_SetThrowPair(175, 30.5);
  67. --"small boulder"
  68. spm_SetThrowPair(30, 32.5);
  69. --"large crate"
  70. spm_SetThrowPair(10, 46.0);
  71. --"small crate"
  72. spm_SetThrowPair(5, 50.0);