• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LLVector3d函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LLVector3d函数的典型用法代码示例。如果您正苦于以下问题:C++ LLVector3d函数的具体用法?C++ LLVector3d怎么用?C++ LLVector3d使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LLVector3d函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: postcard_upload_callback

static void postcard_upload_callback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status)
{
	LLSD* postcard_data = (LLSD*)user_data;

	if (result)
	{
		// TODO: display the error messages in UI
		llwarns << "Failed to send postcard: " << LLAssetStorage::getErrorString(result) << llendl;
		LLPostCard::reportPostResult(false);
	}
	else
	{
		// only create the postcard once the upload succeeds

		// request the postcard
		const LLSD& data = *postcard_data;
		LLMessageSystem* msg = gMessageSystem;
		msg->newMessage("SendPostcard");
		msg->nextBlock("AgentData");
		msg->addUUID("AgentID",			gAgent.getID());
		msg->addUUID("SessionID",		gAgent.getSessionID());
		msg->addUUID("AssetID",			data["asset-id"].asUUID());
		msg->addVector3d("PosGlobal",	LLVector3d(data["pos-global"]));
		msg->addString("To",			data["to"]);
		msg->addString("From",			data["from"]);
		msg->addString("Name",			data["name"]);
		msg->addString("Subject",		data["subject"]);
		msg->addString("Msg",			data["msg"]);
		msg->addBOOL("AllowPublish",	FALSE);
		msg->addBOOL("MaturePublish",	FALSE);
		gAgent.sendReliableMessage();

		LLPostCard::reportPostResult(true);
	}

	delete postcard_data;
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:37,代码来源:llpostcard.cpp


示例2: createSTexture

void LLSurface::initTextures()
{
	///////////////////////
	//
	// Main surface texture
	//
	createSTexture();

	///////////////////////
	//
	// Water texture
	//
	if (gSavedSettings.getBOOL("RenderWater") )
	{
		createWaterTexture();
		mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
		gPipeline.createObject(mWaterObjp);
		LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
		//water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);
		//added line below var sams
		water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT);
		mWaterObjp->setPositionGlobal(water_pos_global);
	}
}
开发者ID:Lirusaito,项目名称:Voodoo-2,代码行数:24,代码来源:llsurface.cpp


示例3: ll_frand

void LLHUDEffectBeam::setupParticle(const S32 i)
{
	LLVector3d start_pos_global;
	if (mSourceObject->getPCode() == LL_PCODE_LEGACY_AVATAR)
	{
		LLViewerObject *objp = mSourceObject;
		LLVOAvatar *avatarp = (LLVOAvatar *)objp;
		start_pos_global = gAgent.getPosGlobalFromAgent(avatarp->mWristLeftp->getWorldPosition());
	}
	else
	{
		start_pos_global = mSourceObject->getPositionGlobal();
	}

	// Generate a random offset for the target point.
	const F32 SCALE = 0.5f;
	F32 x, y, z;
	x = ll_frand(SCALE) - 0.5f*SCALE;
	y = ll_frand(SCALE) - 0.5f*SCALE;
	z = ll_frand(SCALE) - 0.5f*SCALE;

	LLVector3d target_pos_global(mTargetPos);
	target_pos_global += LLVector3d(x, y, z);

	mInterp[i].setStartTime(mInterp[i].getEndTime());
	mInterp[i].setEndTime(mInterp[i].getStartTime() + BEAM_SPACING*NUM_POINTS);
	mInterp[i].setStartVal(start_pos_global);
	mInterp[i].setEndVal(target_pos_global);
	mInterp[i].start();


	// Setup the interpolator that fades out the alpha.
	mInterpFade[i].setStartTime(mInterp[i].getStartTime() + BEAM_SPACING*NUM_POINTS - 0.5f*NUM_POINTS*BEAM_SPACING);
	mInterpFade[i].setEndTime(mInterp[i].getStartTime() + BEAM_SPACING*NUM_POINTS - 0.05f);
	mInterpFade[i].start();
}
开发者ID:Krazy-Bish-Margie,项目名称:sl-viewer-source-archive,代码行数:36,代码来源:llhudeffectbeam.cpp


示例4: stripProtocol

/*static*/
void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)
{
	std::string sim_string = stripProtocol(url);
	std::string region_name;
	S32 x = 128;
	S32 y = 128;
	S32 z = 0;
	LLURLSimString::parse(sim_string, &region_name, &x, &y, &z);

	LLVector3 local_pos;
	local_pos.mV[VX] = (F32)x;
	local_pos.mV[VY] = (F32)y;
	local_pos.mV[VZ] = (F32)z;

	
	// determine whether the point is in this region
	if ((x >= 0) && (x < REGION_WIDTH_UNITS) &&
		(y >= 0) && (y < REGION_WIDTH_UNITS))
	{
		// if so, we're done
		regionHandleCallback(region_handle, url, snapshot_id, teleport);
	}

	else
	{
		// otherwise find the new region from the location
		
		// add the position to get the new region
		LLVector3d global_pos = from_region_handle(region_handle) + LLVector3d(local_pos);

		U64 new_region_handle = to_region_handle(global_pos);
		LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle,
										   LLURLDispatcherImpl::regionHandleCallback,
										   url, teleport);
	}
}
开发者ID:PhoenixDesmoulins,项目名称:imprudence,代码行数:37,代码来源:llurldispatcher.cpp


示例5: if


//.........这里部分代码省略.........

	gViewerWindow->moveCursorToCenter();

	// Potentially recenter if click outside rectangle
	LLViewerObject* hit_obj = pick_info.getObject();

	// Check for hit the sky, or some other invalid point
	if (!hit_obj && pick_info.mPosGlobal.isExactlyZero())
	{
		LLToolCamera::getInstance()->mValidClickPoint = FALSE;
		return;
	}

	// check for hud attachments
	if (hit_obj && hit_obj->isHUDAttachment())
	{
		LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
		if (!selection->getObjectCount() || selection->getSelectType() != SELECT_TYPE_HUD)
		{
			LLToolCamera::getInstance()->mValidClickPoint = FALSE;
			return;
		}
	}

	if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
	{
		BOOL good_customize_avatar_hit = FALSE;
		if( hit_obj )
		{
			LLVOAvatar* avatar = gAgent.getAvatarObject();
			if( hit_obj == avatar) 
			{
				// It's you
				good_customize_avatar_hit = TRUE;
			}
			else
			if( hit_obj->isAttachment() && hit_obj->permYouOwner() )
			{
				// It's an attachment that you're wearing
				good_customize_avatar_hit = TRUE;
			}
		}

		if( !good_customize_avatar_hit )
		{
			LLToolCamera::getInstance()->mValidClickPoint = FALSE;
			return;
		}

		if( gMorphView )
		{
			gMorphView->setCameraDrivenByKeys( FALSE );
		}
	}
	//RN: check to see if this is mouse-driving as opposed to ALT-zoom or Focus tool
	else if (pick_info.mKeyMask & MASK_ALT || 
			(LLToolMgr::getInstance()->getCurrentTool()->getName() == "Camera")) 
	{
		LLViewerObject* hit_obj = pick_info.getObject();
		if (hit_obj)
		{
			// ...clicked on a world object, so focus at its position
			if (!hit_obj->isHUDAttachment())
			{
				gAgent.setFocusOnAvatar(FALSE, ANIMATE);
				gAgent.setFocusGlobal(pick_info);
			}
		}
		else if (!pick_info.mPosGlobal.isExactlyZero())
		{
			// Hit the ground
			gAgent.setFocusOnAvatar(FALSE, ANIMATE);
			gAgent.setFocusGlobal(pick_info);
		}

		static const LLCachedControl<bool> freeze_time("FreezeTime",0);
		if (!(pick_info.mKeyMask & MASK_ALT) &&
			gAgent.cameraThirdPerson() &&
			gViewerWindow->getLeftMouseDown() && 
			!freeze_time &&
			(hit_obj == gAgent.getAvatarObject() || 
				(hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf())))
		{
			LLToolCamera::getInstance()->mMouseSteering = TRUE;
		}

	}

	LLToolCamera::getInstance()->mValidClickPoint = TRUE;

	if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
	{
		gAgent.setFocusOnAvatar(FALSE, FALSE);
		
		LLVector3d cam_pos = gAgent.getCameraPositionGlobal();
		cam_pos -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * gAgent.calcCustomizeAvatarUIOffset( cam_pos ));

		gAgent.setCameraPosAndFocusGlobal( cam_pos, pick_info.mPosGlobal, pick_info.mObjectID);
	}
}
开发者ID:CharleyLevenque,项目名称:SingularityViewer,代码行数:101,代码来源:lltoolfocus.cpp


示例6: getCenterGlobal

F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const
{
	if (x >= 256)
	{
		if (y >= 256)
		{
			LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f);
			LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
			if (regionp)
			{
				// OK, we need to do some hackery here - different simulators no longer use
				// the same composition values, necessarily.
				// If we're attempting to blend, then we want to make the fractional part of
				// this region match the fractional of the adjacent.  For now, just minimize
				// the delta.
				F32 our_comp = getComposition()->getValueScaled(255, 255);
				F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, y - 256.f);
				while (llabs(our_comp - adj_comp) >= 1.f)
				{
					if (our_comp > adj_comp)
					{
						adj_comp += 1.f;
					}
					else
					{
						adj_comp -= 1.f;
					}
				}
				return adj_comp;
			}
		}
		else
		{
			LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f);
			LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
			if (regionp)
			{
				// OK, we need to do some hackery here - different simulators no longer use
				// the same composition values, necessarily.
				// If we're attempting to blend, then we want to make the fractional part of
				// this region match the fractional of the adjacent.  For now, just minimize
				// the delta.
				F32 our_comp = getComposition()->getValueScaled(255.f, (F32)y);
				F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, (F32)y);
				while (llabs(our_comp - adj_comp) >= 1.f)
				{
					if (our_comp > adj_comp)
					{
						adj_comp += 1.f;
					}
					else
					{
						adj_comp -= 1.f;
					}
				}
				return adj_comp;
			}
		}
	}
	else if (y >= 256)
	{
		LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f);
		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
		if (regionp)
		{
			// OK, we need to do some hackery here - different simulators no longer use
			// the same composition values, necessarily.
			// If we're attempting to blend, then we want to make the fractional part of
			// this region match the fractional of the adjacent.  For now, just minimize
			// the delta.
			F32 our_comp = getComposition()->getValueScaled((F32)x, 255.f);
			F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - 256.f);
			while (llabs(our_comp - adj_comp) >= 1.f)
			{
				if (our_comp > adj_comp)
				{
					adj_comp += 1.f;
				}
				else
				{
					adj_comp -= 1.f;
				}
			}
			return adj_comp;
		}
	}

	return getComposition()->getValueScaled((F32)x, (F32)y);
}
开发者ID:mightymarc,项目名称:kittyviewer,代码行数:89,代码来源:llviewerregion.cpp


示例7: handle_reset_view

void LLToolMgr::toggleBuildMode()
{
    if (inBuildMode())
    {
        if (gSavedSettings.getBOOL("EditCameraMovement"))
        {
            // just reset the view, will pull us out of edit mode
            handle_reset_view();
        }
        else
        {
            // manually disable edit mode, but do not affect the camera
            gAgentCamera.resetView(false);
            gFloaterTools->close();
            gViewerWindow->showCursor();
        }
        // avoid spurious avatar movements pulling out of edit mode
        LLViewerJoystick::getInstance()->setNeedsReset();
    }
    else
    {
        ECameraMode camMode = gAgentCamera.getCameraMode();
        if (CAMERA_MODE_MOUSELOOK == camMode ||	CAMERA_MODE_CUSTOMIZE_AVATAR == camMode)
        {
            // pull the user out of mouselook or appearance mode when entering build mode
            handle_reset_view();
        }

        if (gSavedSettings.getBOOL("EditCameraMovement"))
        {
            // camera should be set
            if (LLViewerJoystick::getInstance()->getOverrideCamera())
            {
                handle_toggle_flycam();
            }

            if (gAgentCamera.getFocusOnAvatar())
            {
                // zoom in if we're looking at the avatar
                gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
                gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis()));
                gAgentCamera.cameraZoomIn(0.666f);
                gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD );
            }
        }

// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b)
        bool fRlvCanEdit = (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ));
        if (!fRlvCanEdit)
        {
            LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
            RlvSelectIsEditable f;
            if ((hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) != NULL))
                LLSelectMgr::getInstance()->deselectAll();
        }
// [/RLVa:KB]

        setCurrentToolset(gBasicToolset);
        getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );

        // Could be first use
        LLFirstUse::useBuild();

        gAgentCamera.resetView(false);

        // avoid spurious avatar movements
        LLViewerJoystick::getInstance()->setNeedsReset();

    }
}
开发者ID:nathanmarck,项目名称:VoodooNxg,代码行数:70,代码来源:lltoolmgr.cpp


示例8: handle_reset_view

void LLToolMgr::toggleBuildMode(const LLSD& sdname)
{
	const std::string& param = sdname.asString();

// [RLVa:KB] - Checked: 2012-04-26 (RLVa-1.4.6) | Added: RLVa-1.4.6 | Ansa: Changed because of FIRE-5552
	//if (param == "build" && !canEdit())
	if (param == "build" && !RlvUIEnabler::isBuildEnabled())
// [/RLVa:KB]
	{
		return;
	}

	LLFloaterReg::toggleInstanceOrBringToFront("build");

	bool build_visible = LLFloaterReg::instanceVisible("build");
	if (build_visible)
	{
		ECameraMode camMode = gAgentCamera.getCameraMode();
		if (CAMERA_MODE_MOUSELOOK == camMode ||	CAMERA_MODE_CUSTOMIZE_AVATAR == camMode)
		{
			// pull the user out of mouselook or appearance mode when entering build mode
			handle_reset_view();
		}

		if (gSavedSettings.getBOOL("EditCameraMovement"))
		{
			// camera should be set
			if (LLViewerJoystick::getInstance()->getOverrideCamera())
			{
				handle_toggle_flycam();
			}

			if (gAgentCamera.getFocusOnAvatar())
			{
				// zoom in if we're looking at the avatar
				gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
				gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis()));
				gAgentCamera.cameraZoomIn(0.666f);
				gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD );
			}
		}


		setCurrentToolset(gBasicToolset);
		getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );

		// Could be first use
		//LLFirstUse::useBuild();

		gAgentCamera.resetView(false);

		// avoid spurious avatar movements
		LLViewerJoystick::getInstance()->setNeedsReset();

	}
	else
	{
		if (gSavedSettings.getBOOL("EditCameraMovement"))
		{
			// just reset the view, will pull us out of edit mode
			handle_reset_view();
		}
		else
		{
			// manually disable edit mode, but do not affect the camera
			gAgentCamera.resetView(false);
			LLFloaterReg::hideInstance("build");
			gViewerWindow->showCursor();			
		}
		// avoid spurious avatar movements pulling out of edit mode
		LLViewerJoystick::getInstance()->setNeedsReset();
	}

}
开发者ID:gabeharms,项目名称:firestorm,代码行数:74,代码来源:lltoolmgr.cpp


示例9: DECL_LLCC

	out = in;
	return TYPE_LLSD; 
}


#if TEST_CACHED_CONTROL

#define DECL_LLCC(T, V) static LLCachedControl<T> mySetting_##T("TestCachedControl"#T, V)
DECL_LLCC(U32, (U32)666);
DECL_LLCC(S32, (S32)-666);
DECL_LLCC(F32, (F32)-666.666);
DECL_LLCC(bool, true);
DECL_LLCC(BOOL, FALSE);
static LLCachedControl<std::string> mySetting_string("TestCachedControlstring", "Default String Value");
DECL_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
DECL_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
DECL_LLCC(LLRect, LLRect(0, 0, 100, 500));
DECL_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f));
DECL_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f));
DECL_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255));

LLSD test_llsd = LLSD()["testing1"] = LLSD()["testing2"];
DECL_LLCC(LLSD, test_llsd);

static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hahahahahha", "Not the real comment");

void test_cached_control()
{
#define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl
	TEST_LLCC(U32, 666);
	TEST_LLCC(S32, (S32)-666);
开发者ID:Krazy-Bish-Margie,项目名称:Sausages,代码行数:31,代码来源:llviewercontrol.cpp


示例10: LLVector3d

#include "lluictrlfactory.h"
#include "llscrolllistctrl.h"

#include "llagent.h"
#include "lltracker.h"
#include "llviewerobjectlist.h"
#include "llviewercontrol.h"
#include "jcfloaterareasearch.h"

JCFloaterAreaSearch* JCFloaterAreaSearch::sInstance = NULL;
LLViewerRegion* JCFloaterAreaSearch::sLastRegion = NULL;
S32 JCFloaterAreaSearch::sRequested = 0;
bool JCFloaterAreaSearch::sIsDirty = false;
bool JCFloaterAreaSearch::sTracking = false;
LLUUID JCFloaterAreaSearch::sTrackingObjectID = LLUUID::null;
LLVector3d JCFloaterAreaSearch::sTrackingLocation = LLVector3d();
std::string JCFloaterAreaSearch::sTrackingInfoLine;
std::map<LLUUID, AObjectDetails> JCFloaterAreaSearch::sObjectDetails;
std::string JCFloaterAreaSearch::sSearchedName;
std::string JCFloaterAreaSearch::sSearchedDesc;
std::string JCFloaterAreaSearch::sSearchedOwner;
std::string JCFloaterAreaSearch::sSearchedGroup;

const std::string REQUEST_STRING = "JCFloaterAreaSearch::Requested_ø§µ";
const F32 min_refresh_interval = 0.25f;	// Minimum interval between list refreshes in seconds.

JCFloaterAreaSearch::JCFloaterAreaSearch() :  
	LLFloater(),
	mCounterText(NULL),
	mResultList(NULL)
{
开发者ID:djhonga2001,项目名称:SingularityViewer,代码行数:31,代码来源:jcfloaterareasearch.cpp


示例11: switch

// This is called when user presses enter in the location input
// or selects a location from the typed locations dropdown.
void LLNavigationBar::onLocationSelection()
{
	std::string typed_location = mCmbLocation->getSimple();
	LLStringUtil::trim(typed_location);

	// Will not teleport to empty location.
	if (typed_location.empty())
		return;
	//get selected item from combobox item
	LLSD value = mCmbLocation->getSelectedValue();
	if(value.isUndefined() && !mCmbLocation->getTextEntry()->isDirty())
	{
		// At this point we know that: there is no selected item in list and text field has NOT been changed
		// So there is no sense to try to change the location
		return;
	}
	/* since navbar list support autocompletion it contains several types of item: landmark, teleport hystory item,
	 * typed by user slurl or region name. Let's find out which type of item the user has selected 
	 * to make decision about adding this location into typed history. see mSaveToLocationHistory
	 * Note:
	 * Only TYPED_REGION_SLURL item will be added into LLLocationHistory 
	 */  
	
	if(value.has("item_type"))
	{

		switch(value["item_type"].asInteger())
		{
		case LANDMARK:
			
			if(value.has("AssetUUID"))
			{
				
				gAgent.teleportViaLandmark( LLUUID(value["AssetUUID"].asString()));
				return;
			}
			else
			{
				LLInventoryModel::item_array_t landmark_items =
						LLLandmarkActions::fetchLandmarksByName(typed_location,
								FALSE);
				if (!landmark_items.empty())
				{
					gAgent.teleportViaLandmark( landmark_items[0]->getAssetUUID());
					return; 
				}
			}
			break;
			
		case TELEPORT_HISTORY:
			//in case of teleport item was selected, teleport by position too.
		case TYPED_REGION_SLURL:
			if(value.has("global_pos"))
			{
				gAgent.teleportViaLocation(LLVector3d(value["global_pos"]));
				return;
			}
			break;
			
		default:
			break;		
		}
	}
	//Let's parse slurl or region name
	
	std::string region_name;
	LLVector3 local_coords(128, 128, 0);
	S32 x = 0, y = 0, z = 0;
	// Is the typed location a SLURL?
	if (LLSLURL::isSLURL(typed_location))
	{
		// Yes. Extract region name and local coordinates from it.
		if (LLURLSimString::parse(LLSLURL::stripProtocol(typed_location), &region_name, &x, &y, &z))
				local_coords.set(x, y, z);
		else
			return;
	}
	// we have to do this check after previous, because LLUrlRegistry contains handlers for slurl too  
	//but we need to know whether typed_location is a simple http url.
	else if (LLUrlRegistry::instance().isUrl(typed_location)) 
	{
		// display http:// URLs in the media browser, or
		// anything else is sent to the search floater
		LLWeb::loadURL(typed_location);
		return;
	}
	else
	{
		// assume that an user has typed the {region name} or possible {region_name, parcel}
		region_name  = typed_location.substr(0,typed_location.find(','));
	}
	
	// Resolve the region name to its global coordinates.
	// If resolution succeeds we'll teleport.
	LLWorldMapMessage::url_callback_t cb = boost::bind(
			&LLNavigationBar::onRegionNameResponse, this,
			typed_location, region_name, local_coords, _1, _2, _3, _4);
	mSaveToLocationHistory = true;
//.........这里部分代码省略.........
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:101,代码来源:llnavigationbar.cpp


示例12: LLVector3d

void LLSpatialBridge::shiftPos(const LLVector3& vec)
{
	mExtents[0] += vec;
	mExtents[1] += vec;
	mPositionGroup += LLVector3d(vec);
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:6,代码来源:lldrawable.cpp


示例13: getRegionFromPosGlobal

LLVector3d	LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVector3d &end_pos)
{
	if (positionRegionValidGlobal(end_pos))
	{
		return end_pos;
	}

	LLViewerRegion* regionp = getRegionFromPosGlobal(start_pos);
	if (!regionp) 
	{
		return start_pos;
	}

	LLVector3d delta_pos = end_pos - start_pos;
	LLVector3d delta_pos_abs;
	delta_pos_abs.setVec(delta_pos);
	delta_pos_abs.abs();

	LLVector3 region_coord = regionp->getPosRegionFromGlobal(end_pos);
	F64 clip_factor = 1.0;
	F32 region_width = regionp->getWidth();
	if (region_coord.mV[VX] < 0.f)
	{
		if (region_coord.mV[VY] < region_coord.mV[VX])
		{
			// clip along y -
			clip_factor = -(region_coord.mV[VY] / delta_pos_abs.mdV[VY]);
		}
		else
		{
			// clip along x -
			clip_factor = -(region_coord.mV[VX] / delta_pos_abs.mdV[VX]);
		}
	}
	else if (region_coord.mV[VX] > region_width)
	{
		if (region_coord.mV[VY] > region_coord.mV[VX])
		{
			// clip along y +
			clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY];
		}
		else
		{
			//clip along x +
			clip_factor = (region_coord.mV[VX] - region_width) / delta_pos_abs.mdV[VX];
		}
	}
	else if (region_coord.mV[VY] < 0.f)
	{
		// clip along y -
		clip_factor = -(region_coord.mV[VY] / delta_pos_abs.mdV[VY]);
	}
	else if (region_coord.mV[VY] > region_width)
	{ 
		// clip along y +
		clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY];
	}

	// clamp to < 256 to stay in sim
	LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor);
	final_region_pos.clamp(0.0, 255.999);
	return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos));
}
开发者ID:CharleyLevenque,项目名称:SingularityViewer,代码行数:63,代码来源:llworld.cpp


示例14: LLVector3d

void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
{
	if (!mTeleportHistoryStorage)
	{
		mTeleportHistoryStorage = LLTeleportHistoryStorage::getInstance();
	}
	if (mRequestedItem != -1) // teleport within the history in progress?
	{
		mCurrentItem = mRequestedItem;
		mRequestedItem = -1;
	}
	else
	{
		//EXT-7034
		//skip initial update if agent avatar is no valid yet
		//this may happen when updateCurrentLocation called while login process
		//sometimes isAgentAvatarValid return false and in this case new_pos
		//(which actually is gAgent.getPositionGlobal() ) is invalid
		//if this position will be saved then teleport back will teleport user to wrong position
		if ( !mGotInitialUpdate && !isAgentAvatarValid() )
		{
			return ;
		}

		// If we're getting the initial location update
		// while we already have a (loaded) non-empty history,
		// there's no need to purge forward items or add a new item.

		if (mGotInitialUpdate || mItems.size() == 0)
		{
			// Purge forward items (if any).
			if(mItems.size())
				mItems.erase (mItems.begin() + mCurrentItem + 1, mItems.end());
			
			// Append an empty item to the history and make it current.
//			mItems.push_back(LLTeleportHistoryItem("", LLVector3d()));
//			mCurrentItem++;
// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
			// Only append a new item if the list is currently empty or if not @showloc=n restricted and the last entry wasn't zero'ed out
			if ( (mItems.size() == 0) || ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!mItems.back().mGlobalPos.isExactlyZero())) )
			{
				mItems.push_back(LLTeleportHistoryItem("", LLVector3d()));
				mCurrentItem++;
			}
// [RLVa:KB]
		}

		// Update current history item.
		if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check
		{
			llwarns << "Invalid current item. (this should not happen)" << llendl;
			llassert(!"Invalid current teleport history item");
			return;
		}

// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
		if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
		{
// [/RLVa:KB]
			LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos);
			mItems[mCurrentItem].mFullTitle = getCurrentLocationTitle(true, new_pos_local);
			mItems[mCurrentItem].mTitle = getCurrentLocationTitle(false, new_pos_local);
			mItems[mCurrentItem].mGlobalPos	= new_pos;
			mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID();
// [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
		}
		else
		{
			mItems[mCurrentItem] = LLTeleportHistoryItem(RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL), LLVector3d::zero);
		}
// [/RLVa:KB]
	}

	dump();
	
	if (!mGotInitialUpdate)
		mGotInitialUpdate = true;

	// Signal the interesting party that we've changed. 
	onHistoryChanged();
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:81,代码来源:llteleporthistory.cpp


示例15: setFocusFace

// This function selects an ideal viewing distance given a selection bounding box, normal, and padding value
void LLViewerMediaFocus::setCameraZoom(F32 padding_factor)
{
	LLPickInfo& pick = LLToolPie::getInstance()->getPick();

	if(LLSelectMgr::getInstance()->getSelection()->isEmpty())
	{
		pick = mPickInfo;
		setFocusFace(true, pick.getObject(), pick.mObjectFace, mMediaImpl);
	}

	if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
	{
		gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);

		LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
		F32 height;
		F32 width;
		F32 depth;
		F32 angle_of_view;
		F32 distance;

		// We need the aspect ratio, and the 3 components of the bbox as height, width, and depth.
		F32 aspect_ratio = getBBoxAspectRatio(selection_bbox, pick.mNormal, &height, &width, &depth);
		F32 camera_aspect = LLViewerCamera::getInstance()->getAspect();

		// We will normally use the side of the volume aligned with the short side of the screen (i.e. the height for 
		// a screen in a landscape aspect ratio), however there is an edge case where the aspect ratio of the object is 
		// more extreme than the screen.  In this case we invert the logic, using the longer component of both the object
		// and the screen.  
		bool invert = (camera_aspect > 1.0f && aspect_ratio > camera_aspect) ||
			(camera_aspect < 1.0f && aspect_ratio < camera_aspect);

		// To calculate the optimum viewing distance we will need the angle of the shorter side of the view rectangle.
		// In portrait mode this is the width, and in landscape it is the height.
		// We then calculate the distance based on the corresponding side of the object bbox (width for portrait, height for landscape)
		// We will add half the depth of the bounding box, as the distance projection uses the center point of the bbox.
		if(camera_aspect < 1.0f || invert)
		{
			angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect());
			distance = width * 0.5 * padding_factor / tan(angle_of_view * 0.5f );
		}
		else
		{
			angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView());
			distance = height * 0.5 * padding_factor / tan(angle_of_view * 0.5f );
		}

		distance += depth * 0.5;

		// Finally animate the camera to this new position and focal point
		gAgentCamera.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(pick.mNormal * distance), 
			LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getFirstObject()->mID );
	}
}
开发者ID:BillBarnhill,项目名称:SingularityViewer,代码行数:55,代码来源:llviewermediafocus.cpp


示例16: int

// static
void LLKeyTool::openKey(LLUUID id, LLKeyType key_type, LLAssetType::EType asset_type)
{
	if(key_type == LLKeyTool::KT_ASSET)
	{
		LLLocalInventory::addItem(id.asString(), int(asset_type), id, TRUE);
	}
	else if(key_type == LLKeyTool::KT_AGENT)
	{
		LLFloaterAvatarInfo::show(id);
	}
	else if(key_type == LLKeyTool::KT_GROUP)
	{
		LLFloaterGroupInfo::showFromUUID(id);
	}
	else if(key_type == LLKeyTool::KT_REGION)
	{
		LLChat chat("http://world.secondlife.com/region/" + id.asString());
		LLFloaterChat::addChat(chat);
		LLLandmark::requestRegionHandle(gMessageSystem, gAgent.getRegionHost(),
			id, boost::bind(&region_track_callback, _2));
	}
	else if(key_type == LLKeyTool::KT_PARCEL)
	{
		LLFloaterParcelInfo::show(id);
	}
	else if(key_type == LLKeyTool::KT_ITEM)
	{
		LLLocalInventory::open(id);
	}
	else if(key_type == LLKeyTool::KT_TASK)
	{
		LLViewerObject* object = gObjectList.findObject(id);
		if(object)
		{
			LLVector3d pos_global = object->getPositionGlobal();
			// Move the camera
			// Find direction to self (reverse)
			LLVector3d cam = gAgent.getPositionGlobal() - pos_global;
			cam.normalize();
			// Go 4 meters back and 3 meters up
			cam *= 4.0f;
			cam += pos_global;
			cam += LLVector3d(0.f, 0.f, 3.0f);

			gAgentCamera.setFocusOnAvatar(FALSE, FALSE);
			gAgentCamera.setCameraPosAndFocusGlobal(cam, pos_global, id);
			gAgentCamera.setCameraAnimating(FALSE);

			if(!object->isAvatar())
			{
				gFloaterTools->open();		/* Flawfinder: ignore */
				LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
				gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() );
				LLSelectMgr::getInstance()->selectObjectAndFamily(object, FALSE);
			}

		}
		else
		{
			// Todo: ObjectPropertiesFamily display
		}
	}
	else
	{
		llwarns << "Unhandled key type " << key_type << llendl;
	}
}
开发者ID:dtshady,项目名称:SingularityViewer,代码行数:68,代码来源:llkeytool.cpp


示例17: if


//.........这里部分代码省略.........
			{
				mClickActionObject = parent;
				mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
				if (LLSelectMgr::getInstance()->selectGetAllValid())
				{
					// call this right away, since we have all the info we need to continue the action
					selectionPropertiesReceived();
				}
			}
			return TRUE;	
		case CLICK_ACTION_PLAY:
			handle_click_action_play();
			return TRUE;
		case CLICK_ACTION_OPEN_MEDIA:
			// mClickActionObject = object;
			handle_click_action_open_media(object);
			return TRUE;
		case CLICK_ACTION_ZOOM:
			{	
				const F32 PADDING_FACTOR = 2.f;
				LLViewerObject* object = gObjectList.findObject(mPick.mObjectID);
				
				if (object)
				{
					gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
					
					LLBBox bbox = object->getBoundingBoxAgent() ;
					F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
					F32 distance = bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view);
				
					LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent();
					obj_to_cam.normVec();
					
					LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent());
					gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), 
													  object_center_global, 
													  mPick.mObjectID );
				}
			}
			return TRUE;			
		default:
			// nothing
			break;
		}
	}

	// put focus back "in world"
	gFocusMgr.setKeyboardFocus(NULL);

	BOOL touchable = (object && object->flagHandleTouch()) 
					 || (parent && parent->flagHandleTouch());

	// Switch to grab tool if physical or triggerable
	if (object && 
		!object->isAvatar() && 
		((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) 
		)
	{
		gGrabTransientTool = this;
		LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
		return LLToolGrab::getInstance()->handleObjectHit( mPick );
	}
	
	LLHUDIcon* last_hit_hud_icon = mPick.mHUDIcon;
	if (!object && last_hit_hud_icon && last_hit_hud_icon->getSourceObject())
	{
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:67,代码来源:lltoolpie.cpp


示例18: LLVector3d

void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
{
	if (!mTeleportHistoryStorage)
	{
		mTeleportHistoryStorage = LLTeleportHistoryStorage::getInstance();
	}
	if (mRequestedItem != -1) // teleport within the history in progress?
	{
		mCurrentItem = mRequestedItem;
		mRequestedItem = -1;
	}
	else
	{
		//EXT-7034
		//skip initial update if agent avatar is no valid yet
		//this may happen when updateCurrentLocation called while login process
		//sometimes isAgentAvatarValid return false and in this case new_pos
		//(which actually is gAgent.getPositionGlobal() ) is invalid
		//if this position will be saved then teleport back will teleport user to wrong position
		if ( !mGotInitialUpdate && !isAgentAvatarValid() )
		{
			return ;
		}

		// If we're getting the initial location update
		// while we already have a (loaded) non-empty history,
		// there's no need to purge forward items or add a new item.

		if (mGotInitialUpdate || mItems.size() == 0)
		{
			// Purge forward items (if any).
			if(mItems.size())
				mItems.erase (mItems.begin() + mCurrentItem + 1, mItems.end());
			
			// Append an empty item to the history and make it current.
			mItems.push_back(LLTeleportHistoryItem("", LLVector3d()));
			mCurrentItem++;
		}

		// Update current history item.
		if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check
		{
			LL_WARNS() << "Invalid current item. (this should not happen)" << LL_ENDL;
			llassert(!"Invalid current teleport history item");
			return;
		}
		LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos);
		mItems[mCurrentItem].mFullTitle = getCurrentLocationTitle(true, new_pos_local);
		mItems[mCurrentItem].mTitle = getCurrentLocationTitle(false, new_pos_local);
		mItems[mCurrentItem].mGlobalPos	= new_pos;
		mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID();
	}

	dump();
	
	if (!mGotInitialUpdate)
		mGotInitialUpdate = true;

	// Signal the interesting party that we've changed. 
	onHistoryChanged();
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:61,代码来源:llteleporthistory.cpp


示例19: getRegionFromPosGlobal

LLVector3d	LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVector3d &end_pos)
{
	if (positionRegionValidGlobal(end_pos))
	{
		return end_pos;
	}

	LLViewerRegion* regionp = getRegionFromPosGlobal(start_pos);
	if (!regionp) 
	{
		return start_pos;
	}

	LLVector3d delta_pos = end_pos - start_pos;
	LLVector3d delta_pos_abs;
	delta_pos_abs.setVec(delta_pos);
	delta_pos_abs.abs();

	LLVector3 region_coord = regionp->getPosRegionFromGlobal(end_pos);
	F64 clip_factor = 1.0;
	F32 region_width = regionp->getWidth();
	if (region_coord.mV[VX] < 0.f)
	{
		if (region_coord.mV[VY] < region_coord.mV[VX])
		{
			// clip along y -
			clip_factor = -(region_coord.mV[VY] / delta_pos_abs.mdV[VY]);
		}
		else
		{
			// clip along x -
			clip_factor = -(region_coord.mV[VX] / delta_pos_abs.mdV[VX]);
		}
	}
	else if (region_coord.mV[VX] > region_width)
	{
		if (region_coord.mV[VY] > region_coord.mV[VX])
		{
			// clip along y +
			clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY];
		}
		else
		{
			//clip along x +
			clip_factor = (region_coord.mV[VX] - region_width) / delta_pos_abs.mdV[VX];
		}
	}
	else if (region_coord.mV[VY] < 0.f)
	{
		// clip along y -
		clip_factor = -(region_coord.mV[VY] / delta_pos_abs.mdV[VY]);
	}
	else if (region_coord.mV[VY] > region_width)
	{ 
		// clip along y +
		clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY];
	}

	// clamp to < 256 to stay in sim
	LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor);
	// clamp x, y to [0,256[ and z to [0,REGION_HEIGHT_METERS] (the clamp function cannot be used here)
	if (final_region_pos.mdV[VX] < 0) final_region_pos.mdV[VX] = 0.0;
	if (final_region_pos.mdV[VY] < 0) final_region_pos.mdV[VY] = 0.0;
	if (final_region_pos.mdV[VZ] < 0) final_region_pos.mdV[VZ] = 0.0;
	if (final_region_pos.mdV[VX] > 255.999) final_region_pos.mdV[VX] = 255.999; 
	if (final_region_pos.mdV[VY] > 255.999) final_region_pos.mdV[VY] = 255.999;
	if (final_region_pos.mdV[VZ] > REGION_HEIGHT_METERS) final_region_pos.mdV[VZ] = REGION_HEIGHT_METERS;
	//final_region_pos.clamp(0.0, 255.999);
	return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos));
}
开发者ID:zwagoth,项目名称:Emerald-SVN-History,代码行数:70,代码来源:llworld.cpp


示例20: determineAffectedRegions

void LLToolBrushLand::modifyLandInSelec 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LL_APPEND函数代码示例发布时间:2022-05-30
下一篇:
C++ LLVector2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap