diff options
| -rwxr-xr-x | indra/newview/llagentpilot.cpp | 6 | ||||
| -rwxr-xr-x | indra/newview/llappviewer.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llselectmgr.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llvoavatar.cpp | 10 | ||||
| -rwxr-xr-x | indra/newview/pipeline.cpp | 28 | 
5 files changed, 38 insertions, 33 deletions
diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index f96db0a5df..734c502fcf 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -35,7 +35,6 @@  #include "llappviewer.h"  #include "llviewercontrol.h"  #include "llviewercamera.h" -#include "llviewerjoystick.h"  #include "llsdserialize.h"  #include "llsdutil_math.h" @@ -259,11 +258,6 @@ void LLAgentPilot::startPlayback()  		if (mActions.count())  		{  			llinfos << "Starting playback, moving to waypoint 0" << llendl; -			if (getOverrideCamera() && -				!LLViewerJoystick::getInstance()->getOverrideCamera())	 -			{ -				LLViewerJoystick::getInstance()->toggleFlycam(); -			}  			gAgent.startAutoPilotGlobal(mActions[0].mTarget);  			moveCamera();  			mStarted = FALSE; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0118d2dfc1..add0e72ce2 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4220,16 +4220,13 @@ void LLAppViewer::idle()  		LLWorld::getInstance()->updateParticles();  	} -	if (LLViewerJoystick::getInstance()->getOverrideCamera()) +	if (gAgentPilot.isPlaying() && gAgentPilot.getOverrideCamera()) +	{ +		gAgentPilot.moveCamera(); +	} +	else if (LLViewerJoystick::getInstance()->getOverrideCamera())  	{  -		if (gAgentPilot.isPlaying() && gAgentPilot.getOverrideCamera()) -		{ -			gAgentPilot.moveCamera(); -		} -		else -		{ -			LLViewerJoystick::getInstance()->moveFlycam(); -		} +		LLViewerJoystick::getInstance()->moveFlycam();  	}  	else  	{ diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 746ba274ed..93c9131424 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5492,7 +5492,12 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)  	BOOL is_hud_object = objectp->isHUDAttachment(); -	if (!is_hud_object) +	if (drawable->isActive()) +	{ +		glLoadMatrixd(gGLModelView); +		glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); +	} +	else if (!is_hud_object)  	{  		glLoadIdentity();  		glMultMatrixd(gGLModelView); @@ -5500,11 +5505,6 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)  		glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]);		  	} -	if (drawable->isActive()) -	{ -		glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); -	} -  	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);  	if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a257703b24..0771e72bdc 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3335,13 +3335,21 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  	if (visible && !isSelf() && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter)  	{ +		const LLVector4a* ext = mDrawable->getSpatialExtents(); +		LLVector4a size; +		size.setSub(ext[1],ext[0]); +		F32 mag = size.getLength3().getF32()*0.5f; +  		F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f);  		if (LLMuteList::getInstance()->isMuted(getID()))  		{ // muted avatars update at 16 hz  			mUpdatePeriod = 16;  		} -		else if (mVisibilityRank <= LLVOAvatar::sMaxVisible) +		else if (mVisibilityRank <= LLVOAvatar::sMaxVisible || +			mDrawable->mDistanceWRTCamera < 1.f + mag)  		{ //first 25% of max visible avatars are not impostored +			//also, don't impostor avatars whose bounding box may be penetrating the  +			//impostor camera near clip plane  			mUpdatePeriod = 1;  		}  		else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 4) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 69173d26f4..b0aa50bc57 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -9352,10 +9352,10 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)  	glMatrixMode(GL_PROJECTION);  	glPushMatrix(); -	//glh::matrix4f ortho = gl_ortho(-tdim.mV[0], tdim.mV[0], -tdim.mV[1], tdim.mV[1], 1.0, 256.0); +	  	F32 distance = (pos-camera.getOrigin()).length();  	F32 fov = atanf(tdim.mV[1]/distance)*2.f*RAD_TO_DEG; -	F32 aspect = tdim.mV[0]/tdim.mV[1]; //128.f/256.f; +	F32 aspect = tdim.mV[0]/tdim.mV[1];  	glh::matrix4f persp = gl_perspective(fov, aspect, 1.f, 256.f);  	glh_set_current_projection(persp);  	glLoadMatrixf(persp.m); @@ -9374,7 +9374,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)  	gGL.setColorMask(true, true);  	glStencilMask(0xFFFFFFFF);  	glClearStencil(0); - +	  	// get the number of pixels per angle  	F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * viewer_camera->getView()); @@ -9424,9 +9424,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)  	glStencilFunc(GL_EQUAL, 1, 0xFFFFFF);  	{ //create alpha mask based on stencil buffer (grey out if muted) -		LLVector3 left = camera.getLeftAxis()*tdim.mV[0]*2.f; -		LLVector3 up = camera.getUpAxis()*tdim.mV[1]*2.f; -  		if (LLPipeline::sRenderDeferred)  		{  			GLuint buff = GL_COLOR_ATTACHMENT0_EXT; @@ -9449,16 +9446,25 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)  		LLGLDepthTest depth(GL_FALSE, GL_FALSE); -		gGL.color4f(1,1,1,1); +		gGL.flush(); + +		glPushMatrix(); +		glLoadIdentity(); +		glMatrixMode(GL_PROJECTION); +		glLoadIdentity(); +  		gGL.color4ub(64,64,64,255);  		gGL.begin(LLRender::QUADS); -		gGL.vertex3fv((pos+left-up).mV); -		gGL.vertex3fv((pos-left-up).mV); -		gGL.vertex3fv((pos-left+up).mV); -		gGL.vertex3fv((pos+left+up).mV); +		gGL.vertex2f(-1, -1); +		gGL.vertex2f(1, -1); +		gGL.vertex2f(1, 1); +		gGL.vertex2f(-1, 1);  		gGL.end();  		gGL.flush(); +		glPopMatrix(); +		glMatrixMode(GL_MODELVIEW); +		glPopMatrix();  		gGL.setSceneBlendType(LLRender::BT_ALPHA);  	}  | 
