home *** CD-ROM | disk | FTP | other *** search
- -- Set up physics parameters
-
- -- Here are the rule for creating physics properties:
- --
- -- The parameters are:
- --
- -- RestCoeff, restitution coefficient, indicates the bounciness of the material.
- -- 1.0: means not bouncy at all, a value lower than 0 not be physically plausible
- -- 2.0: very bouncy, bounce as high as the initial, a value larger than 2 would not be physically plausible
- --
- -- FrictCoeff, the friction coefficient.
- -- 0.0: indicates no friction at all.
- -- The higher the value, the more friction there is.
- --
- -- TangRestCoeff, the tangential restitution of coefficient.
- -- Indicates the collision response tangential to the collision normal.
- -- -1: no response, this cause the friction to be null.
- -- -0.5 will cause the final relative tangential velocity (rtv) to be 0.5 the initial one. etc.
- -- 0.: the rtv at the contact points is absorbed. They stick together. There is no sliding. etc.
- -- 0.5 will cause the final relative tangential velocity (rtv) to be 0.5 the initial one in the opposite direction.
- -- 1.0:The rtv is reversed.
- -- A rotating rubber ball bouncing will see its rotation speed to be reversed if there is enough friction.
- -- *This parameter will act as long as the combined friction is high enough.
- --
- -- Density:
- -- 1.0 is water, the density is larger than 0.
-
- -- THESE ARE MARTIN'S DEFAULT VALUES FOR REFERENCE, DO NOT EDIT
- --"hardwood", 1.5f, 2.0f, -0.75f, 0.97f
- --"softwood", 1.2f, 2.0f, -0.75f, 0.5f
- --"hardrubber", 1.9f, 100.0f, 0.5f, 1.3f
- --"softrubber", 1.1f, 100.0f, 0.5f, 1.3f
- --"hardmetal", 1.4f, 100.0f, -0.85f, 10.0f
- --"softmetal", 1.1f, 100.0f, -0.85f, 2.7f
- --"concrete", 1.05f, 1000.0f, -0.8f, 2.3f
- --"sticky", 1.05f, 100000.0f, 0.0f, 1.0f
- --"icy", 1.05f, 0.0f, -1.0f); // at -1.0 for tanrest, friction is ignored
-
- -- spm_PhysicsProperty(name, restitution, friction, tangentialRestitution, density);
-
- spm_PhysicsProperty("defaultPhysicsProperties", 1.0, 10000.0, -0.2, 10000.0); -- used for the floor
- spm_PhysicsProperty("hardwood", 1.5, 2.0, -.75, 0.97);
- spm_PhysicsProperty("softwood", 1.2, 2.0, -.75, 0.5);
- spm_PhysicsProperty("hardrubber", 1.9, 100.0, 0.5, 1.3);
- spm_PhysicsProperty("softrubber", 1.1, 100.0, 0.5, 1.3);
- spm_PhysicsProperty("hardmetal", 1.4, 100.0, -0.85, 8.0);
- spm_PhysicsProperty("softmetal", 1.1, 100.0, -0.85, 2.7);
- spm_PhysicsProperty("concrete", 1.05, 1000.0, -0.8, 2.3);
- spm_PhysicsProperty("sticky", 1.05, 100000.0, 0.0, 1.0);
- spm_PhysicsProperty("icy", 1.05, 0.0, -1.0, 1.0);
- spm_PhysicsProperty("glass", 1.4, 100.0, -0.85, 1.0);
-
- -- This is Earth Gravity
- --cm_SetGravity(0,-980,0);
-
- -- This is Hulk Gravity
- cm_SetGravity(0,-3000,0);
-
- -- Set the distance key objects will be thrown. Other objects will have their throw distances
- -- calculated (interpolated by mass) based on these values.
- -- spm_ThrowDistance("object", distance)
-
- --"tank"
- spm_SetThrowPair(500, 18.5);
- --"car"
- spm_SetThrowPair(175, 30.5);
- --"small boulder"
- spm_SetThrowPair(30, 32.5);
- --"large crate"
- spm_SetThrowPair(10, 46.0);
- --"small crate"
- spm_SetThrowPair(5, 50.0);