当前位置: 首页>>代码示例>>C++>>正文


C++ LLAgent::getCameraPositionAgent方法代码示例

本文整理汇总了C++中LLAgent::getCameraPositionAgent方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAgent::getCameraPositionAgent方法的具体用法?C++ LLAgent::getCameraPositionAgent怎么用?C++ LLAgent::getCameraPositionAgent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLAgent的用法示例。


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

示例1: setPixelAreaAndAngle

void LLVOTree::setPixelAreaAndAngle(LLAgent &agent)
{
    // First calculate values as for any other object (for mAppAngle)
    LLViewerObject::setPixelAreaAndAngle(agent);

    // Re-calculate mPixelArea accurately

    // This should be the camera's center, as soon as we move to all region-local.
    LLVector3 relative_position = getPositionAgent() - agent.getCameraPositionAgent();
    F32 range = relative_position.length();				// ugh, square root

    F32 max_scale = mBillboardScale * getMaxScale();
    F32 area = max_scale * (max_scale*mBillboardRatio);

    // Compute pixels per meter at the given range
    F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() /
                           (tan(LLViewerCamera::getInstance()->getView()) * range);

    mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area;
#if 0
    // mAppAngle is a bit of voodoo;
    // use the one calculated LLViewerObject::setPixelAreaAndAngle above
    // to avoid LOD miscalculations
    mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG;
#endif
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:26,代码来源:llvotree.cpp

示例2: plyWood

void Object::plyWood()
{
		LLMessageSystem* msg = gMessageSystem;
		msg->newMessageFast(_PREHASH_ObjectAdd);
		msg->nextBlockFast(_PREHASH_AgentData);
		msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
		msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
		msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
		msg->nextBlockFast(_PREHASH_ObjectData);
		msg->addU8Fast(_PREHASH_Material, 3);
		//msg->addU32Fast(_PREHASH_AddFlags, ); // CREATE_SELECTED
		LLVolumeParams	volume_params;
		volume_params.setType(0x01, 0x10);
		volume_params.setBeginAndEndS(0.f, 1.f);
		volume_params.setBeginAndEndT(0.f, 1.f);
		volume_params.setRatio(1, 1);
		volume_params.setShear(0, 0);
		LLVolumeMessage::packVolumeParams(&volume_params, msg);
		msg->addU8Fast(_PREHASH_PCode, 9);
		msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52346f, 0.52347f, 0.52348f));
		LLQuaternion rot;
		msg->addQuatFast(_PREHASH_Rotation, rot);
		LLViewerRegion *region = gAgent.getRegion();
		LLVector3 root(0.f,0.f,0.1f);
		root+=gAgent.getCameraPositionAgent();
		msg->addVector3Fast(_PREHASH_RayStart, root);
		msg->addVector3Fast(_PREHASH_RayEnd, root);
		msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
		msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
		msg->addU8Fast(_PREHASH_State, (U8)0);
		msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
		msg->sendReliable(region->getHost());
}
开发者ID:N3X15,项目名称:Luna-Viewer,代码行数:33,代码来源:LuaBuild_f.cpp

示例3: updateTextures

void LLVOTextBubble::updateTextures(LLAgent &agent)
{
	// Update the image levels of all textures...
	// First we do some quick checks.
	U32 i;

	// This doesn't take into account whether the object is in front
	// or behind...

	LLVector3 position_local = getPositionAgent() - agent.getCameraPositionAgent();
	F32 dot_product = position_local * agent.getFrameAgent().getAtAxis();
	F32 cos_angle = dot_product / position_local.magVec();

	if (cos_angle > 1.f)
	{
		cos_angle = 1.f;
	}

	for (i = 0; i < getNumTEs(); i++)
	{
		const LLTextureEntry *te = getTE(i);
		F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT);

		LLViewerImage *imagep = getTEImage(i);
		if (imagep)
		{
			imagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle);
		}
	}
}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:30,代码来源:llvotextbubble.cpp

示例4: import

void ImportTracker::import(LLSD& ls_data)
{
	if(!(linkset.size()))
		if(!(linksetgroups.size()))
			initialPos=gAgent.getCameraPositionAgent();
	linkset = ls_data;
	updated=0;
	LLSD rot = linkset[0]["rotation"];
	rootrot.mQ[VX] = (F32)(rot[0].asReal());
	rootrot.mQ[VY] = (F32)(rot[1].asReal());
	rootrot.mQ[VZ] = (F32)(rot[2].asReal());
	rootrot.mQ[VW] = (F32)(rot[3].asReal());
	state = BUILDING;
	//llinfos << "IMPORTED, BUILDING.." << llendl;
	plywood_above_head();
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:16,代码来源:importtracker.cpp

示例5: importer

void ImportTracker::importer(std::string file,  void (*callback)(LLViewerObject*))
{
	mDownCallback = callback;
	asset_insertions = 0;

	llifstream importer(file);
	LLSD data;
	LLSDSerialize::fromXMLDocument(data, importer);

	LLSD file_data = data["Objects"];
	data = LLSD();

	filepath = file;
	asset_dir = filepath.substr(0,filepath.find_last_of(".")) + "_assets";

	linksetgroups=file_data;
	//llinfos << "LOADED LINKSETS, PREPARING.." << llendl;
	groupcounter=0;
	LLSD ls_llsd;
	ls_llsd=linksetgroups[groupcounter]["Object"];
	linksetoffset=linksetgroups[groupcounter]["ObjectPos"];
	initialPos=gAgent.getCameraPositionAgent();
	import(ls_llsd);
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:24,代码来源:importtracker.cpp


注:本文中的LLAgent::getCameraPositionAgent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。