diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-09-11 00:48:13 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-09-11 01:05:40 -0700 |
commit | 85127285bff6983665275fe14d3c2b80b36a872a (patch) | |
tree | 0215b33ee3b1101b9300d790f15914fa4e2bfcdf /src/modules/sparkler/particles.h | |
parent | a9f489265c1ebbc67a3f675d1a79a2254345b489 (diff) |
module/sparkler: implement some BSP drawing settings
This commit adds a few settings for visualizing the octree BSP:
show_bsp_leafs (on/off):
Draw wireframe cubes around octree leaf nodes
show_bsp_leafs_min_depth (0,4,6,8,10):
Set minimum octree depth for leaf nodes displayed
show_bsp_matches (on/off):
Draw lines connecting BSP search matches
show_bsp_matches_affected_only (on/off):
Limit drawn BSP search matches to only matches actually
affected by the simulation
The code implementing this stuff is a bit crufty, fb_fragment_t
had to be pulled down to the sim ops for example and whether that
actually results in drawing occurring during the sim phase
depends on the config used and how the particle implementations
react to the config... it's just gross. This matters because the
caller used to know only the draw phase touched fb_fragment_t,
and because of that the fragment was zeroed after sim and before
draw in parallel. But now the caller needs to know if the config
would make sim do some drawing, and do the fragment zeroing
before sim instead, and skip the zero before draw to not lose
what sim drew. It's icky, but I'll leave it for now, at least
it's isolated to the sparkler.
Diffstat (limited to 'src/modules/sparkler/particles.h')
-rw-r--r-- | src/modules/sparkler/particles.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/sparkler/particles.h b/src/modules/sparkler/particles.h index b191b6e..9d6e3af 100644 --- a/src/modules/sparkler/particles.h +++ b/src/modules/sparkler/particles.h @@ -9,18 +9,22 @@ typedef struct particles_conf_t { unsigned show_bsp_leafs:1; unsigned show_bsp_matches:1; + unsigned show_bsp_matches_affected_only:1; + unsigned show_bsp_leafs_min_depth; } particles_conf_t; typedef struct particles_t particles_t; +typedef struct v3f_t v3f_t; particles_t * particles_new(const particles_conf_t *conf); void particles_draw(particles_t *particles, fb_fragment_t *fragment); -particle_status_t particles_sim(particles_t *particles); +particle_status_t particles_sim(particles_t *particles, fb_fragment_t *fragment); void particles_age(particles_t *particles); void particles_free(particles_t *particles); int particles_add_particle(particles_t *particles, particle_props_t *props, particle_ops_t *ops); void particles_spawn_particle(particles_t *particles, particle_t *parent, particle_props_t *props, particle_ops_t *ops); void particles_add_particles(particles_t *particles, particle_props_t *props, particle_ops_t *ops, int num); bsp_t * particles_bsp(particles_t *particles); +void particles_draw_line(particles_t *particles, const v3f_t *a, const v3f_t *b, fb_fragment_t *fragment); #endif |