View Issue Details

IDProjectCategoryView StatusLast Update
0003152FSSCPgraphicspublic2015-03-27 19:03
ReporterDahBlount Assigned Toz64555  
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Summary0003152: Trails render at end of laser bitmap
DescriptionTrails appear to render at the rear edge of all laser bitmaps.
Steps To ReproducePut trails on a laser and view them in a mission.
TagsNo tags attached.

Activities

z64555

2015-03-26 23:29

developer  

m3152-git.patch (1,035 bytes)   
 code/weapon/weapons.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/code/weapon/weapons.cpp b/code/weapon/weapons.cpp
index e91eda5..f431b5e 100644
--- a/code/weapon/weapons.cpp
+++ b/code/weapon/weapons.cpp
@@ -4672,13 +4672,22 @@ void weapon_process_post(object * obj, float frame_time)
 	// trail missiles
 	if ((wip->wi_flags & WIF_TRAIL) && !(wip->wi_flags & WIF_CORKSCREW)) {
 		if ( (wp->trail_ptr != NULL ) && (wp->lssm_stage!=3))	{
+			vec3d pos;
+			
+			if (wip->render_type == WRT_LASER) {
+				// place tail origin in center of the bolt
+				vm_vec_scale_add(&pos, &obj->pos, &obj->orient.vec.fvec, (wip->laser_length / 2));
+			} else {
+				pos = obj->pos;
+			}
+
 			if (trail_stamp_elapsed(wp->trail_ptr)) {
 
-				trail_add_segment( wp->trail_ptr, &obj->pos );
+				trail_add_segment( wp->trail_ptr, &pos );
 				
 				trail_set_stamp(wp->trail_ptr);
 			} else {
-				trail_set_segment( wp->trail_ptr, &obj->pos );
+				trail_set_segment( wp->trail_ptr, &pos );
 			}
 
 		}
m3152-git.patch (1,035 bytes)   

z64555

2015-03-26 23:30

developer   ~0016576

Attached a patch that moves the $Trail origin to the mathematical center of the laser bolt when the weapon's render type is a laser.

z64555

2015-03-27 19:03

developer   ~0016580

Fix committed to trunk@11290.

Related Changesets

fs2open: trunk r11290

2015-03-27 15:23

z64555


Ported: N/A

Details Diff
Fix for Mantis 3152: Moves the trail origin to the mathematical center of a laser bolt, if the weapon's render type is a laser. Affected Issues
0003152
mod - /trunk/fs2_open/code/weapon/weapons.cpp Diff File

Issue History

Date Modified Username Field Change
2015-03-26 20:38 DahBlount New Issue
2015-03-26 23:29 z64555 File Added: m3152-git.patch
2015-03-26 23:30 z64555 Note Added: 0016576
2015-03-26 23:30 z64555 Assigned To => z64555
2015-03-26 23:30 z64555 Status new => code review
2015-03-27 19:03 z64555 Changeset attached => fs2open trunk r11290
2015-03-27 19:03 z64555 Note Added: 0016580
2015-03-27 19:03 z64555 Status code review => resolved
2015-03-27 19:03 z64555 Resolution open => fixed