本文整理汇总了C++中LLViewerObject::flagCastShadows方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::flagCastShadows方法的具体用法?C++ LLViewerObject::flagCastShadows怎么用?C++ LLViewerObject::flagCastShadows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::flagCastShadows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subserialize
LLSD JCExportTracker::subserialize(LLViewerObject* linkset)
{
//Chalice - Changed to support exporting linkset groups.
LLViewerObject* object = linkset;
//if(!linkset)return LLSD();
// Create an LLSD object that will hold the entire tree structure that can be serialized to a file
LLSD llsd;
//if (!node)
// return llsd;
//object = root_object = node->getObject();
if (!object)
return llsd;
if(!(!object->isAvatar() && object->permYouOwner() && object->permModify() && object->permCopy() && object->permTransfer() && !gAgent.getGodLevel()))
return llsd;
// Build a list of everything that we'll actually be exporting
LLDynamicArray<LLViewerObject*> export_objects;
// Add the root object to the export list
export_objects.put(object);
// Iterate over all of this objects children
LLViewerObject::child_list_t child_list = object->getChildren();
for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i)
{
LLViewerObject* child = *i;
if(!child->isAvatar())
{
// Put the child objects on the export list
export_objects.put(child);
}
}
S32 object_index = 0;
while ((object_index < export_objects.count()))
{
object = export_objects.get(object_index++);
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_index == 1)
{
LLVOAvatar* avatar = find_avatar_from_object(object);
if (avatar)
{
LLViewerJointAttachment* attachment = avatar->getTargetAttachmentPoint(object);
U8 attachment_id = 0;
if (attachment)
{
for (LLVOAvatar::attachment_map_t::iterator iter = avatar->mAttachmentPoints.begin();
iter != avatar->mAttachmentPoints.end(); ++iter)
{
if (iter->second == attachment)
{
attachment_id = iter->first;
break;
}
}
}
else
{
// interpret 0 as "default location"
attachment_id = 0;
}
prim_llsd["Attachment"] = attachment_id;
prim_llsd["attachpos"] = object->getPosition().getValue();
prim_llsd["attachrot"] = ll_sd_from_quaternion(object->getRotation());
}
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())
//.........这里部分代码省略.........
示例2: primsToLLSD
LLSD LLObjectBackup::primsToLLSD(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;
}
// Name and description
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->findNode(object);
if (node)
{
prim_llsd["name"] = node->mName;
prim_llsd["description"] = node->mDescription;
}
// 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();
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)
{
llinfos << "Found a sculpt texture, adding to list " << sculpt_texture << llendl;
mTexturesList.push_back(sculpt_texture);
}
}
else
{
llwarns << "Incorrect permission to export a sculpt texture." << llendl;
LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED;
}
}
// Textures
LLSD te_llsd;
LLSD this_te_llsd;
LLUUID t_id;
U8 te_count = object->getNumTEs();
for (U8 i = 0; i < te_count; i++)
{
bool alreadyseen = false;
t_id = validateTextureID(object->getTE(i)->getID());
this_te_llsd = object->getTE(i)->asLLSD();
this_te_llsd["imageid"] = t_id;
te_llsd.append(this_te_llsd);
//.........这里部分代码省略.........