summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-08 17:43:24 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-08 17:43:24 -0700
commit091beab79872fbaf4e3e7de39c8e69ef08e5a1c7 (patch)
tree5ddae679901bc5cf42bda8ef6ac04033a3ece232 /indra
parent25aee5e983a8de712565d8241cbdb18da832a4d1 (diff)
Even more placement modes. Reflected axis modes need work.
DRTVWR-583
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llheroprobemanager.cpp93
-rw-r--r--indra/newview/llviewerobject.cpp53
2 files changed, 138 insertions, 8 deletions
diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp
index 64c9ab1527..caeb9d4e8e 100644
--- a/indra/newview/llheroprobemanager.cpp
+++ b/indra/newview/llheroprobemanager.cpp
@@ -159,6 +159,22 @@ void LLHeroProbeManager::update()
probe_pos.load3(focus_point.mV);
break;
case 7:
+ focus_point.set(hero_pos.mV[0], hero_pos.mV[1] - mNearestHero->getBoundingBoxAgent().getExtentLocal().mV[1], hero_pos.mV[2]);
+ probe_pos.load3(focus_point.mV);
+ break;
+ case 8:
+ focus_point.set(hero_pos.mV[0], hero_pos.mV[1] + mNearestHero->getBoundingBoxAgent().getExtentLocal().mV[1], hero_pos.mV[2]);
+ probe_pos.load3(focus_point.mV);
+ break;
+ case 9:
+ focus_point.set(hero_pos.mV[0], hero_pos.mV[1], hero_pos.mV[2] - mNearestHero->getBoundingBoxAgent().getExtentLocal().mV[2]);
+ probe_pos.load3(focus_point.mV);
+ break;
+ case 10:
+ focus_point.set(hero_pos.mV[0], hero_pos.mV[1], hero_pos.mV[2] + mNearestHero->getBoundingBoxAgent().getExtentLocal().mV[2]);
+ probe_pos.load3(focus_point.mV);
+ break;
+ case 11:
if (obj && obj->mDrawable && obj->isSelected())
{ // focus on selected media object
@@ -202,12 +218,87 @@ void LLHeroProbeManager::update()
probe_pos.load3(focus_point.mV);
break;
- case 8:
+ case 12:
+
+ hit = mNearestHero->lineSegmentIntersect(LLVector4a(camera_pos.mV[0], camera_pos.mV[1], camera_pos.mV[2]),
+ LLVector4a(hero_pos.mV[0], hero_pos.mV[1], hero_pos.mV[2]),
+ -1,
+ FALSE,
+ FALSE,
+ FALSE,
+ NULL,
+ &hit_pos);
+ if (hit)
+ {
+ hero_pos.mV[0] = hit_pos.getF32ptr()[0];
+ hero_pos.mV[1] = hit_pos.getF32ptr()[1];
+ hero_pos.mV[2] = hit_pos.getF32ptr()[2];
+ }
+
+ camera_rot.setAngleAxis(180, 1, 0, 0);
+ focus_point = camera_pos - hero_pos;
+ focus_point.rotVec(camera_rot);
+ probe_pos.load3((camera_pos + focus_point).mV);
+ break;
+ case 13:
+
+ hit = mNearestHero->lineSegmentIntersect(LLVector4a(camera_pos.mV[0], camera_pos.mV[1], camera_pos.mV[2]),
+ LLVector4a(hero_pos.mV[0], hero_pos.mV[1], hero_pos.mV[2]),
+ -1,
+ FALSE,
+ FALSE,
+ FALSE,
+ NULL,
+ &hit_pos);
+ if (hit)
+ {
+ hero_pos.mV[0] = hit_pos.getF32ptr()[0];
+ hero_pos.mV[1] = hit_pos.getF32ptr()[1];
+ hero_pos.mV[2] = hit_pos.getF32ptr()[2];
+ }
+
+ camera_rot.setAngleAxis(180, 0, 1, 0);
+ focus_point = camera_pos - hero_pos;
+ focus_point.rotVec(camera_rot);
+ probe_pos.load3((camera_pos + focus_point).mV);
+ break;
+ case 14:
+
+ hit = mNearestHero->lineSegmentIntersect(LLVector4a(camera_pos.mV[0], camera_pos.mV[1], camera_pos.mV[2]),
+ LLVector4a(hero_pos.mV[0], hero_pos.mV[1], hero_pos.mV[2]),
+ -1,
+ FALSE,
+ FALSE,
+ FALSE,
+ NULL,
+ &hit_pos);
+ if (hit)
+ {
+ hero_pos.mV[0] = hit_pos.getF32ptr()[0];
+ hero_pos.mV[1] = hit_pos.getF32ptr()[1];
+ hero_pos.mV[2] = hit_pos.getF32ptr()[2];
+ }
+
camera_rot.setAngleAxis(180, 0, 0, 1);
focus_point = camera_pos - hero_pos;
focus_point.rotVec(camera_rot);
probe_pos.load3((camera_pos + focus_point).mV);
break;
+ case 15:
+ probe_pos.set(camera_pos.mV[0], camera_pos.mV[1], hero_pos.mV[2]);
+ break;
+ case 16:
+ probe_pos.set(camera_pos.mV[0], hero_pos.mV[1], camera_pos.mV[2]);
+ break;
+ case 17:
+ probe_pos.set(hero_pos.mV[0], camera_pos.mV[1], camera_pos.mV[2]);
+ break;
+ case 18:
+ probe_pos.load3(camera_pos.mV);
+ break;
+ case 19:
+ probe_pos.load3(((camera_pos + hero_pos) / 2).mV);
+ break;
}
}
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index adb4683af0..950c672a42 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -1163,27 +1163,22 @@ void detectMirror(const std::string &str, bool &mirror, U8 &mode)
}
else if (word == "XAlign" && mirror)
{
- LL_INFOS() << "Mirror wants camera X placement." << LL_ENDL;
mode = 0;
}
else if (word == "YAlign" && mirror)
{
- LL_INFOS() << "Mirror wants camera Y placement." << LL_ENDL;
mode = 1;
}
else if (word == "ZAlign" && mirror)
{
- LL_INFOS() << "Mirror wants camera Z placement." << LL_ENDL;
mode = 2;
}
else if (word == "NearestPoint" && mirror)
{
- LL_INFOS() << "Mirror wants nearest point placement." << LL_ENDL;
mode = 3;
}
else if (word == "Center" && mirror)
{
- LL_INFOS() << "Mirror wants center of object." << LL_ENDL;
mode = 4;
}
else if (word == "XMin" && mirror)
@@ -1194,14 +1189,58 @@ void detectMirror(const std::string &str, bool &mirror, U8 &mode)
{
mode = 6;
}
- else if (word == "FocusPoint" && mirror)
+ else if (word == "YMin" && mirror)
{
mode = 7;
}
- else if (word == "Reflected" && mirror)
+ else if (word == "YMax" && mirror)
{
mode = 8;
}
+ else if (word == "ZMin" && mirror)
+ {
+ mode = 9;
+ }
+ else if (word == "ZMax" && mirror)
+ {
+ mode = 10;
+ }
+ else if (word == "FocusPoint" && mirror)
+ {
+ mode = 11;
+ }
+ else if (word == "ReflectedX" && mirror)
+ {
+ mode = 12;
+ }
+ else if (word == "ReflectedY" && mirror)
+ {
+ mode = 13;
+ }
+ else if (word == "ReflectedZ" && mirror)
+ {
+ mode = 14;
+ }
+ else if (word == "XYAlign" && mirror)
+ {
+ mode = 15;
+ }
+ else if (word == "XZAlign" && mirror)
+ {
+ mode = 16;
+ }
+ else if (word == "ZYAlign" && mirror)
+ {
+ mode = 17;
+ }
+ else if (word == "XYZAlign" && mirror)
+ {
+ mode = 18;
+ }
+ else if (word == "XYZAlignCenter" && mirror)
+ {
+ mode = 19;
+ }
}
}