Compare commits
6 Commits
sv-1.8.7.8
...
sv-1.8.7.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a02693e4dd | ||
|
|
24118e8e67 | ||
|
|
19ad64cc96 | ||
|
|
e81affce51 | ||
|
|
dec0bff972 | ||
|
|
5daf4aa777 |
@@ -47,8 +47,8 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer
|
|||||||
LLVOAvatar(id, pcode, regionp),
|
LLVOAvatar(id, pcode, regionp),
|
||||||
mPlaying(false),
|
mPlaying(false),
|
||||||
mGlobalScale(1.0f),
|
mGlobalScale(1.0f),
|
||||||
|
mRootVolp(NULL),
|
||||||
mMarkedForDeath(false),
|
mMarkedForDeath(false),
|
||||||
mRootVolp(NULL),
|
|
||||||
mScaleConstraintFixup(1.0),
|
mScaleConstraintFixup(1.0),
|
||||||
mRegionChanged(false)
|
mRegionChanged(false)
|
||||||
{
|
{
|
||||||
@@ -60,6 +60,8 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer
|
|||||||
// virtual
|
// virtual
|
||||||
LLControlAvatar::~LLControlAvatar()
|
LLControlAvatar::~LLControlAvatar()
|
||||||
{
|
{
|
||||||
|
// Should already have been unlinked before destruction
|
||||||
|
llassert(!mRootVolp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
@@ -82,18 +84,12 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
|
|||||||
{
|
{
|
||||||
|
|
||||||
F32 max_legal_offset = MAX_LEGAL_OFFSET;
|
F32 max_legal_offset = MAX_LEGAL_OFFSET;
|
||||||
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalOffset"))
|
static LLCachedControl<F32> animated_object_max_legal_offset(gSavedSettings, "AnimatedObjectsMaxLegalOffset");
|
||||||
{
|
max_legal_offset = llmax(animated_object_max_legal_offset(),0.f);
|
||||||
max_legal_offset = gSavedSettings.getF32("AnimatedObjectsMaxLegalOffset");
|
|
||||||
}
|
|
||||||
max_legal_offset = llmax(max_legal_offset,0.f);
|
|
||||||
|
|
||||||
F32 max_legal_size = MAX_LEGAL_SIZE;
|
F32 max_legal_size = MAX_LEGAL_SIZE;
|
||||||
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalSize"))
|
static LLCachedControl<F32> animated_object_max_legal_size(gSavedSettings, "AnimatedObjectsMaxLegalSize");
|
||||||
{
|
max_legal_size = llmax(animated_object_max_legal_size(), 1.f);
|
||||||
max_legal_size = gSavedSettings.getF32("AnimatedObjectsMaxLegalSize");
|
|
||||||
}
|
|
||||||
max_legal_size = llmax(max_legal_size, 1.f);
|
|
||||||
|
|
||||||
new_pos_fixup = LLVector3();
|
new_pos_fixup = LLVector3();
|
||||||
new_scale_fixup = 1.0f;
|
new_scale_fixup = 1.0f;
|
||||||
@@ -113,7 +109,7 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
|
|||||||
unshift_extents[0] = extents[0] - mPositionConstraintFixup;
|
unshift_extents[0] = extents[0] - mPositionConstraintFixup;
|
||||||
unshift_extents[1] = extents[1] - mPositionConstraintFixup;
|
unshift_extents[1] = extents[1] - mPositionConstraintFixup;
|
||||||
LLVector3 box_dims = extents[1]-extents[0];
|
LLVector3 box_dims = extents[1]-extents[0];
|
||||||
//F32 box_size = llmax(box_dims[0],box_dims[1],box_dims[2]);
|
F32 box_size = llmax(box_dims[0],box_dims[1],box_dims[2]);
|
||||||
|
|
||||||
if (!mRootVolp->isAttachment())
|
if (!mRootVolp->isAttachment())
|
||||||
{
|
{
|
||||||
@@ -124,23 +120,23 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
|
|||||||
F32 target_dist = (offset_dist - max_legal_offset);
|
F32 target_dist = (offset_dist - max_legal_offset);
|
||||||
new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;
|
new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;
|
||||||
}
|
}
|
||||||
if (new_pos_fixup != mPositionConstraintFixup)
|
//if (new_pos_fixup != mPositionConstraintFixup)
|
||||||
{
|
//{
|
||||||
LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
|
// LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
|
||||||
<< new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
|
// << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
|
||||||
LL_DEBUGS("ConstraintFix") << "vol_pos " << vol_pos << LL_ENDL;
|
// LL_DEBUGS("ConstraintFix") << "vol_pos " << vol_pos << LL_ENDL;
|
||||||
LL_DEBUGS("ConstraintFix") << "extents " << extents[0] << " " << extents[1] << LL_ENDL;
|
// LL_DEBUGS("ConstraintFix") << "extents " << extents[0] << " " << extents[1] << LL_ENDL;
|
||||||
LL_DEBUGS("ConstraintFix") << "unshift_extents " << unshift_extents[0] << " " << unshift_extents[1] << LL_ENDL;
|
// LL_DEBUGS("ConstraintFix") << "unshift_extents " << unshift_extents[0] << " " << unshift_extents[1] << LL_ENDL;
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
/*if (box_size/mScaleConstraintFixup > max_legal_size)
|
if (box_size/mScaleConstraintFixup > max_legal_size)
|
||||||
{
|
{
|
||||||
new_scale_fixup = mScaleConstraintFixup*max_legal_size/box_size;
|
new_scale_fixup = mScaleConstraintFixup*max_legal_size/box_size;
|
||||||
LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, box_size " << box_size << " fixup "
|
//LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, box_size " << box_size << " fixup "
|
||||||
<< mScaleConstraintFixup << " max legal " << max_legal_size
|
// << mScaleConstraintFixup << " max legal " << max_legal_size
|
||||||
<< " -> new scale " << new_scale_fixup << LL_ENDL;
|
// << " -> new scale " << new_scale_fixup << LL_ENDL;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,6 +159,8 @@ void LLControlAvatar::matchVolumeTransform()
|
|||||||
mPositionConstraintFixup = new_pos_fixup;
|
mPositionConstraintFixup = new_pos_fixup;
|
||||||
mScaleConstraintFixup = new_scale_fixup;
|
mScaleConstraintFixup = new_scale_fixup;
|
||||||
|
|
||||||
|
static LLCachedControl<F32> global_scale(gSavedSettings, "AnimatedObjectsGlobalScale", 1.f);
|
||||||
|
|
||||||
if (mRootVolp->isAttachment())
|
if (mRootVolp->isAttachment())
|
||||||
{
|
{
|
||||||
LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
|
LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
|
||||||
@@ -174,13 +172,12 @@ void LLControlAvatar::matchVolumeTransform()
|
|||||||
LLVector3 joint_pos = attach->getWorldPosition();
|
LLVector3 joint_pos = attach->getWorldPosition();
|
||||||
LLQuaternion joint_rot = attach->getWorldRotation();
|
LLQuaternion joint_rot = attach->getWorldRotation();
|
||||||
LLVector3 obj_pos = mRootVolp->mDrawable->getPosition();
|
LLVector3 obj_pos = mRootVolp->mDrawable->getPosition();
|
||||||
LLQuaternion obj_rot = mRootVolp->mDrawable->getRotation();
|
const LLQuaternion& obj_rot = mRootVolp->mDrawable->getRotation();
|
||||||
obj_pos.rotVec(joint_rot);
|
obj_pos.rotVec(joint_rot);
|
||||||
mRoot->setWorldPosition(obj_pos + joint_pos);
|
mRoot->setWorldPosition(obj_pos + joint_pos);
|
||||||
mRoot->setWorldRotation(obj_rot * joint_rot);
|
mRoot->setWorldRotation(obj_rot * joint_rot);
|
||||||
setRotation(mRoot->getRotation());
|
setRotation(mRoot->getRotation());
|
||||||
|
|
||||||
F32 global_scale = gSavedSettings.getF32("AnimatedObjectsGlobalScale");
|
|
||||||
setGlobalScale(global_scale * mScaleConstraintFixup);
|
setGlobalScale(global_scale * mScaleConstraintFixup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -200,17 +197,7 @@ void LLControlAvatar::matchVolumeTransform()
|
|||||||
// complexity info and such line up better. Should defer
|
// complexity info and such line up better. Should defer
|
||||||
// this until avatars also get fixed.
|
// this until avatars also get fixed.
|
||||||
|
|
||||||
LLQuaternion obj_rot;
|
const LLQuaternion& obj_rot = mRootVolp->mDrawable ? mRootVolp->mDrawable->getRotation() : mRootVolp->getRotation();
|
||||||
if (mRootVolp->mDrawable)
|
|
||||||
{
|
|
||||||
obj_rot = mRootVolp->mDrawable->getRotation();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
obj_rot = mRootVolp->getRotation();
|
|
||||||
}
|
|
||||||
|
|
||||||
LLMatrix3 bind_mat;
|
|
||||||
|
|
||||||
LLQuaternion bind_rot;
|
LLQuaternion bind_rot;
|
||||||
#define MATCH_BIND_SHAPE
|
#define MATCH_BIND_SHAPE
|
||||||
@@ -219,7 +206,7 @@ void LLControlAvatar::matchVolumeTransform()
|
|||||||
const LLMeshSkinInfo* skin_info = mRootVolp->getSkinInfo();
|
const LLMeshSkinInfo* skin_info = mRootVolp->getSkinInfo();
|
||||||
if (skin_info)
|
if (skin_info)
|
||||||
{
|
{
|
||||||
LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL;
|
//LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL;
|
||||||
bind_rot = LLSkinningUtil::getUnscaledQuaternion(skin_info->mBindShapeMatrix);
|
bind_rot = LLSkinningUtil::getUnscaledQuaternion(skin_info->mBindShapeMatrix);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -228,7 +215,6 @@ void LLControlAvatar::matchVolumeTransform()
|
|||||||
setPositionAgent(vol_pos);
|
setPositionAgent(vol_pos);
|
||||||
mRoot->setPosition(vol_pos + mPositionConstraintFixup);
|
mRoot->setPosition(vol_pos + mPositionConstraintFixup);
|
||||||
|
|
||||||
F32 global_scale = gSavedSettings.getF32("AnimatedObjectsGlobalScale");
|
|
||||||
setGlobalScale(global_scale * mScaleConstraintFixup);
|
setGlobalScale(global_scale * mScaleConstraintFixup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -236,7 +222,7 @@ void LLControlAvatar::matchVolumeTransform()
|
|||||||
|
|
||||||
void LLControlAvatar::setGlobalScale(F32 scale)
|
void LLControlAvatar::setGlobalScale(F32 scale)
|
||||||
{
|
{
|
||||||
if (scale <= 0.0)
|
if (scale <= 0.0f)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "invalid global scale " << scale << LL_ENDL;
|
LL_WARNS() << "invalid global scale " << scale << LL_ENDL;
|
||||||
return;
|
return;
|
||||||
@@ -255,10 +241,8 @@ void LLControlAvatar::recursiveScaleJoint(LLJoint* joint, F32 factor)
|
|||||||
{
|
{
|
||||||
joint->setScale(factor * joint->getScale());
|
joint->setScale(factor * joint->getScale());
|
||||||
|
|
||||||
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
for (auto child : joint->mChildren)
|
||||||
iter != joint->mChildren.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
LLJoint* child = *iter;
|
|
||||||
recursiveScaleJoint(child, factor);
|
recursiveScaleJoint(child, factor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,10 +262,9 @@ void LLControlAvatar::updateVolumeGeom()
|
|||||||
mRootVolp->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
|
mRootVolp->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
|
||||||
|
|
||||||
LLViewerObject::const_child_list_t& child_list = mRootVolp->getChildren();
|
LLViewerObject::const_child_list_t& child_list = mRootVolp->getChildren();
|
||||||
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
|
for (const auto& iter : child_list)
|
||||||
iter != child_list.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
LLViewerObject* childp = *iter;
|
LLViewerObject* childp = iter;
|
||||||
if (childp && childp->mDrawable.notNull())
|
if (childp && childp->mDrawable.notNull())
|
||||||
{
|
{
|
||||||
childp->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
|
childp->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
|
||||||
@@ -339,6 +322,7 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj)
|
|||||||
void LLControlAvatar::markForDeath()
|
void LLControlAvatar::markForDeath()
|
||||||
{
|
{
|
||||||
mMarkedForDeath = true;
|
mMarkedForDeath = true;
|
||||||
|
mRootVolp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLControlAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
void LLControlAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
||||||
@@ -362,7 +346,8 @@ BOOL LLControlAvatar::updateCharacter(LLAgent &agent)
|
|||||||
//virtual
|
//virtual
|
||||||
void LLControlAvatar::updateDebugText()
|
void LLControlAvatar::updateDebugText()
|
||||||
{
|
{
|
||||||
/*if (gSavedSettings.getBOOL("DebugAnimatedObjects"))
|
/*static LLCachedControl<bool> debug_animated_objects(gSavedSettings, "DebugAnimatedObjects");
|
||||||
|
if (debug_animated_objects)
|
||||||
{
|
{
|
||||||
S32 total_linkset_count = 0;
|
S32 total_linkset_count = 0;
|
||||||
if (mRootVolp)
|
if (mRootVolp)
|
||||||
@@ -385,10 +370,8 @@ void LLControlAvatar::updateDebugText()
|
|||||||
S32 cam_dist_count = 0;
|
S32 cam_dist_count = 0;
|
||||||
F32 lod_radius = mRootVolp->mLODRadius;
|
F32 lod_radius = mRootVolp->mLODRadius;
|
||||||
|
|
||||||
for (std::vector<LLVOVolume*>::iterator it = volumes.begin();
|
for (auto volp : volumes)
|
||||||
it != volumes.end(); ++it)
|
|
||||||
{
|
{
|
||||||
LLVOVolume *volp = *it;
|
|
||||||
S32 verts = 0;
|
S32 verts = 0;
|
||||||
total_tris += volp->getTriangleCount(&verts);
|
total_tris += volp->getTriangleCount(&verts);
|
||||||
total_verts += verts;
|
total_verts += verts;
|
||||||
@@ -491,11 +474,10 @@ void LLControlAvatar::getAnimatedVolumes(std::vector<LLVOVolume*>& volumes)
|
|||||||
volumes.push_back(mRootVolp);
|
volumes.push_back(mRootVolp);
|
||||||
|
|
||||||
LLViewerObject::const_child_list_t& child_list = mRootVolp->getChildren();
|
LLViewerObject::const_child_list_t& child_list = mRootVolp->getChildren();
|
||||||
for (LLViewerObject::const_child_list_t::const_iterator iter = child_list.begin();
|
for (const auto& iter : child_list)
|
||||||
iter != child_list.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
LLViewerObject* childp = *iter;
|
LLViewerObject* childp = iter;
|
||||||
LLVOVolume *child_volp = dynamic_cast<LLVOVolume*>(childp);
|
LLVOVolume *child_volp = childp ? childp->asVolume() : nullptr;
|
||||||
if (child_volp && child_volp->isAnimatedObject())
|
if (child_volp && child_volp->isAnimatedObject())
|
||||||
{
|
{
|
||||||
volumes.push_back(child_volp);
|
volumes.push_back(child_volp);
|
||||||
@@ -519,16 +501,16 @@ void LLControlAvatar::updateAnimations()
|
|||||||
|
|
||||||
// Rebuild mSignaledAnimations from the associated volumes.
|
// Rebuild mSignaledAnimations from the associated volumes.
|
||||||
std::map<LLUUID, S32> anims;
|
std::map<LLUUID, S32> anims;
|
||||||
for (std::vector<LLVOVolume*>::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it)
|
for (auto vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it)
|
||||||
{
|
{
|
||||||
LLVOVolume *volp = *vol_it;
|
LLVOVolume *volp = *vol_it;
|
||||||
//LL_INFOS("AnimatedObjects") << "updating anim for vol " << volp->getID() << " root " << mRootVolp->getID() << LL_ENDL;
|
//LL_INFOS("AnimatedObjects") << "updating anim for vol " << volp->getID() << " root " << mRootVolp->getID() << LL_ENDL;
|
||||||
signaled_animation_map_t& signaled_animations = LLObjectSignaledAnimationMap::instance().getMap()[volp->getID()];
|
signaled_animation_map_t& signaled_animations = LLObjectSignaledAnimationMap::instance().getMap()[volp->getID()];
|
||||||
for (std::map<LLUUID,S32>::iterator anim_it = signaled_animations.begin();
|
for (auto anim_it = signaled_animations.begin();
|
||||||
anim_it != signaled_animations.end();
|
anim_it != signaled_animations.end();
|
||||||
++anim_it)
|
++anim_it)
|
||||||
{
|
{
|
||||||
std::map<LLUUID,S32>::iterator found_anim_it = anims.find(anim_it->first);
|
auto found_anim_it = anims.find(anim_it->first);
|
||||||
if (found_anim_it != anims.end())
|
if (found_anim_it != anims.end())
|
||||||
{
|
{
|
||||||
// Animation already present, use the larger sequence id
|
// Animation already present, use the larger sequence id
|
||||||
@@ -539,7 +521,9 @@ void LLControlAvatar::updateAnimations()
|
|||||||
// Animation not already present, use this sequence id.
|
// Animation not already present, use this sequence id.
|
||||||
anims[anim_it->first] = anim_it->second;
|
anims[anim_it->first] = anim_it->second;
|
||||||
}
|
}
|
||||||
|
#if LL_DEBUG
|
||||||
LL_DEBUGS("AnimatedObjectsNotify") << "found anim for vol " << volp->getID() << " anim " << anim_it->first << " root " << mRootVolp->getID() << LL_ENDL;
|
LL_DEBUGS("AnimatedObjectsNotify") << "found anim for vol " << volp->getID() << " anim " << anim_it->first << " root " << mRootVolp->getID() << LL_ENDL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!mPlaying)
|
if (!mPlaying)
|
||||||
@@ -567,24 +551,45 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV
|
|||||||
LLVector4a* normal,
|
LLVector4a* normal,
|
||||||
LLVector4a* tangent)
|
LLVector4a* tangent)
|
||||||
{
|
{
|
||||||
|
if (!mRootVolp)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
LLViewerObject* hit = NULL;
|
LLViewerObject* hit = NULL;
|
||||||
|
|
||||||
if (lineSegmentBoundingBox(start, end))
|
if (lineSegmentBoundingBox(start, end))
|
||||||
{
|
{
|
||||||
LLVector4a local_end = end;
|
LLVector4a local_end = end;
|
||||||
LLVector4a local_intersection;
|
LLVector4a local_intersection;
|
||||||
|
if (mRootVolp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent))
|
||||||
if (mRootVolp &&
|
|
||||||
mRootVolp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent))
|
|
||||||
{
|
{
|
||||||
local_end = local_intersection;
|
local_end = local_intersection;
|
||||||
if (intersection)
|
if (intersection)
|
||||||
{
|
{
|
||||||
*intersection = local_intersection;
|
*intersection = local_intersection;
|
||||||
}
|
}
|
||||||
|
|
||||||
hit = mRootVolp;
|
hit = mRootVolp;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::vector<LLVOVolume*> volumes;
|
||||||
|
getAnimatedVolumes(volumes);
|
||||||
|
|
||||||
|
for (auto volp : volumes)
|
||||||
|
{
|
||||||
|
if (mRootVolp != volp && volp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent))
|
||||||
|
{
|
||||||
|
local_end = local_intersection;
|
||||||
|
if (intersection)
|
||||||
|
{
|
||||||
|
*intersection = local_intersection;
|
||||||
|
}
|
||||||
|
hit = volp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hit;
|
return hit;
|
||||||
@@ -618,7 +623,7 @@ bool LLControlAvatar::shouldRenderRigged() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
BOOL LLControlAvatar::isImpostor()
|
BOOL LLControlAvatar::isImpostor() const
|
||||||
{
|
{
|
||||||
if (mRootVolp && mRootVolp->isAttachment())
|
if (mRootVolp && mRootVolp->isAttachment())
|
||||||
{
|
{
|
||||||
@@ -638,8 +643,11 @@ void LLControlAvatar::onRegionChanged()
|
|||||||
std::vector<LLCharacter*>::iterator it = LLCharacter::sInstances.begin();
|
std::vector<LLCharacter*>::iterator it = LLCharacter::sInstances.begin();
|
||||||
for ( ; it != LLCharacter::sInstances.end(); ++it)
|
for ( ; it != LLCharacter::sInstances.end(); ++it)
|
||||||
{
|
{
|
||||||
LLControlAvatar* cav = dynamic_cast<LLControlAvatar*>(*it);
|
auto avatar = static_cast<LLVOAvatar*>(*it);
|
||||||
if (!cav) continue;
|
if (!avatar->isDead() && avatar->isControlAvatar())
|
||||||
cav->mRegionChanged = true;
|
{
|
||||||
|
LLControlAvatar* cav = static_cast<LLControlAvatar*>(avatar);
|
||||||
|
cav->mRegionChanged = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,16 +30,16 @@
|
|||||||
#include "llvoavatar.h"
|
#include "llvoavatar.h"
|
||||||
#include "llvovolume.h"
|
#include "llvovolume.h"
|
||||||
|
|
||||||
class LLControlAvatar:
|
class LLControlAvatar final:
|
||||||
public LLVOAvatar
|
public LLVOAvatar
|
||||||
{
|
{
|
||||||
LOG_CLASS(LLControlAvatar);
|
LOG_CLASS(LLControlAvatar);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LLControlAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
|
LLControlAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
|
||||||
virtual void initInstance(); // Called after construction to initialize the class.
|
void initInstance() override; // Called after construction to initialize the class.
|
||||||
virtual ~LLControlAvatar();
|
virtual ~LLControlAvatar();
|
||||||
virtual LLControlAvatar* asControlAvatar() { return this; }
|
LLControlAvatar* asControlAvatar() override { return this; }
|
||||||
|
|
||||||
void getNewConstraintFixups(LLVector3& new_pos_constraint, F32& new_scale_constraint) const;
|
void getNewConstraintFixups(LLVector3& new_pos_constraint, F32& new_scale_constraint) const;
|
||||||
void matchVolumeTransform();
|
void matchVolumeTransform();
|
||||||
@@ -53,13 +53,13 @@ public:
|
|||||||
// markDead() inside other graphics pipeline operations.
|
// markDead() inside other graphics pipeline operations.
|
||||||
void markForDeath();
|
void markForDeath();
|
||||||
|
|
||||||
virtual void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
|
void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) override;
|
||||||
virtual BOOL updateCharacter(LLAgent &agent);
|
BOOL updateCharacter(LLAgent &agent) override;
|
||||||
|
|
||||||
void getAnimatedVolumes(std::vector<LLVOVolume*>& volumes);
|
void getAnimatedVolumes(std::vector<LLVOVolume*>& volumes);
|
||||||
void updateAnimations();
|
void updateAnimations();
|
||||||
|
|
||||||
virtual LLViewerObject* lineSegmentIntersectRiggedAttachments(
|
LLViewerObject* lineSegmentIntersectRiggedAttachments(
|
||||||
const LLVector4a& start, const LLVector4a& end,
|
const LLVector4a& start, const LLVector4a& end,
|
||||||
S32 face = -1, // which face to check, -1 = ALL_SIDES
|
S32 face = -1, // which face to check, -1 = ALL_SIDES
|
||||||
BOOL pick_transparent = FALSE,
|
BOOL pick_transparent = FALSE,
|
||||||
@@ -68,15 +68,15 @@ public:
|
|||||||
LLVector4a* intersection = NULL, // return the intersection point
|
LLVector4a* intersection = NULL, // return the intersection point
|
||||||
LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point
|
LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point
|
||||||
LLVector4a* normal = NULL, // return the surface normal at the intersection point
|
LLVector4a* normal = NULL, // return the surface normal at the intersection point
|
||||||
LLVector4a* tangent = NULL); // return the surface tangent at the intersection point
|
LLVector4a* tangent = NULL) override; // return the surface tangent at the intersection point
|
||||||
|
|
||||||
virtual void updateDebugText();
|
void updateDebugText() override;
|
||||||
|
|
||||||
virtual std::string getFullname() const;
|
std::string getFullname() const override;
|
||||||
|
|
||||||
virtual bool shouldRenderRigged() const;
|
bool shouldRenderRigged() const override;
|
||||||
|
|
||||||
virtual BOOL isImpostor();
|
BOOL isImpostor() const override;
|
||||||
|
|
||||||
bool mPlaying;
|
bool mPlaying;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ typedef std::map<LLUUID, S32> signaled_animation_map_t;
|
|||||||
typedef std::map<LLUUID, signaled_animation_map_t> object_signaled_animation_map_t;
|
typedef std::map<LLUUID, signaled_animation_map_t> object_signaled_animation_map_t;
|
||||||
|
|
||||||
// Stores information about previously requested animations, by object id.
|
// Stores information about previously requested animations, by object id.
|
||||||
class LLObjectSignaledAnimationMap: public LLSingleton<LLObjectSignaledAnimationMap>
|
class LLObjectSignaledAnimationMap final : public LLSingleton<LLObjectSignaledAnimationMap>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLObjectSignaledAnimationMap() {}
|
LLObjectSignaledAnimationMap() {}
|
||||||
|
|||||||
@@ -1383,8 +1383,8 @@ void LLFloaterTools::getMediaState()
|
|||||||
for ( ; iter != end; ++iter)
|
for ( ; iter != end; ++iter)
|
||||||
{
|
{
|
||||||
LLSelectNode* node = *iter;
|
LLSelectNode* node = *iter;
|
||||||
LLVOVolume* object = dynamic_cast<LLVOVolume*>(node->getObject());
|
LLVOVolume* object = node ? node->getObject()->asVolume() : nullptr;
|
||||||
if (NULL != object)
|
if (nullptr != object)
|
||||||
{
|
{
|
||||||
if (!object->permModify())
|
if (!object->permModify())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -266,8 +266,8 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
|
|||||||
location_combo->setFocusLostCallback( boost::bind(&LLPanelLogin::onLocationSLURL, this) );
|
location_combo->setFocusLostCallback( boost::bind(&LLPanelLogin::onLocationSLURL, this) );
|
||||||
|
|
||||||
LLComboBox* server_choice_combo = getChild<LLComboBox>("grids_combo");
|
LLComboBox* server_choice_combo = getChild<LLComboBox>("grids_combo");
|
||||||
server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectGrid, _1));
|
server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectGrid, this, _1));
|
||||||
server_choice_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onSelectGrid, server_choice_combo));
|
server_choice_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onSelectGrid, this, server_choice_combo));
|
||||||
|
|
||||||
// Load all of the grids, sorted, and then add a bar and the current grid at the top
|
// Load all of the grids, sorted, and then add a bar and the current grid at the top
|
||||||
updateGridCombo();
|
updateGridCombo();
|
||||||
@@ -1111,7 +1111,7 @@ void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl)
|
|||||||
}
|
}
|
||||||
gHippoGridManager->setCurrentGrid(grid);
|
gHippoGridManager->setCurrentGrid(grid);
|
||||||
ctrl->setValue(grid);
|
ctrl->setValue(grid);
|
||||||
sInstance->addFavoritesToStartLocation();
|
addFavoritesToStartLocation();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine whether or not the value in the start_location_combo makes sense
|
* Determine whether or not the value in the start_location_combo makes sense
|
||||||
@@ -1123,7 +1123,7 @@ void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl)
|
|||||||
* https://grid.example.com/region/Party%20Town/20/30/5 specify a particular
|
* https://grid.example.com/region/Party%20Town/20/30/5 specify a particular
|
||||||
* grid; in those cases we want to clear the location.
|
* grid; in those cases we want to clear the location.
|
||||||
*/
|
*/
|
||||||
auto location_combo = sInstance->getChild<LLComboBox>("start_location_combo");
|
auto location_combo = getChild<LLComboBox>("start_location_combo");
|
||||||
S32 index = location_combo->getCurrentIndex();
|
S32 index = location_combo->getCurrentIndex();
|
||||||
switch (index)
|
switch (index)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ private:
|
|||||||
static void onClickNewAccount();
|
static void onClickNewAccount();
|
||||||
static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
|
static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
|
||||||
static void onClickGrids();
|
static void onClickGrids();
|
||||||
static void onSelectGrid(LLUICtrl *ctrl);
|
void onSelectGrid(LLUICtrl *ctrl);
|
||||||
static void onClickForgotPassword();
|
static void onClickForgotPassword();
|
||||||
static void onPassKey();
|
static void onPassKey();
|
||||||
static void onSelectLoginEntry(const LLSD& selected_entry);
|
static void onSelectLoginEntry(const LLSD& selected_entry);
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ void LLPanelPrimMediaControls::updateShape()
|
|||||||
{
|
{
|
||||||
bool mini_controls = false;
|
bool mini_controls = false;
|
||||||
LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData();
|
LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData();
|
||||||
LLVOVolume *vol = dynamic_cast<LLVOVolume*>(objectp);
|
LLVOVolume *vol = objectp ? objectp->asVolume() : nullptr;
|
||||||
if (media_data && vol)
|
if (media_data && vol)
|
||||||
{
|
{
|
||||||
// Don't show the media controls if we do not have permissions
|
// Don't show the media controls if we do not have permissions
|
||||||
|
|||||||
@@ -1998,7 +1998,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
|
|||||||
else {
|
else {
|
||||||
// Add/update media
|
// Add/update media
|
||||||
object->setTEMediaFlags(te, mMediaFlags);
|
object->setTEMediaFlags(te, mMediaFlags);
|
||||||
LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object);
|
LLVOVolume *vo = object->asVolume();
|
||||||
llassert(NULL != vo);
|
llassert(NULL != vo);
|
||||||
if (NULL != vo)
|
if (NULL != vo)
|
||||||
{
|
{
|
||||||
@@ -2024,7 +2024,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
|
|||||||
if (object->permModify())
|
if (object->permModify())
|
||||||
{
|
{
|
||||||
object->sendTEUpdate();
|
object->sendTEUpdate();
|
||||||
LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object);
|
LLVOVolume *vo = object->asVolume();
|
||||||
llassert(NULL != vo);
|
llassert(NULL != vo);
|
||||||
// It's okay to skip this object if hasMedia() is false...
|
// It's okay to skip this object if hasMedia() is false...
|
||||||
// the sendTEUpdate() above would remove all media data if it were
|
// the sendTEUpdate() above would remove all media data if it were
|
||||||
@@ -7434,7 +7434,7 @@ S32 LLObjectSelection::getSelectedObjectRenderCost()
|
|||||||
++child_iter)
|
++child_iter)
|
||||||
{
|
{
|
||||||
LLViewerObject* child_obj = *child_iter;
|
LLViewerObject* child_obj = *child_iter;
|
||||||
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
|
LLVOVolume *child = child_obj ? child_obj->asVolume() : nullptr;
|
||||||
if (child)
|
if (child)
|
||||||
{
|
{
|
||||||
cost += child->getRenderCost(textures);
|
cost += child->getRenderCost(textures);
|
||||||
|
|||||||
@@ -1787,7 +1787,7 @@ void renderComplexityDisplay(LLDrawable* drawablep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVOVolume *voVol = dynamic_cast<LLVOVolume*>(vobj);
|
LLVOVolume *voVol = vobj->asVolume();;
|
||||||
|
|
||||||
if (!voVol)
|
if (!voVol)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5953,7 +5953,7 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVOVolume *volp = dynamic_cast<LLVOVolume*>(objp);
|
LLVOVolume *volp = objp->asVolume();
|
||||||
if (!volp)
|
if (!volp)
|
||||||
{
|
{
|
||||||
LL_DEBUGS("AnimatedObjectsNotify") << "Received animation state for non-volume object " << uuid << LL_ENDL;
|
LL_DEBUGS("AnimatedObjectsNotify") << "Received animation state for non-volume object " << uuid << LL_ENDL;
|
||||||
|
|||||||
@@ -1620,7 +1620,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||||||
retval |= checkMediaURL(media_url);
|
retval |= checkMediaURL(media_url);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Unpack particle system data
|
// Unpack particle system data (legacy)
|
||||||
//
|
//
|
||||||
if (value & 0x8)
|
if (value & 0x8)
|
||||||
{
|
{
|
||||||
@@ -2188,23 +2188,22 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||||||
mStatic = FALSE;
|
mStatic = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BUG: This code leads to problems during group rotate and any scale operation.
|
// BUG: This code leads to problems during group rotate and any scale operation.
|
||||||
// Small discepencies between the simulator and viewer representations cause the
|
// Small discepencies between the simulator and viewer representations cause the
|
||||||
// selection center to creep, leading to objects moving around the wrong center.
|
// selection center to creep, leading to objects moving around the wrong center.
|
||||||
//
|
//
|
||||||
// Removing this, however, means that if someone else drags an object you have
|
// Removing this, however, means that if someone else drags an object you have
|
||||||
// selected, your selection center and dialog boxes will be wrong. It also means
|
// selected, your selection center and dialog boxes will be wrong. It also means
|
||||||
// that higher precision information on selected objects will be ignored.
|
// that higher precision information on selected objects will be ignored.
|
||||||
//
|
//
|
||||||
// I believe the group rotation problem is fixed. JNC 1.21.2002
|
// I believe the group rotation problem is fixed. JNC 1.21.2002
|
||||||
//
|
//
|
||||||
// Additionally, if any child is selected, need to update the dialogs and selection
|
// Additionally, if any child is selected, need to update the dialogs and selection
|
||||||
// center.
|
// center.
|
||||||
BOOL needs_refresh = mUserSelected;
|
BOOL needs_refresh = mUserSelected;
|
||||||
for (child_list_t::iterator iter = mChildList.begin();
|
for (auto& iter : mChildList)
|
||||||
iter != mChildList.end(); iter++)
|
|
||||||
{
|
{
|
||||||
LLViewerObject* child = *iter;
|
LLViewerObject* child = iter;
|
||||||
needs_refresh = needs_refresh || child->mUserSelected;
|
needs_refresh = needs_refresh || child->mUserSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2952,10 +2951,9 @@ void LLViewerObject::updateControlAvatar()
|
|||||||
{
|
{
|
||||||
bool any_rigged_mesh = root->isRiggedMesh();
|
bool any_rigged_mesh = root->isRiggedMesh();
|
||||||
LLViewerObject::const_child_list_t& child_list = root->getChildren();
|
LLViewerObject::const_child_list_t& child_list = root->getChildren();
|
||||||
for (LLViewerObject::const_child_list_t::const_iterator iter = child_list.begin();
|
for (const auto& iter : child_list)
|
||||||
iter != child_list.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
const LLViewerObject* child = *iter;
|
const LLViewerObject* child = iter;
|
||||||
any_rigged_mesh = any_rigged_mesh || child->isRiggedMesh();
|
any_rigged_mesh = any_rigged_mesh || child->isRiggedMesh();
|
||||||
}
|
}
|
||||||
should_have_control_avatar = is_animated_object && any_rigged_mesh;
|
should_have_control_avatar = is_animated_object && any_rigged_mesh;
|
||||||
@@ -3093,7 +3091,7 @@ void LLViewerObject::linkControlAvatar()
|
|||||||
{
|
{
|
||||||
if (!getControlAvatar() && isRootEdit())
|
if (!getControlAvatar() && isRootEdit())
|
||||||
{
|
{
|
||||||
LLVOVolume *volp = dynamic_cast<LLVOVolume*>(this);
|
LLVOVolume *volp = asVolume();
|
||||||
if (!volp)
|
if (!volp)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "called with null or non-volume object" << LL_ENDL;
|
LL_WARNS() << "called with null or non-volume object" << LL_ENDL;
|
||||||
@@ -3136,6 +3134,7 @@ void LLViewerObject::unlinkControlAvatar()
|
|||||||
if (mControlAvatar)
|
if (mControlAvatar)
|
||||||
{
|
{
|
||||||
mControlAvatar->markForDeath();
|
mControlAvatar->markForDeath();
|
||||||
|
mControlAvatar->mRootVolp = NULL;
|
||||||
mControlAvatar = NULL;
|
mControlAvatar = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3269,7 +3268,7 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
|
|||||||
LLInventoryObject::object_list_t::iterator end = object->mInventory->end();
|
LLInventoryObject::object_list_t::iterator end = object->mInventory->end();
|
||||||
std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs;
|
std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs;
|
||||||
|
|
||||||
for (; it != end && pending_lst.size(); ++it)
|
for (; it != end && !pending_lst.empty(); ++it)
|
||||||
{
|
{
|
||||||
LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get());
|
LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get());
|
||||||
if(item && item->getType() != LLAssetType::AT_CATEGORY)
|
if(item && item->getType() != LLAssetType::AT_CATEGORY)
|
||||||
@@ -3292,7 +3291,7 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This Occurs When to requests were made, and the first one
|
// This Occurs When two requests were made, and the first one
|
||||||
// has already handled it.
|
// has already handled it.
|
||||||
LL_DEBUGS() << "Problem loading task inventory. Return code: "
|
LL_DEBUGS() << "Problem loading task inventory. Return code: "
|
||||||
<< error_code << LL_ENDL;
|
<< error_code << LL_ENDL;
|
||||||
@@ -3412,11 +3411,6 @@ void LLViewerObject::removeInventory(const LLUUID& item_id)
|
|||||||
msg->sendReliable(mRegionp->getHost());
|
msg->sendReliable(mRegionp->getHost());
|
||||||
deleteInventoryItem(item_id);
|
deleteInventoryItem(item_id);
|
||||||
++mInventorySerialNum;
|
++mInventorySerialNum;
|
||||||
|
|
||||||
// The viewer object should not refresh UI since this is a utility
|
|
||||||
// function. The UI functionality that called this method should
|
|
||||||
// refresh the views if necessary.
|
|
||||||
//gBuildView->refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLViewerObject::isTextureInInventory(LLViewerInventoryItem* item)
|
bool LLViewerObject::isTextureInInventory(LLViewerInventoryItem* item)
|
||||||
@@ -3531,7 +3525,7 @@ void LLViewerObject::getInventoryContents(LLInventoryObject::object_list_t& obje
|
|||||||
|
|
||||||
LLInventoryObject* LLViewerObject::getInventoryRoot()
|
LLInventoryObject* LLViewerObject::getInventoryRoot()
|
||||||
{
|
{
|
||||||
if (!mInventory || !mInventory->size())
|
if (!mInventory || mInventory->empty())
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -3587,8 +3581,8 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVector3 viewer_pos_agent = gAgentCamera.getCameraPositionAgent();
|
const LLVector3& viewer_pos_agent = gAgentCamera.getCameraPositionAgent();
|
||||||
LLVector3 pos_agent = getRenderPosition();
|
const LLVector3& pos_agent = getRenderPosition();
|
||||||
|
|
||||||
F32 dx = viewer_pos_agent.mV[VX] - pos_agent.mV[VX];
|
F32 dx = viewer_pos_agent.mV[VX] - pos_agent.mV[VX];
|
||||||
F32 dy = viewer_pos_agent.mV[VY] - pos_agent.mV[VY];
|
F32 dy = viewer_pos_agent.mV[VY] - pos_agent.mV[VY];
|
||||||
@@ -3602,7 +3596,7 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent)
|
|||||||
// to try to get a min distance from face, subtract min_scale/2 from the range.
|
// to try to get a min distance from face, subtract min_scale/2 from the range.
|
||||||
// This means we'll load too much detail sometimes, but that's better than not enough
|
// This means we'll load too much detail sometimes, but that's better than not enough
|
||||||
// I don't think there's a better way to do this without calculating distance per-poly
|
// I don't think there's a better way to do this without calculating distance per-poly
|
||||||
F32 range = sqrt(dx*dx + dy*dy + dz*dz) - min_scale/2;
|
F32 range = sqrt(dx*dx + dy*dy + dz*dz) - min_scale/2.f;
|
||||||
|
|
||||||
LLViewerCamera* camera = LLViewerCamera::getInstance();
|
LLViewerCamera* camera = LLViewerCamera::getInstance();
|
||||||
if (range < 0.001f || isHUDAttachment()) // range == zero
|
if (range < 0.001f || isHUDAttachment()) // range == zero
|
||||||
@@ -3781,10 +3775,9 @@ F32 LLViewerObject::getLinksetPhysicsCost()
|
|||||||
F32 LLViewerObject::recursiveGetEstTrianglesMax() const
|
F32 LLViewerObject::recursiveGetEstTrianglesMax() const
|
||||||
{
|
{
|
||||||
F32 est_tris = getEstTrianglesMax();
|
F32 est_tris = getEstTrianglesMax();
|
||||||
for (child_list_t::const_iterator iter = mChildList.begin();
|
for (const auto& iter : mChildList)
|
||||||
iter != mChildList.end(); iter++)
|
|
||||||
{
|
{
|
||||||
const LLViewerObject* child = *iter;
|
const LLViewerObject* child = iter;
|
||||||
if (!child->isAvatar())
|
if (!child->isAvatar())
|
||||||
{
|
{
|
||||||
est_tris += child->recursiveGetEstTrianglesMax();
|
est_tris += child->recursiveGetEstTrianglesMax();
|
||||||
@@ -3852,10 +3845,9 @@ U32 LLViewerObject::recursiveGetTriangleCount(S32* vcount) const
|
|||||||
{
|
{
|
||||||
S32 total_tris = getTriangleCount(vcount);
|
S32 total_tris = getTriangleCount(vcount);
|
||||||
LLViewerObject::const_child_list_t& child_list = getChildren();
|
LLViewerObject::const_child_list_t& child_list = getChildren();
|
||||||
for (LLViewerObject::const_child_list_t::const_iterator iter = child_list.begin();
|
for (const auto& iter : child_list)
|
||||||
iter != child_list.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
LLViewerObject* childp = *iter;
|
LLViewerObject* childp = iter;
|
||||||
if (childp)
|
if (childp)
|
||||||
{
|
{
|
||||||
total_tris += childp->getTriangleCount(vcount);
|
total_tris += childp->getTriangleCount(vcount);
|
||||||
@@ -3882,13 +3874,11 @@ F32 LLViewerObject::recursiveGetScaledSurfaceArea() const
|
|||||||
const LLVector3& scale = volume->getScale();
|
const LLVector3& scale = volume->getScale();
|
||||||
area += volume->getVolume()->getSurfaceArea() * llmax(llmax(scale.mV[0], scale.mV[1]), scale.mV[2]);
|
area += volume->getVolume()->getSurfaceArea() * llmax(llmax(scale.mV[0], scale.mV[1]), scale.mV[2]);
|
||||||
}
|
}
|
||||||
LLViewerObject::const_child_list_t children = volume->getChildren();
|
LLViewerObject::const_child_list_t const& children = volume->getChildren();
|
||||||
for (LLViewerObject::const_child_list_t::const_iterator child_iter = children.begin();
|
for (const auto& child_iter : children)
|
||||||
child_iter != children.end();
|
|
||||||
++child_iter)
|
|
||||||
{
|
{
|
||||||
LLViewerObject* child_obj = *child_iter;
|
LLViewerObject* child_obj = child_iter;
|
||||||
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
|
LLVOVolume *child = child_obj ? child_obj->asVolume() : nullptr;
|
||||||
if (child && child->getVolume())
|
if (child && child->getVolume())
|
||||||
{
|
{
|
||||||
const LLVector3& scale = child->getScale();
|
const LLVector3& scale = child->getScale();
|
||||||
@@ -3899,6 +3889,7 @@ F32 LLViewerObject::recursiveGetScaledSurfaceArea() const
|
|||||||
}
|
}
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
|
void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
|
||||||
{
|
{
|
||||||
if(mDrawable.isNull())
|
if(mDrawable.isNull())
|
||||||
@@ -5592,6 +5583,12 @@ LLVOAvatar* LLViewerObject::asAvatar()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// virtual
|
||||||
|
LLVOVolume* LLViewerObject::asVolume()
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
// If this object is directly or indirectly parented by an avatar,
|
// If this object is directly or indirectly parented by an avatar,
|
||||||
// return it. Normally getAvatar() is the correct function to call;
|
// return it. Normally getAvatar() is the correct function to call;
|
||||||
// it will give the avatar used for skinning. The exception is with
|
// it will give the avatar used for skinning. The exception is with
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class LLPrimitive;
|
|||||||
class LLTextureEntry;
|
class LLTextureEntry;
|
||||||
class LLVOAvatar;
|
class LLVOAvatar;
|
||||||
class LLVOInventoryListener;
|
class LLVOInventoryListener;
|
||||||
|
class LLVOVolume;
|
||||||
class LLViewerInventoryItem;
|
class LLViewerInventoryItem;
|
||||||
class LLViewerObject;
|
class LLViewerObject;
|
||||||
class LLViewerObjectMedia;
|
class LLViewerObjectMedia;
|
||||||
@@ -157,6 +158,7 @@ public:
|
|||||||
BOOL isParticleSource() const;
|
BOOL isParticleSource() const;
|
||||||
|
|
||||||
virtual LLVOAvatar* asAvatar();
|
virtual LLVOAvatar* asAvatar();
|
||||||
|
virtual LLVOVolume* asVolume();
|
||||||
|
|
||||||
LLVOAvatar* getAvatarAncestor();
|
LLVOAvatar* getAvatarAncestor();
|
||||||
|
|
||||||
|
|||||||
@@ -1116,7 +1116,8 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
|
|||||||
|
|
||||||
LL_DEBUGS() << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << LL_ENDL;
|
LL_DEBUGS() << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << LL_ENDL;
|
||||||
|
|
||||||
LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject()));
|
LLViewerObject* vobjp = static_cast<LLViewerObject*>(pick_info.getObject());
|
||||||
|
LLVOVolume *obj = vobjp ? vobjp->asVolume() : nullptr;
|
||||||
|
|
||||||
if (obj && !obj->getRegion()->getCapability("ObjectMedia").empty())
|
if (obj && !obj->getRegion()->getCapability("ObjectMedia").empty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6923,7 +6923,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, uuid_set_t*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVOVolume *vobj = dynamic_cast<LLVOVolume*>(vo);
|
LLVOVolume *vobj = vo->asVolume();
|
||||||
if (vobj && vobj->isRiggedMesh() &&
|
if (vobj && vobj->isRiggedMesh() &&
|
||||||
vobj->getVolume() && vobj->getVolume()->isMeshAssetLoaded() && gMeshRepo.meshRezEnabled())
|
vobj->getVolume() && vobj->getVolume()->isMeshAssetLoaded() && gMeshRepo.meshRezEnabled())
|
||||||
{
|
{
|
||||||
@@ -10567,7 +10567,7 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
|
|||||||
{{
|
{{
|
||||||
LLViewerObject* attached_object = iter.first;
|
LLViewerObject* attached_object = iter.first;
|
||||||
#endif
|
#endif
|
||||||
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(attached_object);
|
LLVOVolume *volume = attached_object->asVolume();
|
||||||
if (volume)
|
if (volume)
|
||||||
{
|
{
|
||||||
volumes.push_back(volume);
|
volumes.push_back(volume);
|
||||||
@@ -10580,11 +10580,12 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LLViewerObject::const_child_list_t& children = attached_object->getChildren();
|
LLViewerObject::const_child_list_t& children = attached_object->getChildren();
|
||||||
for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
|
for (LLViewerObject* childp : children)
|
||||||
it != children.end(); ++it)
|
|
||||||
{
|
{
|
||||||
LLViewerObject *childp = *it;
|
if (!childp)
|
||||||
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(childp);
|
continue;
|
||||||
|
|
||||||
|
LLVOVolume *volume = childp->asVolume();
|
||||||
if (volume)
|
if (volume)
|
||||||
{
|
{
|
||||||
volumes.push_back(volume);
|
volumes.push_back(volume);
|
||||||
@@ -10601,11 +10602,9 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
|
|||||||
{
|
{
|
||||||
volumes.push_back(volp);
|
volumes.push_back(volp);
|
||||||
LLViewerObject::const_child_list_t& children = volp->getChildren();
|
LLViewerObject::const_child_list_t& children = volp->getChildren();
|
||||||
for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
|
for (LLViewerObject* childp : children)
|
||||||
it != children.end(); ++it)
|
|
||||||
{
|
{
|
||||||
LLViewerObject *childp = *it;
|
LLVOVolume *volume = childp ? childp->asVolume() : nullptr;
|
||||||
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(childp);
|
|
||||||
if (volume)
|
if (volume)
|
||||||
{
|
{
|
||||||
volumes.push_back(volume);
|
volumes.push_back(volume);
|
||||||
@@ -10950,7 +10949,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
|
|||||||
++child_iter)
|
++child_iter)
|
||||||
{
|
{
|
||||||
LLViewerObject* child_obj = *child_iter;
|
LLViewerObject* child_obj = *child_iter;
|
||||||
LLVOVolume *child = dynamic_cast<LLVOVolume*>(child_obj);
|
LLVOVolume *child = child_obj ? child_obj->asVolume() : nullptr;
|
||||||
if (child)
|
if (child)
|
||||||
{
|
{
|
||||||
attachment_children_cost += child->getRenderCost(textures);
|
attachment_children_cost += child->getRenderCost(textures);
|
||||||
@@ -11007,7 +11006,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
|
|||||||
iter != child_list.end(); ++iter)
|
iter != child_list.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLViewerObject* childp = *iter;
|
LLViewerObject* childp = *iter;
|
||||||
const LLVOVolume* chld_volume = dynamic_cast<LLVOVolume*>(childp);
|
const LLVOVolume* chld_volume = childp ? childp->asVolume() : nullptr;
|
||||||
if (chld_volume)
|
if (chld_volume)
|
||||||
{
|
{
|
||||||
// get cost and individual textures
|
// get cost and individual textures
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ private:
|
|||||||
// Impostors
|
// Impostors
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
BOOL isImpostor() const;
|
virtual BOOL isImpostor() const;
|
||||||
BOOL shouldImpostor(const U32 rank_factor = 1) const;
|
BOOL shouldImpostor(const U32 rank_factor = 1) const;
|
||||||
BOOL needsImpostorUpdate() const;
|
BOOL needsImpostorUpdate() const;
|
||||||
const LLVector3& getImpostorOffset() const;
|
const LLVector3& getImpostorOffset() const;
|
||||||
@@ -570,6 +570,7 @@ public:
|
|||||||
F32SecondsImplicit mLastImpostorUpdateFrameTime;
|
F32SecondsImplicit mLastImpostorUpdateFrameTime;
|
||||||
const LLVector3* getLastAnimExtents() const { return mLastAnimExtents; }
|
const LLVector3* getLastAnimExtents() const { return mLastAnimExtents; }
|
||||||
void setNeedsExtentUpdate(bool val) { mNeedsExtentUpdate = val; }
|
void setNeedsExtentUpdate(bool val) { mNeedsExtentUpdate = val; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LLVector3 mImpostorOffset;
|
LLVector3 mImpostorOffset;
|
||||||
LLVector2 mImpostorDim;
|
LLVector2 mImpostorDim;
|
||||||
|
|||||||
@@ -265,6 +265,11 @@ LLVOVolume::~LLVOVolume()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLVOVolume* LLVOVolume::asVolume()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
void LLVOVolume::markDead()
|
void LLVOVolume::markDead()
|
||||||
{
|
{
|
||||||
if (!mDead)
|
if (!mDead)
|
||||||
@@ -3496,8 +3501,6 @@ bool LLVOVolume::isAnimatedObject() const
|
|||||||
// virtual
|
// virtual
|
||||||
void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_parent)
|
void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_parent)
|
||||||
{
|
{
|
||||||
LLVOVolume *old_volp = dynamic_cast<LLVOVolume*>(old_parent);
|
|
||||||
|
|
||||||
if (new_parent && !new_parent->isAvatar())
|
if (new_parent && !new_parent->isAvatar())
|
||||||
{
|
{
|
||||||
if (mControlAvatar.notNull())
|
if (mControlAvatar.notNull())
|
||||||
@@ -3509,6 +3512,7 @@ void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_pare
|
|||||||
av->markForDeath();
|
av->markForDeath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LLVOVolume *old_volp = old_parent ? old_parent->asVolume() : nullptr;
|
||||||
if (old_volp && old_volp->isAnimatedObject())
|
if (old_volp && old_volp->isAnimatedObject())
|
||||||
{
|
{
|
||||||
if (old_volp->getControlAvatar())
|
if (old_volp->getControlAvatar())
|
||||||
@@ -5247,7 +5251,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||||||
if (bridge)
|
if (bridge)
|
||||||
{
|
{
|
||||||
vobj = bridge->mDrawable->getVObj();
|
vobj = bridge->mDrawable->getVObj();
|
||||||
vol_obj = dynamic_cast<LLVOVolume*>(vobj);
|
vol_obj = vobj ? vobj->asVolume() : nullptr;
|
||||||
}
|
}
|
||||||
if (vol_obj)
|
if (vol_obj)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME)
|
// Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME)
|
||||||
class LLVOVolume : public LLViewerObject
|
class LLVOVolume final : public LLViewerObject
|
||||||
{
|
{
|
||||||
LOG_CLASS(LLVOVolume);
|
LOG_CLASS(LLVOVolume);
|
||||||
protected:
|
protected:
|
||||||
@@ -126,7 +126,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
|
LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
|
||||||
/*virtual*/ void markDead(); // Override (and call through to parent) to clean up media references
|
|
||||||
|
LLVOVolume* asVolume() final;
|
||||||
|
/*virtual*/ void markDead() override; // Override (and call through to parent) to clean up media references
|
||||||
|
|
||||||
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
|
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user