Constant friction force
2 posts • Page 1 of 1
Constant friction force
It can be very useful for top view games like pool.
It's a script for circles with constant air friction (works with any custom air).
force (in Newtons) is adjusted via _frictionForce variable
Just put that code into circle's script window and it will behave like a hockey puck
It's a script for circles with constant air friction (works with any custom air).
force (in Newtons) is adjusted via _frictionForce variable
- Code: Select all
_frictionForce = 1;
airFrictionMult = {
circle := readable(owner);
v := circle.vel;
u2 := (v(0) * v(0) + v(1) * v(1));
u := u2 ^ 0.50000000;
d := circle.radius * 2;
ff := d * (Sim.airFrictionLinear * u + Sim.airFrictionQuadratic * u2);
ff == 0 ? 1 : {owner._frictionForce / ff / Sim.airFrictionMultiplier}
}
Just put that code into circle's script window and it will behave like a hockey puck
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests




