deceleration_distance
/*
** Usage:
** deceleration_distance(speed,friction)
**
** Arguments:
** speed speed, real
** friction deceleration rate, real
**
** Returns:
** the distance travelled by an object moving at the
** the given speed with the given rate of deceleration
**
** Notes:
** This function has been tuned to accurately predict
** the results of Game Maker's built-in friction physics.
**
** GMLscripts.com
*/
{
var s,f;
s = argument0;
f = argument1;
if (f == 0) return -1 else return (s*(s-f))/(2*f);
}
** Usage:
** deceleration_distance(speed,friction)
**
** Arguments:
** speed speed, real
** friction deceleration rate, real
**
** Returns:
** the distance travelled by an object moving at the
** the given speed with the given rate of deceleration
**
** Notes:
** This function has been tuned to accurately predict
** the results of Game Maker's built-in friction physics.
**
** GMLscripts.com
*/
{
var s,f;
s = argument0;
f = argument1;
if (f == 0) return -1 else return (s*(s-f))/(2*f);
}
[Please Login]
Projects: 6
Contributor: xot
comments powered by Disqus

Related: deceleration_distance,