Update object segment after object position interpolation. This is always done in DEBUG, but not in RELEASE, where further movement would break at segment check
This commit is contained in:
parent
6054bf7e90
commit
2043c19d60
|
@ -1,5 +1,9 @@
|
||||||
D1X-Rebirth Changelog
|
D1X-Rebirth Changelog
|
||||||
|
|
||||||
|
20081001
|
||||||
|
--------
|
||||||
|
main/physics.c: Update object segment after object position interpolation. This is always done in DEBUG, but not in RELEASE, where further movement would break at segment check
|
||||||
|
|
||||||
20080930
|
20080930
|
||||||
--------
|
--------
|
||||||
main/console.c, main/collide.c, main/mglobal.c, main/multi.c, main/inferno.c, main/physics.c, main/aipath.c, main/render.c, main/fuelcen.c, main/ai.c, main/game.c, main/game.h, SConstruct, d1x.ini, maths/vecmat.c, arch/sdl/timer.c, arch/sdl/mouse.c, arch/sdl/digi.c, arch/sdl/digi_audio.c, arch/include/mouse.h: Added new function to calculate common timesteps; Increased MAXIMUM_FPS to 200 for release and 1000 for debug; Used fixed sim_time for do_physics_sim and Interpolating to ensure collisions stay accurate at high FPS; New code and faster code for dot products by The_Lion; Disabled Nice-FPS and common Frame-Loop if VSync is active; More accurate delta timer for mouse (consider overhead); Added SDL_(Un)LockAudio for old SDL Audio interface; General support for up to 16 mouse buttons; Code cleanup; Made some AI movement and Player shaking FPS-independent
|
main/console.c, main/collide.c, main/mglobal.c, main/multi.c, main/inferno.c, main/physics.c, main/aipath.c, main/render.c, main/fuelcen.c, main/ai.c, main/game.c, main/game.h, SConstruct, d1x.ini, maths/vecmat.c, arch/sdl/timer.c, arch/sdl/mouse.c, arch/sdl/digi.c, arch/sdl/digi_audio.c, arch/include/mouse.h: Added new function to calculate common timesteps; Increased MAXIMUM_FPS to 200 for release and 1000 for debug; Used fixed sim_time for do_physics_sim and Interpolating to ensure collisions stay accurate at high FPS; New code and faster code for dot products by The_Lion; Disabled Nice-FPS and common Frame-Loop if VSync is active; More accurate delta timer for mouse (consider overhead); Added SDL_(Un)LockAudio for old SDL Audio interface; General support for up to 16 mouse buttons; Code cleanup; Made some AI movement and Player shaking FPS-independent
|
||||||
|
|
|
@ -688,6 +688,16 @@ void do_physics_sim(object *obj)
|
||||||
obj->pos.x = start_pos.x + ((obj->pos.x - start_pos.x) / ((float)PhysTime/FrameTime));
|
obj->pos.x = start_pos.x + ((obj->pos.x - start_pos.x) / ((float)PhysTime/FrameTime));
|
||||||
obj->pos.y = start_pos.y + ((obj->pos.y - start_pos.y) / ((float)PhysTime/FrameTime));
|
obj->pos.y = start_pos.y + ((obj->pos.y - start_pos.y) / ((float)PhysTime/FrameTime));
|
||||||
obj->pos.z = start_pos.z + ((obj->pos.z - start_pos.z) / ((float)PhysTime/FrameTime));
|
obj->pos.z = start_pos.z + ((obj->pos.z - start_pos.z) / ((float)PhysTime/FrameTime));
|
||||||
|
//check for and update correct object segment
|
||||||
|
if(!get_seg_masks(&obj->pos, obj->segnum, 0, __FILE__, __LINE__).centermask == 0)
|
||||||
|
{
|
||||||
|
if (!update_object_seg(obj)) {
|
||||||
|
if (!(Game_mode & GM_MULTI))
|
||||||
|
Int3();
|
||||||
|
compute_segment_center(&obj->pos,&Segments[obj->segnum]);
|
||||||
|
obj->pos.x += objnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// After collision with objects and walls, set velocity from actual movement
|
// After collision with objects and walls, set velocity from actual movement
|
||||||
|
|
Loading…
Reference in a new issue