All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

BUG-840: Viewer 3.4.2 (Beta) breaks almost every sliding door script in SL

Review Request #616 - Created Feb. 15, 2013 and updated

MartinRJ Fayray Reviewers
viewer-release viewer
BUG-840
None viewer-release
Fixes missing childprim- position/rotation-updates when the avatar was 20+m away and didn't have the object in view when it was changed.


Repository: https://bitbucket.org/MartinRJ/bug-840
Create an object with two prims, add a script with a listener on PUBLIC_CHANNEL and make it change the relative position of the child prim in the listen-event.

Move the avatar 20+ m away from the test object, and look in the opposite direction, so that the object is not in view.

Shout something in public chat so that the child prim changes its relative position.

Turn around so that the test object is in view again.

Expected result: the prims visibly changed.

Without this fix, the child prim would not update its position (or rotation).

This fix has to be tested against the following related bugs:
BUG-840 [positionbug], BUG-840: Viewer 3.4.2 (Beta) breaks almost every sliding door script in SL
MAINT-2275 [vehiclebug],  Child prims are "left behind" by animated, moving physical objects
MAINT-1742 [selection], Child object does not update position while selected.
MAINT-2247 [selection]  Child object does not update rotation while selected.

Diff revision 3 (Latest)

1 2 3
1 2 3

  1. indra/newview/lldrawable.cpp: Loading...
indra/newview/lldrawable.cpp
Revision fbbee98b7512 New Change
... 569 lines hidden [Expand]
F32 LLDrawable::updateXform(BOOL undamped)
570
			dist_squared > 0.f))
570
			dist_squared > 0.f))
571
	{ //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild
571
	{ //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild
572
		dist_squared = 1.f; //keep this object on the move list
572
		dist_squared = 1.f; //keep this object on the move list
573
		if (!isState(LLDrawable::ANIMATED_CHILD))
573
		if (!isState(LLDrawable::ANIMATED_CHILD))
574
		{			
574
		{			
575
			setState(LLDrawable::ANIMATED_CHILD);
575
			setState(LLDrawable::ANIMATED_CHILD);
576
			gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
576
			gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
577
			mVObjp->dirtySpatialGroup();
577
			mVObjp->dirtySpatialGroup();
578
		}
578
		}
579
	}
579
	}

   
580
	else if (!isRoot() &&

   
581
            (

   
582
            dist_vec_squared(old_pos, target_pos) > 0.f

   
583
            ||

   
584
            (1.f - dot(old_rot, target_rot)) > 0.f

   
585
            ))

   
586
	{ //fix for BUG-840, MAINT-2275, MAINT-1742, MAINT-2247

   
587
		gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);

   
588
	}
580
	else if (!getVOVolume() && !isAvatar())
589
	else if (!getVOVolume() && !isAvatar())
581
	{
590
	{
582
		movePartition();
591
		movePartition();
583
	}
592
	}
584

   
593

   
585
	// Update
594
	// Update
586
	mXform.setPosition(target_pos);
595
	mXform.setPosition(target_pos);
587
	mXform.setRotation(target_rot);
596
	mXform.setRotation(target_rot);
588
	mXform.setScale(LLVector3(1,1,1)); //no scale in drawable transforms (IT'S A RULE!)
597
	mXform.setScale(LLVector3(1,1,1)); //no scale in drawable transforms (IT'S A RULE!)
589
	mXform.updateMatrix();
598
	mXform.updateMatrix();
... 1037 lines hidden [Expand]
  1. indra/newview/lldrawable.cpp: Loading...