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-1709: Tiny prims do not rescale properly at very high viewer framerates

Review Request #617 - Created Feb. 17, 2013 and updated

MartinRJ Fayray Reviewers
viewer
BUG-1709
None viewer-release
At high framerates tiny prims get stuck upon interpolation when they are resized via script.
I fixed that by comparing the original scale versus the new target scale (instead of comparing the original scale versus the new interpolated target scale),
in lldrawable.cpp "updateXform" to decide whether a scale change requires an immediate rebuild or not.
See test plan in Jira: https://jira.secondlife.com/browse/BUG-1709

Repository: https://bitbucket.org/MartinRJ/bug-1709

Diff revision 1 (Latest)

  1. indra/newview/lldrawable.cpp: Loading...
indra/newview/lldrawable.cpp
Revision fbbee98b7512 New Change
... 550 lines hidden [Expand]
F32 LLDrawable::updateXform(BOOL undamped)
551
	else
551
	else
552
	{
552
	{
553
		// The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275
553
		// The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275
554
		// dist_squared = dist_vec_squared(old_pos, target_pos);
554
		// dist_squared = dist_vec_squared(old_pos, target_pos);
555

   
555

   
556
		// The following fixes MAINT-2247 but causes MAINT-2275
556
		// The following fixes MAINT-2247 but causes MAINT-2275
557
		//dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f;
557
		//dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f;
558
		//dist_squared += dist_vec_squared(old_scale, target_scale);
558
		//dist_squared += dist_vec_squared(old_scale, target_scale);
559
	}
559
	}
560

   
560

   
561
	LLVector3 vec = mCurrentScale-target_scale;
561
	LLVector3 vec = mCurrentScale-dest_scale;
562
	
562
	
563
	if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED)
563
	if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED)
564
	{ //scale change requires immediate rebuild
564
	{ //scale change requires immediate rebuild
565
		mCurrentScale = target_scale;
565
		mCurrentScale = dest_scale;
566
		gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
566
		gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
567
	}
567
	}
568
	else if (!isRoot() && 
568
	else if (!isRoot() && 
569
		 (!mVObjp->getAngularVelocity().isExactlyZero() ||
569
		 (!mVObjp->getAngularVelocity().isExactlyZero() ||
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);
... 1051 lines hidden [Expand]
  1. indra/newview/lldrawable.cpp: Loading...