Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/model/modelcollide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 3 additions & 7 deletions code/weapon/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3962,18 +3962,15 @@ 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();
}

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();
}
Expand Down Expand Up @@ -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();
}
Expand Down
Loading