本文整理汇总了C++中LLTextureEntry::asLLSD方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextureEntry::asLLSD方法的具体用法?C++ LLTextureEntry::asLLSD怎么用?C++ LLTextureEntry::asLLSD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextureEntry
的用法示例。
在下文中一共展示了LLTextureEntry::asLLSD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPrim
void FSFloaterObjectExport::addPrim(LLViewerObject* object, bool root)
{
LLSD prim;
LLUUID object_id = object->getID();
bool default_prim = true;
struct f : public LLSelectedNodeFunctor
{
LLUUID mID;
f(const LLUUID& id) : mID(id) {}
virtual bool apply(LLSelectNode* node)
{
return (node->getObject() && node->getObject()->mID == mID);
}
} func(object_id);
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func);
default_prim = (!FSExportPermsCheck::canExportNode(node, false));
if (root)
{
if (object->isAttachment())
{
prim["attachment_point"] = ATTACHMENT_ID_FROM_STATE(object->getState());
}
}
else
{
LLViewerObject* parent_object = (LLViewerObject*)object->getParent();
prim["parent"] = parent_object->getID();
}
prim["position"] = object->getPosition().getValue();
prim["scale"] = object->getScale().getValue();
prim["rotation"] = ll_sd_from_quaternion(object->getRotation());
if (default_prim)
{
LL_DEBUGS("export") << object_id.asString() << " failed export check. Using default prim" << LL_ENDL;
prim["flags"] = ll_sd_from_U32((U32)0);
prim["volume"]["path"] = LLPathParams().asLLSD();
prim["volume"]["profile"] = LLProfileParams().asLLSD();
prim["material"] = (S32)LL_MCODE_WOOD;
}
else
{
mExported = true;
prim["flags"] = ll_sd_from_U32(object->getFlags());
prim["volume"]["path"] = object->getVolume()->getParams().getPathParams().asLLSD();
prim["volume"]["profile"] = object->getVolume()->getParams().getProfileParams().asLLSD();
prim["material"] = (S32)object->getMaterial();
if (object->getClickAction() != 0)
{
prim["clickaction"] = (S32)object->getClickAction();
}
LLVOVolume *volobjp = NULL;
if (object->getPCode() == LL_PCODE_VOLUME)
{
volobjp = (LLVOVolume *)object;
}
if(volobjp)
{
if(volobjp->isSculpted())
{
const LLSculptParams *sculpt_params = (const LLSculptParams *)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
if (sculpt_params)
{
if(volobjp->isMesh())
{
if (!mAborted)
{
mAborted = true;
}
return;
}
else
{
if (exportTexture(sculpt_params->getSculptTexture()))
{
prim["sculpt"] = sculpt_params->asLLSD();
}
else
{
LLSculptParams default_sculpt;
prim["sculpt"] = default_sculpt.asLLSD();
}
}
}
}
if(volobjp->isFlexible())
{
const LLFlexibleObjectData *flexible_param_block = (const LLFlexibleObjectData *)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
if (flexible_param_block)
{
prim["flexible"] = flexible_param_block->asLLSD();
}
}
if (volobjp->getIsLight())
//.........这里部分代码省略.........
示例2: 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)
//.........这里部分代码省略.........