コード例 #1
0
void QToolAlign::render()
{
	mBBox = get_selection_axis_aligned_bbox();

	// Draw bounding box
	LLGLSUIDefault gls_ui;
	LLGLEnable gl_blend(GL_BLEND);
	LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
	LLGLDepthTest gls_depth(GL_FALSE);
	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);

	// render box
	LLColor4 default_normal_color( 0.7f, 0.7f, 0.7f, 0.1f );
	gGL.color4fv( default_normal_color.mV );

	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getEditSelection();
 	BOOL can_move = selection->getObjectCount() != 0;
	if (can_move)
 	{
		struct f : public LLSelectedObjectFunctor
 		{
 			virtual bool apply(LLViewerObject* objectp)
 			{
 				return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
			}
		} func;
		can_move = selection->applyToObjects(&func);
	}
	if (can_move)
	{
		render_bbox(mBBox);
		renderManipulators();
	}
}
コード例 #2
0
ファイル: llhudeffectlookat.cpp プロジェクト: Kiera/Crow
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------
void LLHUDEffectLookAt::render()
{
	static const LLCachedControl<bool> private_look_at("PrivateLookAt",false);
    if (private_look_at &&
        (gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) return;
	if (sDebugLookAt && mSourceObject.notNull())
	{
		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);

		LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition();
		glMatrixMode(GL_MODELVIEW);
		gGL.pushMatrix();
		gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]);
		glScalef(0.3f, 0.3f, 0.3f);
		gGL.begin(LLRender::LINES);
		{
			LLColor3 color = (*mAttentions)[mTargetType].mColor;
			gGL.color3f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE]);
			gGL.vertex3f(-1.f, 0.f, 0.f);
			gGL.vertex3f(1.f, 0.f, 0.f);

			gGL.vertex3f(0.f, -1.f, 0.f);
			gGL.vertex3f(0.f, 1.f, 0.f);

			gGL.vertex3f(0.f, 0.f, -1.f);
			gGL.vertex3f(0.f, 0.f, 1.f);
		} gGL.end();
		gGL.popMatrix();
		// <edit>
		const std::string text = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->getFullname();
		LLVector3 offset = gAgent.getCameraPositionAgent() - target;
		offset.normalize();
		LLVector3 shadow_offset = offset * 0.49f;
		offset *= 0.5f;
		const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF);
		LLGLEnable gl_blend(GL_BLEND);
		glPushMatrix();
		gViewerWindow->setupViewport();
		hud_render_utf8text(text,
			target + shadow_offset,
			*font,
			LLFontGL::NORMAL,
			-0.5f * font->getWidthF32(text) + 2.0f,
			-2.0f,
			LLColor4::black,
			FALSE);
		hud_render_utf8text(text,
			target + offset,
			*font,
			LLFontGL::NORMAL,
			-0.5f * font->getWidthF32(text),
			0.0f,
			(*mAttentions)[mTargetType].mColor,
			FALSE);
		glPopMatrix();
		// </edit>
	}
}
コード例 #3
0
void QToolAlign::render()
{
	mBBox = get_selection_axis_aligned_bbox();

	// Draw bounding box
	LLGLSUIDefault gls_ui;
	LLGLEnable gl_blend(GL_BLEND);
	LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
	LLGLDepthTest gls_depth(GL_FALSE);
	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);

	// render box
	LLColor4 default_normal_color( 0.7f, 0.7f, 0.7f, 0.1f );
	gGL.color4fv( default_normal_color.mV );

	render_bbox(mBBox);
	renderManipulators();
}