Skip to content

Commit 48b7059

Browse files
committed
the naive method
1 parent 106afbe commit 48b7059

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

code/object/objectsort.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "tracing/tracing.h"
3030
#include "weapon/weapon.h"
3131
#include "decals/decals.h"
32+
#include "freespace.h"
33+
#include "utils/modular_curves.h"
3234

3335
class sorted_obj
3436
{
@@ -142,6 +144,20 @@ int obj_in_view_cone( object * objp )
142144
// Center isn't in... are other points?
143145
ubyte and_codes = 0xff;
144146

147+
float obj_size;
148+
149+
if (objp->type == OBJ_WEAPON && Weapon_info[Weapons[objp->instance].weapon_info_index].render_type == WRT_LASER) {
150+
auto wp = &Weapons[objp->instance];
151+
auto wip = &Weapon_info[wp->weapon_info_index];
152+
float length_scalar = wip->weapon_curves.get_output(weapon_info::WeaponCurveOutputs::LASER_LENGTH_MULT, *wp, wp->modular_curves_instance);
153+
if (wip->laser_length_by_frametime) {
154+
length_scalar *= flFrametime;
155+
}
156+
obj_size = wip->laser_length *
157+
} else {
158+
obj_size = objp->radius;
159+
}
160+
145161
for (i=0; i<8; i++ ) {
146162
vm_vec_scale_add( &pt, &objp->pos, &check_offsets[i], objp->radius );
147163
codes=g3_rotate_vector(&tmp,&pt);

0 commit comments

Comments
 (0)