- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
procedure TWorld.Update(dTime: Single);
var
i,j: integer;
temp: TVector2f;
begin
for i:=0 to Count-1 do
begin
if Bodyes[i]^.Static then break else
for j:=0 to Bodyes[i]^.Count-1 do
begin
Bodyes[i]^.AccumulateForces[j]:=Gravitation;
temp:=Bodyes[i]^.Position[j];
Bodyes[i]^.Position[j].x:=Bodyes[i]^.Position[j].x+
(Bodyes[i]^.Position[j].x-Bodyes[i]^.OldPosition[j].x)+
Bodyes[i]^.AccumulateForces[j].x*dTime*dTime;
Bodyes[i]^.Position[j].y:=Bodyes[i]^.Position[j].y+
(Bodyes[i]^.Position[j].y-Bodyes[i]^.OldPosition[j].y)+
Bodyes[i]^.AccumulateForces[j].y*dTime*dTime;
Bodyes[i]^.OldPosition[j]:=temp;
end;
end;
end;
guest 20.07.2009 21:30 # −1