Follow-up Comment #2, bug #15034 (project wormux):
The bug occurred again for me. This time it was a medkit falling down and the
wind was blowing strongly to the right.
The following happens in a loop:
------------------------------------------
1.) MainLoop call:
PhysicalObj::UpdatePosition of the medkit gets called:
GetPosition() = {x = 2602, y = 1300}
IsMoving() == false
FootsInVacuum() == true -> It gets checked that there is no pixel in the
green area of the attached image.
StartMoving() gets called
RunPhysicalEngine gets called:
m_last_move is 20 ms larger then m_last_physical_engine_run
m_last_physical_engine_run gets set to m_last_move;
delta_t is 0 and the loop gets skipped.
2.) MainLoop call:
PhysicalObj::UpdatePosition of the medkit gets called:
PhysicalObj::UpdatePosition
GetPosition() = {x = 2602, y = 1300}
IsMoving() == true
FootsInVacuum() == true
RunPhysicalEngine gets called:
m_last_physical_engine_run and m_last_move have the same value
delta_t = 0.02;
first and only iteration:
oldPos = {x = 65.06247822318764, y = 32.4962054927636}
newPos = {x = 65.062699223187636, y = 32.510605492763602}
at NotifyMove call is the position already {x = 2603, y = 1300} !
after the multiplication with PIXEL_PER_METER:
oldPos = {x = 2602.4991289275058, y = 1299.8482197105441}
newPos = {x = 2602.5079689275053, y = 1300.4242197105441}
lg = 0.57606783072830625
offset = {x = 0.015345415119488372, y = 0.99988225218513127}
tmpPos = {x = 2603, y = 1301} -> one pixel down and right!
IsInVacuumXY(tmpPos, false) returns false. See red area in the attached
image.
collision = COLLISION_ON_GROUND;
SetXY(2602.4991289275058, 1299.8482197105441);
GetPosition() returns {x = 2602, y = 1300}
speed_before_collision = {x = 0.011050000000000001, y = 0.71999999999999997}
------------------------------------------
Finally I ran the following gdb command
print SetXY(pos)
right after the execution of "SetXY(Point2d(pos.x - offset.x, pos.y -
offset.y));".
This broke the loop and the game continued until it's end.
(file #7677)
_______________________________________________________
Additional Item Attachment:
File name: box_bug.png Size:0 KB
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?15034>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wormux-gna mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-gna