Box-Wing
2 posts • Page 1 of 1
Box-Wing
Now simplest wing ever:
for box:
for box:
- Code: Select all
_airForceMult := 0.05;
airFrictionMult = { v := entity.vel;
n := [ - math.sin(entity.angle), math.cos(entity.angle)];
vn := ((v(0) * n(0) + v(1) * n(1)));
entity.vel = entity.vel - n * vn * entity._airForceMult;
0}
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
Re: Box-Wing
and for airplanes is more realistic code with quadratic force part:
- Code: Select all
_airForceMult := 0.1;
_airForceMult2 := 0.01;
airFrictionMult = {v := entity.vel;
n := [ - math.sin(entity.angle), math.cos(entity.angle)];
vn := ((v(0) * n(0) + v(1) * n(1)));
v1 := n * vn * entity._airForceMult;
v2 := n * vn * vn * entity._airForceMult2;
entity.vel = entity.vel - v1 - (vn > 0 ? v2 : - v2);
0
}
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 19 guests