Browse Source

engine: fix brush model sound spatialization

pull/2/head
Alibek Omarov 4 years ago
parent
commit
c50f73b892
  1. 23
      engine/client/cl_frame.c

23
engine/client/cl_frame.c

@ -1381,10 +1381,16 @@ qboolean CL_GetEntitySpatialization( channel_t *ch )
if( !ent || !ent->model || ent->curstate.messagenum != cl.parsecount ) if( !ent || !ent->model || ent->curstate.messagenum != cl.parsecount )
return valid_origin; return valid_origin;
VectorCopy( ent->origin, ch->origin ); // setup origin
if( ent->model->type == mod_brush ) if( ent->model->type == mod_brush )
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin ); {
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
VectorAdd( ent->origin, ch->origin, ch->origin );
}
else
{
VectorCopy( ent->origin, ch->origin );
}
return true; return true;
} }
@ -1402,10 +1408,15 @@ qboolean CL_GetMovieSpatialization( rawchan_t *ch )
return valid_origin; return valid_origin;
// setup origin // setup origin
VectorCopy( ent->origin, ch->origin );
if( ent->model->type == mod_brush ) if( ent->model->type == mod_brush )
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin ); {
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
VectorAdd( ent->origin, ch->origin, ch->origin );
}
else
{
VectorCopy( ent->origin, ch->origin );
}
return true; return true;
} }

Loading…
Cancel
Save