diff --git a/code/model/modelcollide.cpp b/code/model/modelcollide.cpp index ad7dfed84f3..c6fe18afa20 100644 --- a/code/model/modelcollide.cpp +++ b/code/model/modelcollide.cpp @@ -323,6 +323,7 @@ static void mc_check_sphereline_face( int nv, vec3d ** verts, vec3d * plane_pnt, // This is closer than best so far Mc->hit_dist = sphere_time; Mc->hit_point = hit_point; + Mc->hit_normal = *plane_norm; Mc->hit_submodel = Mc_submodel; Mc->edge_hit = true; diff --git a/code/weapon/beam.cpp b/code/weapon/beam.cpp index f2e05b477cf..4a0a25e13f6 100644 --- a/code/weapon/beam.cpp +++ b/code/weapon/beam.cpp @@ -3962,9 +3962,7 @@ void beam_handle_collisions(beam *b) if (wi->flash_impact_weapon_expl_effect.isValid()) { auto particleSource = particle::ParticleManager::get()->createSource(wi->flash_impact_weapon_expl_effect); particleSource->setHost(beam_hit_make_effect_host(b, &Objects[target], b->f_collisions[idx].cinfo.hit_submodel, &b->f_collisions[idx].cinfo.hit_point_world, &b->f_collisions[idx].cinfo.hit_point)); -// TODO: Commenting out until the collision code can be enhanced to return a valid normal when a beam collides with an edge. -// (This can happen when a slash beam moves off the edge of a model; edge_hit will be true and hit_normal will be 0,0,0.) -// particleSource->setNormal(worldNormal); + particleSource->setNormal(worldNormal); particleSource->setTriggerRadius(width); particleSource->finishCreation(); } @@ -3972,8 +3970,7 @@ void beam_handle_collisions(beam *b) if(do_expl){ auto particleSource = particle::ParticleManager::get()->createSource(wi->impact_weapon_expl_effect); particleSource->setHost(beam_hit_make_effect_host(b, &Objects[target], b->f_collisions[idx].cinfo.hit_submodel, &b->f_collisions[idx].cinfo.hit_point_world, &b->f_collisions[idx].cinfo.hit_point)); -// TODO: see comment above -// particleSource->setNormal(worldNormal); + particleSource->setNormal(worldNormal); particleSource->setTriggerRadius(width); particleSource->finishCreation(); } @@ -4029,8 +4026,7 @@ void beam_handle_collisions(beam *b) auto particleSource = particle::ParticleManager::get()->createSource(wi->piercing_impact_effect); particleSource->setHost(beam_hit_make_effect_host(b, &Objects[target], b->f_collisions[idx].cinfo.hit_submodel, &b->f_collisions[idx].cinfo.hit_point_world, &b->f_collisions[idx].cinfo.hit_point)); -// TODO: see comment above -// particleSource->setNormal(worldNormal); + particleSource->setNormal(worldNormal); particleSource->setTriggerRadius(width); particleSource->finishCreation(); }