本文整理汇总了C++中LLViewerObject::getLocalID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::getLocalID方法的具体用法?C++ LLViewerObject::getLocalID怎么用?C++ LLViewerObject::getLocalID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::getLocalID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getData
void JCAssetComparer::getData(LLUUID object)
{
LLViewerObject* objectp = gObjectList.findObject(object);
if(objectp)
{
gMessageSystem->newMessageFast(_PREHASH_ObjectSelect);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID());
gAgent.sendReliableMessage();
}
}
示例2: cmdline_printchat
/*void ImportTracker::clear()
{
if(linkset.isDefined())lastrootid = linkset[0]["LocalID"].asInteger();
localids.clear();
linkset.clear();
state = IDLE;
finish();
}
void cmdline_printchat(std::string message);*/
LLViewerObject* find(U32 local)
{
S32 i;
S32 total = gObjectList.getNumObjects();
for (i = 0; i < total; i++)
{
LLViewerObject *objectp = gObjectList.getObject(i);
if (objectp)
{
if(objectp->getLocalID() == local)return objectp;
}
}
return NULL;
}
示例3: serializeSelection
void ScriptCounter::serializeSelection(bool delScript)
{
LLDynamicArray<LLViewerObject*> catfayse;
foo=LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
sstr.str("");
invqueries=0;
doDelete=false;
scriptcount=0;
objIDS.clear();
delUUIDS.clear();
objectCount=0;
countingDone=false;
reqObjectID.setNull();
if(foo)
{
if(foo->isAvatar())
{
LLVOAvatar* av=find_avatar_from_object(foo);
if(av)
{
for (LLVOAvatar::attachment_map_t::iterator iter = av->mAttachmentPoints.begin();
iter != av->mAttachmentPoints.end();
++iter)
{
LLViewerJointAttachment* attachment = iter->second;
if (!attachment->getValid())
continue ;
LLViewerObject* object = attachment->getObject();
if(object)
{
catfayse.put(object);
objectCount++;
}
}
}
}
else
{
for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
if(object)
{
catfayse.put(object);
objectCount++;
}
}
doDelete=delScript;
}
F32 throttle = gSavedSettings.getF32("OutBandwidth");
if((throttle == 0.f) || (throttle > 128000.f))
{
gMessageSystem->mPacketRing.setOutBandwidth(128000);
gMessageSystem->mPacketRing.setUseOutThrottle(TRUE);
}
cmdline_printchat("Counting scripts. Please wait.");
if((objectCount == 1) && !(foo->isAvatar()))
{
LLViewerObject *reqObject=((LLViewerObject*)foo->getRoot());
if(reqObject->isAvatar())
{
for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++ )
{
LLSelectNode *nodep = *iter;
LLViewerObject* objectp = nodep->getObject();
if (objectp->isRootEdit())
{
reqObjectID=objectp->getID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectSelect);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID());
msg->sendReliable(gAgent.getRegionHost());
break;
}
}
}
else
{
reqObjectID=reqObject->getID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, 0 );
msg->addUUIDFast(_PREHASH_ObjectID, reqObjectID);
gAgent.sendReliableMessage();
}
}
serialize(catfayse);
}
}
示例4: subserialize
//.........这里部分代码省略.........
prim_llsd["position"] = LLVector3(0, 0, 0).getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
else
{
prim_llsd["position"] = object->getPosition().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
//prim_llsd["name"] = "";//node->mName;
//prim_llsd["description"] = "";//node->mDescription;
// Transforms
prim_llsd["scale"] = object->getScale().getValue();
// Flags
prim_llsd["shadows"] = object->flagCastShadows();
prim_llsd["phantom"] = object->flagPhantom();
prim_llsd["physical"] = (BOOL)(object->mFlags & FLAGS_USE_PHYSICS);
LLVolumeParams params = object->getVolume()->getParams();
prim_llsd["volume"] = params.asLLSD();
if (object->isFlexible())
{
LLFlexibleObjectData* flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
prim_llsd["flexible"] = flex->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT))
{
LLLightParams* light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT);
prim_llsd["light"] = light->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
{
LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
prim_llsd["sculpt"] = sculpt->asLLSD();
}
// Textures
LLSD te_llsd;
U8 te_count = object->getNumTEs();
for (U8 i = 0; i < te_count; i++)
{
te_llsd.append(object->getTE(i)->asLLSD());
}
if(export_textures)
{
std::string path = asset_dir + gDirUtilp->getDirDelimiter();
for (U8 i = 0; i < te_count; i++)
{
LLUUID asset_id = object->getTE(i)->getID();
JCAssetInfo* info = new JCAssetInfo;
info->path = path + asset_id.asString() + ".j2c";
info->name = "Prim Texture";
//gAssetStorage->getAssetData(asset_id, LLAssetType::AT_TEXTURE, JCAssetExportCallback, info,1);
if(requested_textures.count(asset_id) == 0)
{
requested_textures.insert(asset_id);
LLViewerImage* img = gImageList.getImage(asset_id, MIPMAP_TRUE, FALSE);
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAX_LEVEL);
img->setLoadedCallback( JCExportTracker::onFileLoadedForSave,
0, TRUE, FALSE, info );
llinfos << "Requesting texture " << asset_id.asString() << llendl;
}
}
}
//JCExportTracker::mirror(asset, obj, asset_dir, asset->getUUID().asString());
prim_llsd["textures"] = te_llsd;
prim_llsd["id"] = object->getID().asString();
if(export_properties)
{
////cmdline_printchat(llformat("yes %d",export_properties));
propertyqueries += 1;
gMessageSystem->newMessageFast(_PREHASH_ObjectSelect);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID());
gMessageSystem->sendReliable(gAgent.getRegionHost());
if(export_inventory)
{
object->registerInventoryListener(sInstance,NULL);
object->dirtyInventory();
object->requestInventory();
invqueries += 1;
}
}//else //cmdline_printchat(llformat("no %d",export_properties));
totalprims += 1;
// Changed to use link numbers zero-indexed.
llsd[object_index - 1] = prim_llsd;
}
return llsd;
}
示例5: primsToLLSD
LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool is_attachment)
{
LLViewerObject* object;
LLSD llsd;
char localid[16];
for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i)
{
object = (*i);
LLUUID id = object->getID();
LL_INFOS("ObjectBackup") << "Exporting prim " << object->getID().asString() << LL_ENDL;
// Create an LLSD object that represents this prim. It will be injected in to the overall LLSD
// tree structure
LLSD prim_llsd;
if (!object->isRoot())
{
// Parent id
snprintf(localid, sizeof(localid), "%u", object->getSubParent()->getLocalID());
prim_llsd["parent"] = localid;
}
// Name and description
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->findNode(object);
if (node)
{
prim_llsd["name"] = node->mName;
prim_llsd["description"] = node->mDescription;
}
// Transforms
if (is_attachment)
{
prim_llsd["position"] = object->getPositionEdit().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotationEdit());
}
else
{
prim_llsd["position"] = object->getPosition().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
prim_llsd["scale"] = object->getScale().getValue();
// Flags
prim_llsd["shadows"] = FALSE;
prim_llsd["phantom"] = object->flagPhantom();
prim_llsd["physical"] = object->flagUsePhysics();
// Volume params
LLVolumeParams params = object->getVolume()->getParams();
prim_llsd["volume"] = params.asLLSD();
// Extra paramsb6fab961-af18-77f8-cf08-f021377a7244
if (object->isFlexible())
{
// Flexible
LLFlexibleObjectData* flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
prim_llsd["flexible"] = flex->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT))
{
// Light
LLLightParams* light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT);
prim_llsd["light"] = light->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
{
// Sculpt
LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
prim_llsd["sculpt"] = sculpt->asLLSD();
LLUUID sculpt_texture = sculpt->getSculptTexture();
if (sculpt_texture == validateTextureID(sculpt_texture))
{
bool alreadyseen = false;
std::list<LLUUID>::iterator iter;
for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++)
{
if ((*iter) == sculpt_texture)
alreadyseen = true;
}
if (alreadyseen == false)
{
LL_INFOS("ObjectBackup") << "Found a sculpt texture, adding to list " << sculpt_texture << LL_ENDL;
mTexturesList.push_back(sculpt_texture);
}
}
else
{
LL_WARNS("ObjectBackup") << "Incorrect permission to export a sculpt texture." << LL_ENDL;
LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED;
}
}
// Textures
LLSD te_llsd;
LLSD this_te_llsd;
LLUUID t_id;
//.........这里部分代码省略.........
示例6: primsToLLSD
LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list,
bool is_attachment)
{
LLViewerObject* object;
LLSD llsd;
char localid[16];
LLUUID t_id;
for (LLViewerObject::child_list_t::iterator i = child_list.begin();
i != child_list.end(); ++i)
{
object = (*i);
LLUUID id = object->getID();
LL_INFOS() << "Exporting prim " << object->getID().asString() << LL_ENDL;
// Create an LLSD object that represents this prim. It will be injected
// in to the overall LLSD tree structure
LLSD prim_llsd;
if (!object->isRoot())
{
// Parent id
snprintf(localid, sizeof(localid), "%u",
object->getSubParent()->getLocalID());
prim_llsd["parent"] = localid;
}
// Name and description
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->findNode(object);
if (node)
{
prim_llsd["name"] = node->mName;
prim_llsd["description"] = node->mDescription;
}
// Transforms
if (is_attachment)
{
prim_llsd["position"] = object->getPositionEdit().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotationEdit());
}
else
{
prim_llsd["position"] = object->getPosition().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
prim_llsd["scale"] = object->getScale().getValue();
// Flags
prim_llsd["phantom"] = object->flagPhantom(); // legacy
prim_llsd["physical"] = object->flagUsePhysics(); // legacy
prim_llsd["flags"] = (S32)object->getFlags(); // new way
// Extra physics flags
if (mGotExtraPhysics)
{
LLSD& physics = prim_llsd["ExtraPhysics"];
physics["PhysicsShapeType"] = object->getPhysicsShapeType();
physics["Gravity"] = object->getPhysicsGravity();
physics["Friction"] = object->getPhysicsFriction();
physics["Density"] = object->getPhysicsDensity();
physics["Restitution"] = object->getPhysicsRestitution();
}
// Click action
if (S32 action = object->getClickAction()) // Non-zero
prim_llsd["clickaction"] = action;
// Prim material
prim_llsd["material"] = object->getMaterial();
// Volume params
LLVolumeParams params = object->getVolume()->getParams();
prim_llsd["volume"] = params.asLLSD();
// Extra paramsb6fab961-af18-77f8-cf08-f021377a7244
if (object->isFlexible())
{
// Flexible
LLFlexibleObjectData* flex;
flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
prim_llsd["flexible"] = flex->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT))
{
// Light
LLLightParams* light;
light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT);
prim_llsd["light"] = light->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
{
// Light image
LLLightImageParams* light_param;
light_param = (LLLightImageParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
t_id = validateTextureID(light_param->getLightTexture());
if (mTexturesList.count(t_id) == 0)
//.........这里部分代码省略.........
示例7: prims_to_llsd
LLSD primbackup::prims_to_llsd(LLViewerObject::child_list_t child_list)
{
LLViewerObject* object;
LLSD llsd;
char localid[16];
for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i)
{
object=(*i);
LLUUID id = object->getID();
llinfos << "Exporting prim " << object->getID().asString() << llendl;
// Create an LLSD object that represents this prim. It will be injected in to the overall LLSD
// tree structure
LLSD prim_llsd;
if (!object->isRoot())
{
// Parent id
snprintf(localid, sizeof(localid), "%u", object->getSubParent()->getLocalID());
prim_llsd["parent"] = localid;
}
// Transforms
prim_llsd["position"] = object->getPosition().getValue();
prim_llsd["scale"] = object->getScale().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
// Flags
prim_llsd["shadows"] = object->flagCastShadows();
prim_llsd["phantom"] = object->flagPhantom();
prim_llsd["physical"] = (BOOL)(object->mFlags & FLAGS_USE_PHYSICS);
// Volume params
LLVolumeParams params = object->getVolume()->getParams();
prim_llsd["volume"] = params.asLLSD();
// Extra paramsb6fab961-af18-77f8-cf08-f021377a7244
if (object->isFlexible())
{
// Flexible
LLFlexibleObjectData* flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
prim_llsd["flexible"] = flex->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT))
{
// Light
LLLightParams* light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT);
prim_llsd["light"] = light->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
{
// Sculpt
LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
prim_llsd["sculpt"] = sculpt->asLLSD();
LLUUID sculpt_texture=sculpt->getSculptTexture();
bool alreadyseen=false;
std::list<LLUUID>::iterator iter;
for(iter = textures.begin(); iter != textures.end() ; iter++)
{
if( (*iter)==sculpt_texture)
alreadyseen=true;
}
if(alreadyseen==false)
{
llinfos << "Found a sculpt texture, adding to list "<<sculpt_texture<<llendl;
textures.push_back(sculpt_texture);
}
}
// Textures
LLSD te_llsd;
U8 te_count = object->getNumTEs();
for (U8 i = 0; i < te_count; i++)
{
bool alreadyseen=false;
te_llsd.append(object->getTE(i)->asLLSD());
std::list<LLUUID>::iterator iter;
for(iter = textures.begin(); iter != textures.end() ; iter++)
{
if( (*iter)==object->getTE(i)->getID())
alreadyseen=true;
}
if(alreadyseen==false)
textures.push_back(object->getTE(i)->getID());
}
prim_llsd["textures"] = te_llsd;
// The keys in the primitive maps do not have to be localids, they can be any
// string. We simply use localids because they are a unique identifier
snprintf(localid, sizeof(localid), "%u", object->getLocalID());
llsd[(const char*)localid] = prim_llsd;
}
updateexportnumbers();
//.........这里部分代码省略.........