summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-04-20 10:25:05 -0700
committerCosmic Linden <cosmic@lindenlab.com>2022-06-21 12:33:33 -0700
commit0a08645eb6a86a3279beb925ebba88393bb89936 (patch)
treefc5423746e9b746fbc7d016abc270cf89aaf8b84 /indra/newview
parent916da8cfb8b394239c523ee9b70c698dabb4ba98 (diff)
SL-17021: Do not do software skinning/octree building of a face during picking unless eligible for narrow-phase intersect check (fast broad-phase intersect pre-check not yet implemented)
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvovolume.cpp28
-rw-r--r--indra/newview/llvovolume.h7
2 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 89056c64bb..fce233969b 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4585,7 +4585,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
{
if ((pick_rigged) || (getAvatar() && (getAvatar()->isSelf()) && (LLFloater::isVisible(gFloaterTools))))
{
- updateRiggedVolume(true);
+ updateRiggedVolume(true, LLRiggedVolume::DO_NOT_UPDATE_FACES);
volume = mRiggedVolume;
transform = false;
}
@@ -4660,6 +4660,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
continue;
}
+ updateRiggedVolume(true, i);
face_hit = volume->lineSegmentIntersect(local_start, local_end, i,
&p, &tc, &n, &tn);
@@ -4783,7 +4784,7 @@ void LLVOVolume::clearRiggedVolume()
}
}
-void LLVOVolume::updateRiggedVolume(bool force_update)
+void LLVOVolume::updateRiggedVolume(bool force_update, LLRiggedVolume::FaceIndex face_index)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
//Update mRiggedVolume to match current animation frame of avatar.
@@ -4818,10 +4819,10 @@ void LLVOVolume::updateRiggedVolume(bool force_update)
updateRelativeXform();
}
- mRiggedVolume->update(skin, avatar, volume);
+ mRiggedVolume->update(skin, avatar, volume, face_index);
}
-void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* volume)
+void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* volume, FaceIndex face_index)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
bool copy = false;
@@ -4871,7 +4872,24 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
S32 rigged_vert_count = 0;
S32 rigged_face_count = 0;
LLVector4a box_min, box_max;
- for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
+ S32 face_begin;
+ S32 face_end;
+ if (face_index == DO_NOT_UPDATE_FACES)
+ {
+ face_begin = 0;
+ face_end = 0;
+ }
+ else if (face_index == UPDATE_ALL_FACES)
+ {
+ face_begin = 0;
+ face_end = volume->getNumVolumeFaces();
+ }
+ else
+ {
+ face_begin = face_index;
+ face_end = face_begin + 1;
+ }
+ for (S32 i = face_begin; i < face_end; ++i)
{
const LLVolumeFace& vol_face = volume->getVolumeFace(i);
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 4cb7a5481c..00a0a1dfd0 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -65,7 +65,10 @@ public:
{
}
- void update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* src_volume);
+ using FaceIndex = S32;
+ static const FaceIndex UPDATE_ALL_FACES = -1;
+ static const FaceIndex DO_NOT_UPDATE_FACES = -2;
+ void update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* src_volume, FaceIndex face_index = UPDATE_ALL_FACES);
std::string mExtraDebugText;
};
@@ -363,7 +366,7 @@ public:
//rigged volume update (for raycasting)
- void updateRiggedVolume(bool force_update = false);
+ void updateRiggedVolume(bool force_update = false, LLRiggedVolume::FaceIndex face_index = LLRiggedVolume::UPDATE_ALL_FACES);
LLRiggedVolume* getRiggedVolume();
//returns true if volume should be treated as a rigged volume