For casting light from Player-object, smooth out thrust to prevent flickering on high FPS
This commit is contained in:
parent
d45e67c242
commit
ee6324b3e4
|
@ -1,5 +1,9 @@
|
|||
D1X-Rebirth Changelog
|
||||
|
||||
20100328
|
||||
--------
|
||||
main/lighting.c: For casting light from Player-object, smooth out thrust to prevent flickering on high FPS
|
||||
|
||||
20100327
|
||||
--------
|
||||
main/kmatrix.c, main/net_udp.c: Initialise 'playing' to 0 for UDP kmatrix, making sure player progresses to next level; always return 1 when starting to join a UDP game so it doesn't immediately return to the main menu
|
||||
|
|
|
@ -252,8 +252,14 @@ fix compute_light_intensity(int objnum)
|
|||
|
||||
switch (objtype) {
|
||||
case OBJ_PLAYER:
|
||||
return max(vm_vec_mag_quick(&obj->mtype.phys_info.thrust)/4, F1_0*2) + F1_0/2;
|
||||
{
|
||||
vms_vector sthrust = obj->mtype.phys_info.thrust;
|
||||
fix k = fixmuldiv(obj->mtype.phys_info.mass,obj->mtype.phys_info.drag,(f1_0-obj->mtype.phys_info.drag));
|
||||
// smooth thrust value like set_thrust_from_velocity()
|
||||
vm_vec_copy_scale(&sthrust,&obj->mtype.phys_info.velocity,k);
|
||||
return max(vm_vec_mag_quick(&sthrust)/4, F1_0*2) + F1_0/2;
|
||||
break;
|
||||
}
|
||||
case OBJ_FIREBALL:
|
||||
if (obj->id != 0xff) {
|
||||
if (obj->lifeleft < F1_0*4)
|
||||
|
|
Loading…
Reference in a new issue