本文整理汇总了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
}
示例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());
}
示例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);
}
}
}
示例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();
}
示例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);
}