parent
25aee5e983
commit
091beab798
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue