When sliding along a wall keep wall_part sane to ensure good velocity for slide
This commit is contained in:
parent
eb7e001c2f
commit
112a9d7d58
|
@ -3,6 +3,7 @@ D2X-Rebirth Changelog
|
|||
20110407
|
||||
--------
|
||||
3d/draw.c, 3d/interp.c, 3d/rod.c, arch/ogl/ogl.c, include/3d.h, include/interp.h, include/ogl_init.h, main/endlevel.c, main/gamesave.c, main/lighting.c, main/lighting.h, main/menu.c, main/morph.c, main/multi.c, main/object.c, main/object.h, main/playsave.c, main/playsave.h, main/polyobj.c, main/polyobj.h, main/render.c, main/state.c, main/terrain.c: Made lighting code work with actual RGB values and added feature to let certain objects emit colored dynamic light as well as let mine flash red when control center destroyed (OpenGL-only at the moment)
|
||||
main/physics.c: When sliding along a wall keep wall_part sane to ensure good velocity for slide
|
||||
|
||||
20110405
|
||||
--------
|
||||
|
|
|
@ -609,6 +609,10 @@ void do_physics_sim(object *obj)
|
|||
|
||||
wall_part = vm_vec_dot(&hit_info.hit_wallnorm,&obj->mtype.phys_info.velocity);
|
||||
|
||||
// if wall_part, make sure the value is sane enough to get usable velocity computed
|
||||
if (wall_part < 0 && wall_part > -f1_0) wall_part = -f1_0;
|
||||
if (wall_part > 0 && wall_part < f1_0) wall_part = f1_0;
|
||||
|
||||
if (forcefield_bounce || (obj->mtype.phys_info.flags & PF_BOUNCE)) { //bounce off wall
|
||||
wall_part *= 2; //Subtract out wall part twice to achieve bounce
|
||||
|
||||
|
|
Loading…
Reference in a new issue