Anonymous avatar Anonymous committed d954690

SOCIAL-695 FIX Selecting UI and then clicking on world to give focus back to viewer moves you to that location
made this work when clicking on SL with another app in foreground
visual feedback of ClickToWalk behavior

Comments (0)

Files changed (5)

indra/newview/llhudeffectblob.cpp

 
 #include "llhudeffectblob.h"
 
-LLHUDEffectBlob::LLHUDEffectBlob(const U8 type) : LLHUDEffect(type)
+#include "llagent.h"
+#include "llviewercamera.h"
+#include "llrendersphere.h"
+
+LLHUDEffectBlob::LLHUDEffectBlob(const U8 type) 
+:	LLHUDEffect(type), 
+	mPixelSize(10)
 {
+	mTimer.start();
 }
 
 LLHUDEffectBlob::~LLHUDEffectBlob()
 
 void LLHUDEffectBlob::render()
 {
+	F32 time = mTimer.getElapsedTimeF32();
+	if (mDuration < time)
+	{
+		markDead();
+	}
+
+	LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(mPositionGlobal);
+
+	LLVector3 pixel_up, pixel_right;
+
+	LLViewerCamera::instance().getPixelVectors(pos_agent, pixel_up, pixel_right);
+
+	LLGLSPipelineAlpha gls_pipeline_alpha;
+	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+	LLColor4U color = mColor;
+	color.mV[VALPHA] = clamp_rescale(time, 0.f, mDuration, 255.f, 0.f);
+	glColor4ubv(color.mV);
+
+	glPushMatrix();
+	glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
+	F32 scale = pixel_up.magVec() * (F32)mPixelSize;
+	glScalef(scale, scale, scale);
+	gSphere.render(0);
+	glPopMatrix();
 }
 
 void LLHUDEffectBlob::renderForTimer()

indra/newview/llhudeffectblob.h

 public:
 	friend class LLHUDObject;
 
+	void setPixelSize(S32 pixels) { mPixelSize = pixels; }
+
 protected:
 	LLHUDEffectBlob(const U8 type);
 	~LLHUDEffectBlob();
 	/*virtual*/ void render();
 	/*virtual*/ void renderForTimer();
 private:
-
+	S32				mPixelSize;
+	LLFrameTimer	mTimer;
 };
 
 #endif // LL_LLHUDEFFECTBLOB_H

indra/newview/llhudobject.cpp

 		break;
 	case LL_HUD_EFFECT_BLOB:
 		hud_objectp = new LLHUDEffectBlob(type);
+		break;
 	default:
 		llwarns << "Unknown type of hud effect:" << (U32) type << llendl;
 	}

indra/newview/lltoolpie.cpp

 	mPick.mKeyMask = mask;
 
 	mMouseButtonDown = true;
-	mAbortClickToWalk = false;
 	
 	handleLeftClickPick();
 
 			mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
 		}
 		gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
+		if(mAutoPilotDestination) { mAutoPilotDestination->markDead(); }
 		mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE);
 		mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal);
-		mAutoPilotDestination->setColor(LLColor4U::white);
-		mAutoPilotDestination->setDuration(5.f);
+		mAutoPilotDestination->setPixelSize(5);
+		mAutoPilotDestination->setColor(LLColor4U(50, 50, 200));
+		mAutoPilotDestination->setDuration(3.f);
 
 		handle_go_to();
+		mAbortClickToWalk = false;
+
 		return TRUE;
 	}
 	gViewerWindow->setCursor(UI_CURSOR_ARROW);
 
 	LLToolMgr::getInstance()->clearTransientTool();
 	gAgentCamera.setLookAt(LOOKAT_TARGET_CONVERSATION, obj); // maybe look at object/person clicked on
+
+	mAbortClickToWalk = false;
 	return LLTool::handleMouseUp(x, y, mask);
 }
 
 	}
 }
 
+void LLToolPie::handleSelect()
+{
+	mAbortClickToWalk = true;	
+}
 
 void LLToolPie::handleDeselect()
 {
 void LLToolPie::stopCameraSteering()
 {
 	mMouseOutsideSlop = false;
-	mMouseSteerGrabPoint = NULL;
 }
 
 bool LLToolPie::inCameraSteerMode()
 		const LLVector3 rotation_center_to_pick		= gAgent.getPosAgentFromGlobal(mSteerPick.mPosGlobal) - gAgent.getFrameAgent().getOrigin();
 
 		mClockwise = camera_to_rotation_center * rotation_center_to_pick < 0.f;
-		mMouseSteerGrabPoint= (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE);
-		mMouseSteerGrabPoint->setPositionGlobal(mPick.mPosGlobal);
-		mMouseSteerGrabPoint->setColor(LLColor4U::white);
-		mMouseSteerGrabPoint->setDuration(1000.f);
+		if (mMouseSteerGrabPoint) { mMouseSteerGrabPoint->markDead(); }
+		mMouseSteerGrabPoint = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE);
+		mMouseSteerGrabPoint->setPositionGlobal(mSteerPick.mPosGlobal);
+		mMouseSteerGrabPoint->setColor(LLColor4U(50, 50, 200));
+		mMouseSteerGrabPoint->setPixelSize(5);
+		mMouseSteerGrabPoint->setDuration(2.f);
 	}
 }
 

indra/newview/lltoolpie.h

 	virtual void		stopEditing();
 
 	virtual void		onMouseCaptureLost();
+	virtual void		handleSelect();
 	virtual void		handleDeselect();
 	virtual LLTool*		getOverrideTool(MASK mask);
 
 	S32					mMouseDownY;
 	S32					mMouseSteerX;
 	S32					mMouseSteerY;
-	LLHUDEffectBlob*	mAutoPilotDestination;
-	LLHUDEffectBlob*	mMouseSteerGrabPoint;
+	LLPointer<LLHUDEffectBlob>	mAutoPilotDestination;
+	LLPointer<LLHUDEffectBlob>	mMouseSteerGrabPoint;
 	bool				mClockwise;			
 	bool				mAbortClickToWalk;
 	LLUUID				mMediaMouseCaptureID;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.