Add protocol level mirror support, and UI.
parent
3160520249
commit
fbecd348f8
|
|
@ -404,11 +404,6 @@ S32 LLPrimitive::setTEFullbright(const U8 index, const U8 fullbright)
|
|||
return mTextureList.setFullbright(index, fullbright);
|
||||
}
|
||||
|
||||
S32 LLPrimitive::setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target)
|
||||
{
|
||||
return mTextureList.setRenderableTarget(te, target);
|
||||
}
|
||||
|
||||
S32 LLPrimitive::setTEMediaFlags(const U8 index, const U8 media_flags)
|
||||
{
|
||||
return mTextureList.setMediaFlags(index, media_flags);
|
||||
|
|
@ -1828,6 +1823,40 @@ bool LLLightParams::fromLLSD(LLSD& sd)
|
|||
|
||||
//============================================================================
|
||||
|
||||
LLMirrorParams::LLMirrorParams()
|
||||
{
|
||||
mType = PARAMS_MIRROR;
|
||||
}
|
||||
|
||||
BOOL LLMirrorParams::pack(LLDataPacker &dp) const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLMirrorParams::unpack(LLDataPacker &dp)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool LLMirrorParams::operator==(const LLNetworkData& data) const
|
||||
{
|
||||
if (data.mType != PARAMS_REFLECTION_PROBE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLMirrorParams::copy(const LLNetworkData& data)
|
||||
{
|
||||
const LLMirrorParams *param = (LLMirrorParams*)&data;
|
||||
mType = param->mType;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
|
||||
LLReflectionProbeParams::LLReflectionProbeParams()
|
||||
{
|
||||
mType = PARAMS_REFLECTION_PROBE;
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ public:
|
|||
PARAMS_EXTENDED_MESH = 0x70,
|
||||
PARAMS_RENDER_MATERIAL = 0x80,
|
||||
PARAMS_REFLECTION_PROBE = 0x90,
|
||||
PARAMS_MIRROR = 0x100,
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
@ -172,6 +173,16 @@ public:
|
|||
F32 getCutoff() const { return mCutoff; }
|
||||
};
|
||||
|
||||
class LLMirrorParams : public LLNetworkData
|
||||
{
|
||||
public:
|
||||
LLMirrorParams();
|
||||
/*virtual*/ BOOL pack(LLDataPacker &dp) const;
|
||||
/*virtual*/ BOOL unpack(LLDataPacker &dp);
|
||||
/*virtual*/ bool operator==(const LLNetworkData& data) const;
|
||||
/*virtual*/ void copy(const LLNetworkData& data);
|
||||
};
|
||||
|
||||
extern const F32 REFLECTION_PROBE_MIN_AMBIANCE;
|
||||
extern const F32 REFLECTION_PROBE_MAX_AMBIANCE;
|
||||
extern const F32 REFLECTION_PROBE_DEFAULT_AMBIANCE;
|
||||
|
|
@ -485,7 +496,6 @@ public:
|
|||
virtual S32 setTETexGen(const U8 te, const U8 texgen);
|
||||
virtual S32 setTEShiny(const U8 te, const U8 shiny);
|
||||
virtual S32 setTEFullbright(const U8 te, const U8 fullbright);
|
||||
virtual S32 setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target);
|
||||
virtual S32 setTEMediaFlags(const U8 te, const U8 flags);
|
||||
virtual S32 setTEGlow(const U8 te, const F32 glow);
|
||||
virtual S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
|
||||
|
|
|
|||
|
|
@ -341,16 +341,6 @@ S32 LLPrimTextureList::setFullbright(const U8 index, const U8 fullbright)
|
|||
return TEM_CHANGE_NONE;
|
||||
}
|
||||
|
||||
S32 LLPrimTextureList::setRenderableTarget(const U8 index, const U8 target)
|
||||
{
|
||||
if (index < mEntryList.size())
|
||||
{
|
||||
return mEntryList[index]->setRenderableTarget((LLTextureEntry::eRenderableTarget)target);
|
||||
}
|
||||
|
||||
return TEM_CHANGE_NONE;
|
||||
}
|
||||
|
||||
S32 LLPrimTextureList::setMediaFlags(const U8 index, const U8 media_flags)
|
||||
{
|
||||
if (index < mEntryList.size())
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ public:
|
|||
S32 setTexGen(const U8 index, const U8 texgen);
|
||||
S32 setShiny(const U8 index, const U8 shiny);
|
||||
S32 setFullbright(const U8 index, const U8 t);
|
||||
S32 setRenderableTarget(const U8 index, const U8 target);
|
||||
S32 setMediaFlags(const U8 index, const U8 media_flags);
|
||||
S32 setGlow(const U8 index, const F32 glow);
|
||||
S32 setMaterialID(const U8 index, const LLMaterialID& pMaterialID);
|
||||
|
|
|
|||
|
|
@ -504,16 +504,6 @@ S32 LLTextureEntry::setFullbright(U8 fullbright)
|
|||
return TEM_CHANGE_NONE;
|
||||
}
|
||||
|
||||
S32 LLTextureEntry::setRenderableTarget(eRenderableTarget target)
|
||||
{
|
||||
if (getRenderableTarget() != target) {
|
||||
mRenderableTarget = target;
|
||||
return TEM_CHANGE_TEXTURE;
|
||||
}
|
||||
|
||||
return TEM_CHANGE_NONE;
|
||||
}
|
||||
|
||||
S32 LLTextureEntry::setShiny(U8 shiny)
|
||||
{
|
||||
shiny &= TEM_SHINY_MASK;
|
||||
|
|
|
|||
|
|
@ -80,12 +80,6 @@ public:
|
|||
TEX_GEN_SPHERICAL = 0x04,
|
||||
TEX_GEN_CYLINDRICAL = 0x06
|
||||
} eTexGen;
|
||||
|
||||
|
||||
typedef enum e_renderable_target {
|
||||
RT_DISABLED = 0x00,
|
||||
RT_MIRROR = 0x02
|
||||
} eRenderableTarget;
|
||||
|
||||
LLTextureEntry();
|
||||
LLTextureEntry(const LLUUID& tex_id);
|
||||
|
|
@ -141,8 +135,6 @@ public:
|
|||
S32 setMaterialID(const LLMaterialID& pMaterialID);
|
||||
S32 setMaterialParams(const LLMaterialPtr pMaterialParams);
|
||||
|
||||
S32 setRenderableTarget(eRenderableTarget target);
|
||||
|
||||
virtual const LLUUID &getID() const { return mID; }
|
||||
const LLColor4 &getColor() const { return mColor; }
|
||||
const F32 getAlpha() const { return mColor.mV[VALPHA]; }
|
||||
|
|
@ -160,7 +152,6 @@ public:
|
|||
|
||||
U8 getBumpmap() const { return mBump & TEM_BUMP_MASK; }
|
||||
U8 getFullbright() const { return (mBump>>TEM_FULLBRIGHT_SHIFT) & TEM_FULLBRIGHT_MASK; }
|
||||
eRenderableTarget getRenderableTarget() const { return mRenderableTarget; }
|
||||
U8 getShiny() const { return (mBump>>TEM_SHINY_SHIFT) & TEM_SHINY_MASK; }
|
||||
U8 getBumpShiny() const { return mBump & TEM_BUMP_SHINY_MASK; }
|
||||
U8 getBumpShinyFullbright() const { return mBump; }
|
||||
|
|
@ -242,7 +233,6 @@ protected:
|
|||
LLColor4 mColor;
|
||||
U8 mBump; // Bump map, shiny, and fullbright
|
||||
U8 mMediaFlags; // replace with web page, movie, etc.
|
||||
eRenderableTarget mRenderableTarget;
|
||||
F32 mGlow;
|
||||
bool mMaterialUpdatePending;
|
||||
LLMaterialID mMaterialID;
|
||||
|
|
|
|||
|
|
@ -103,53 +103,71 @@ void LLHeroProbeManager::update()
|
|||
|
||||
llassert(mProbes[0] == mDefaultProbe);
|
||||
|
||||
LLVector3 camera_pos = LLViewerCamera::instance().getOrigin();
|
||||
|
||||
LLVector4a probe_pos;
|
||||
|
||||
LLVector3 focus_point;
|
||||
|
||||
LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject();
|
||||
if (obj && obj->mDrawable && obj->isSelected())
|
||||
{ // focus on selected media object
|
||||
S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace();
|
||||
if (obj && obj->mDrawable)
|
||||
{
|
||||
LLFace* face = obj->mDrawable->getFace(face_idx);
|
||||
if (face)
|
||||
{
|
||||
focus_point = face->getPositionAgent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (focus_point.isExactlyZero())
|
||||
if (mHeroList.empty())
|
||||
{
|
||||
if (LLViewerJoystick::getInstance()->getOverrideCamera())
|
||||
{ // focus on point under cursor
|
||||
focus_point.set(gDebugRaycastIntersection.getF32ptr());
|
||||
}
|
||||
else if (gAgentCamera.cameraMouselook())
|
||||
{ // focus on point under mouselook crosshairs
|
||||
LLVector4a result;
|
||||
result.clear();
|
||||
|
||||
gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, TRUE, NULL, &result);
|
||||
|
||||
focus_point.set(result.getF32ptr());
|
||||
}
|
||||
else
|
||||
{
|
||||
// focus on alt-zoom target
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region)
|
||||
LLVector3 focus_point;
|
||||
|
||||
LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject();
|
||||
if (obj && obj->mDrawable && obj->isSelected())
|
||||
{ // focus on selected media object
|
||||
S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace();
|
||||
if (obj && obj->mDrawable)
|
||||
{
|
||||
focus_point = LLVector3(gAgentCamera.getFocusGlobal() - region->getOriginGlobal());
|
||||
LLFace* face = obj->mDrawable->getFace(face_idx);
|
||||
if (face)
|
||||
{
|
||||
focus_point = face->getPositionAgent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (focus_point.isExactlyZero())
|
||||
{
|
||||
if (LLViewerJoystick::getInstance()->getOverrideCamera())
|
||||
{ // focus on point under cursor
|
||||
focus_point.set(gDebugRaycastIntersection.getF32ptr());
|
||||
}
|
||||
else if (gAgentCamera.cameraMouselook())
|
||||
{ // focus on point under mouselook crosshairs
|
||||
LLVector4a result;
|
||||
result.clear();
|
||||
|
||||
gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, TRUE, NULL, &result);
|
||||
|
||||
focus_point.set(result.getF32ptr());
|
||||
}
|
||||
else
|
||||
{
|
||||
// focus on alt-zoom target
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region)
|
||||
{
|
||||
focus_point = LLVector3(gAgentCamera.getFocusGlobal() - region->getOriginGlobal());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
probe_pos.load3(((focus_point)).mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the nearest hero.
|
||||
float distance = F32_MAX;
|
||||
|
||||
for (auto drawable : mHeroList)
|
||||
{
|
||||
if (drawable.notNull())
|
||||
{
|
||||
if (drawable->mDistanceWRTCamera < distance)
|
||||
{
|
||||
probe_pos.load3(drawable->mXform.getPosition().mV);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
probe_pos.load3(((focus_point + camera_pos) / 2).mV);
|
||||
static LLCachedControl<S32> sDetail(gSavedSettings, "RenderHeroReflectionProbeDetail", -1);
|
||||
static LLCachedControl<S32> sLevel(gSavedSettings, "RenderHeroReflectionProbeLevel", 3);
|
||||
|
||||
|
|
@ -464,7 +482,7 @@ void LLHeroProbeManager::initReflectionMaps()
|
|||
|
||||
mDefaultProbe->mCubeIndex = 0;
|
||||
mDefaultProbe->mCubeArray = mTexture;
|
||||
mDefaultProbe->mDistance = 64.f;
|
||||
mDefaultProbe->mDistance = 12.f;
|
||||
mDefaultProbe->mRadius = 4096.f;
|
||||
mDefaultProbe->mProbeIndex = 0;
|
||||
touch_default_probe(mDefaultProbe);
|
||||
|
|
@ -536,6 +554,7 @@ void LLHeroProbeManager::registerHeroDrawable(LLDrawable* drawablep)
|
|||
if (mHeroList.find(drawablep) == mHeroList.end())
|
||||
{
|
||||
mHeroList.insert(drawablep);
|
||||
LL_INFOS() << "Added hero drawable." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -596,17 +596,6 @@ void LLPanelFace::sendFullbright()
|
|||
LLSelectMgr::getInstance()->selectionSetFullbright( fullbright );
|
||||
}
|
||||
|
||||
void LLPanelFace::sendMirror()
|
||||
{
|
||||
LLCheckBoxCtrl* mCheckMirror = getChild<LLCheckBoxCtrl>("checkbox mirror");
|
||||
|
||||
if (!mCheckMirror)
|
||||
return;
|
||||
|
||||
LLTextureEntry::eRenderableTarget target = mCheckMirror->get() ? LLTextureEntry::RT_MIRROR : LLTextureEntry::RT_DISABLED;
|
||||
LLSelectMgr::getInstance()->selectionSetRenderableTarget(target);
|
||||
}
|
||||
|
||||
void LLPanelFace::sendColor()
|
||||
{
|
||||
|
||||
|
|
@ -3007,12 +2996,6 @@ void LLPanelFace::onCommitFullbright(LLUICtrl* ctrl, void* userdata)
|
|||
self->sendFullbright();
|
||||
}
|
||||
|
||||
void LLPanelFace::onCommitMirror(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
||||
self->sendMirror();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -139,7 +139,6 @@ protected:
|
|||
void sendShiny(U32 shininess); // applies and sends shininess
|
||||
void sendFullbright(); // applies and sends full bright
|
||||
|
||||
void sendMirror();
|
||||
void sendGlow();
|
||||
void alignTestureLayer();
|
||||
|
||||
|
|
@ -229,7 +228,6 @@ protected:
|
|||
static void onCommitShiny( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitAlphaMode( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitFullbright( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitMirror(LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
|
||||
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo);
|
||||
|
|
|
|||
|
|
@ -114,6 +114,11 @@ BOOL LLPanelVolume::postBuild()
|
|||
getChild<LLUICtrl>("FlexForceZ")->setValidateBeforeCommit(precommitValidate);
|
||||
}
|
||||
|
||||
// Mirror Parameters
|
||||
{
|
||||
childSetCommitCallback("Mirror Checkbox Ctrl", onCommitIsMirror, this);
|
||||
}
|
||||
|
||||
// LIGHT Parameters
|
||||
{
|
||||
childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this);
|
||||
|
|
@ -305,6 +310,10 @@ void LLPanelVolume::getState( )
|
|||
getChildView("select_single")->setEnabled(true);
|
||||
}
|
||||
|
||||
BOOL is_mirror = volobjp && volobjp->isMirror();
|
||||
getChild<LLUICtrl>("Mirror Checkbox Ctrl")->setValue(is_mirror);
|
||||
getChildView("Mirror Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp);
|
||||
|
||||
// Light properties
|
||||
BOOL is_light = volobjp && volobjp->getIsLight();
|
||||
getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light);
|
||||
|
|
@ -737,6 +746,25 @@ void LLPanelVolume::sendIsLight()
|
|||
LL_INFOS() << "update light sent" << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLPanelVolume::sendIsMirror()
|
||||
{
|
||||
LLViewerObject* objectp = mObject;
|
||||
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLVOVolume *volobjp = (LLVOVolume *)objectp;
|
||||
|
||||
// Quick hack to set the mirror locally.
|
||||
|
||||
gPipeline.mHeroProbeManager.registerHeroDrawable(volobjp->mDrawable);
|
||||
|
||||
BOOL value = getChild<LLUICtrl>("Mirror Checkbox Ctrl")->getValue();
|
||||
volobjp->setIsMirror(value);
|
||||
LL_INFOS() << "update mirror sent" << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
void LLPanelVolume::sendIsReflectionProbe()
|
||||
{
|
||||
LLViewerObject* objectp = mObject;
|
||||
|
|
@ -1403,6 +1431,12 @@ void LLPanelVolume::onCommitIsLight( LLUICtrl* ctrl, void* userdata )
|
|||
self->sendIsLight();
|
||||
}
|
||||
|
||||
void LLPanelVolume::onCommitIsMirror( LLUICtrl* ctrl, void* userdata )
|
||||
{
|
||||
LLPanelVolume* self = (LLPanelVolume*) userdata;
|
||||
self->sendIsMirror();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item_id, LLVOVolume* volobjp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public:
|
|||
|
||||
void sendIsLight();
|
||||
|
||||
void sendIsMirror();
|
||||
// when an object is becoming a refleciton probe, present a dialog asking for confirmation
|
||||
// otherwise, send the reflection probe update immediately
|
||||
void sendIsReflectionProbe();
|
||||
|
|
@ -71,6 +72,7 @@ public:
|
|||
|
||||
static void onCommitIsLight( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitLight( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitIsMirror( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitIsReflectionProbe(LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitProbe(LLUICtrl* ctrl, void* userdata);
|
||||
void onCommitIsFlexible( LLUICtrl* ctrl, void* userdata);
|
||||
|
|
|
|||
|
|
@ -2355,47 +2355,6 @@ void LLSelectMgr::selectionSetFullbright(U8 fullbright)
|
|||
getSelection()->applyToObjects(&sendfunc);
|
||||
}
|
||||
|
||||
void LLSelectMgr::selectionSetRenderableTarget(LLTextureEntry::eRenderableTarget target)
|
||||
{
|
||||
struct f : public LLSelectedTEFunctor
|
||||
{
|
||||
LLTextureEntry::eRenderableTarget mRenderableTarget;
|
||||
|
||||
f(const LLTextureEntry::eRenderableTarget& t) : mRenderableTarget(t) {}
|
||||
|
||||
bool apply(LLViewerObject* object, S32 te)
|
||||
{
|
||||
if (object->permModify())
|
||||
{
|
||||
object->setTERenderableTarget(te, mRenderableTarget);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} setfunc(target);
|
||||
|
||||
getSelection()->applyToTEs(&setfunc);
|
||||
|
||||
struct g : public LLSelectedObjectFunctor
|
||||
{
|
||||
LLTextureEntry::eRenderableTarget mRenderableTarget;
|
||||
|
||||
g(const LLTextureEntry::eRenderableTarget& t) : mRenderableTarget(t) {}
|
||||
|
||||
virtual bool apply(LLViewerObject* object)
|
||||
{
|
||||
if (object->permModify())
|
||||
{
|
||||
object->sendTEUpdate();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} sendfunc(target);
|
||||
|
||||
getSelection()->applyToObjects(&sendfunc);
|
||||
}
|
||||
|
||||
// This function expects media_data to be a map containing relevant
|
||||
// media data name/value pairs (e.g. home_url, etc.)
|
||||
void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
|
||||
|
|
|
|||
|
|
@ -653,7 +653,6 @@ public:
|
|||
void selectionSetGlow(const F32 glow);
|
||||
void selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func, int specific_te = -1);
|
||||
void selectionRemoveMaterial();
|
||||
void selectionSetRenderableTarget(LLTextureEntry::eRenderableTarget target);
|
||||
|
||||
void selectionSetObjectPermissions(U8 perm_field, BOOL set, U32 perm_mask, BOOL override = FALSE);
|
||||
void selectionSetObjectName(const std::string& name);
|
||||
|
|
|
|||
|
|
@ -5296,29 +5296,6 @@ S32 LLViewerObject::setTEFullbright(const U8 te, const U8 fullbright)
|
|||
return retval;
|
||||
}
|
||||
|
||||
S32 LLViewerObject::setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target)
|
||||
{
|
||||
S32 retval = 0;
|
||||
|
||||
const LLTextureEntry *tep = getTE(te);
|
||||
if (!tep)
|
||||
{
|
||||
LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
|
||||
}
|
||||
else if (target != tep->getRenderableTarget())
|
||||
{
|
||||
retval = LLPrimitive::setTERenderableTarget(te, target);
|
||||
setChanged(TEXTURE);
|
||||
if (mDrawable.notNull() && retval)
|
||||
{
|
||||
//gPipeline.markMirror(mDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
S32 LLViewerObject::setTEMediaFlags(const U8 te, const U8 media_flags)
|
||||
{
|
||||
// this might need work for media type
|
||||
|
|
@ -6251,6 +6228,11 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para
|
|||
{
|
||||
new_block = new LLReflectionProbeParams();
|
||||
break;
|
||||
}
|
||||
case LLNetworkData::PARAMS_MIRROR:
|
||||
{
|
||||
new_block = new LLMirrorParams();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -360,7 +360,6 @@ public:
|
|||
/*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media ); // *FIXME: this confusingly acts upon a superset of setTETexGen's flags without absorbing its semantics
|
||||
/*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny );
|
||||
/*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright );
|
||||
/*virtual*/ S32 setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target);
|
||||
/*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags );
|
||||
/*virtual*/ S32 setTEGlow(const U8 te, const F32 glow);
|
||||
/*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,10 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
|
|||
updateReflectionProbePtr();
|
||||
}
|
||||
|
||||
gPipeline.mHeroProbeManager.registerHeroDrawable(mDrawable);
|
||||
if (isMirror())
|
||||
{
|
||||
gPipeline.mHeroProbeManager.registerHeroDrawable(mDrawable);
|
||||
}
|
||||
|
||||
updateRadius();
|
||||
bool force_update = true; // avoid non-alpha mDistance update being optimized away
|
||||
|
|
@ -2369,16 +2372,6 @@ S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright)
|
|||
return res;
|
||||
}
|
||||
|
||||
S32 LLVOVolume::setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget mirror)
|
||||
{
|
||||
S32 res = LLViewerObject::setTERenderableTarget(te, mirror);
|
||||
if (res)
|
||||
{
|
||||
//gPipeline.markMirror(mDrawable);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
S32 LLVOVolume::setTEBumpShinyFullbright(const U8 te, const U8 bump)
|
||||
{
|
||||
S32 res = LLViewerObject::setTEBumpShinyFullbright(te, bump);
|
||||
|
|
@ -3379,28 +3372,41 @@ F32 LLVOVolume::getLightCutoff() const
|
|||
}
|
||||
}
|
||||
|
||||
BOOL LLVOVolume::isMirror() const
|
||||
bool LLVOVolume::setIsMirror(BOOL is_mirror)
|
||||
{
|
||||
S32 faceCount = getNumFaces();
|
||||
|
||||
// Temporary hack to set the object to mirror.
|
||||
for (int i = 0; i < faceCount; i++)
|
||||
BOOL was_mirror = isMirror();
|
||||
if (is_mirror != was_mirror)
|
||||
{
|
||||
const LLTextureEntry* te = getTE(i);
|
||||
|
||||
if (te->getMaterialParams().notNull())
|
||||
if (is_mirror)
|
||||
{
|
||||
LLViewerTexture* specularp = getTESpecularMap(0);
|
||||
|
||||
if (specularp && specularp->getID() == "da7ecda1-e780-423f-ce27-26df7dc69cb6")
|
||||
{
|
||||
LL_INFOS() << "BELLADONNA OF SADNESS" << LL_ENDL;
|
||||
return TRUE;
|
||||
}
|
||||
setParameterEntryInUse(LLNetworkData::PARAMS_MIRROR, TRUE, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
setParameterEntryInUse(LLNetworkData::PARAMS_MIRROR, FALSE, true);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
updateMirrorDrawable();
|
||||
|
||||
return was_mirror != is_mirror;
|
||||
}
|
||||
|
||||
void LLVOVolume::updateMirrorDrawable()
|
||||
{
|
||||
if (isMirror())
|
||||
{
|
||||
gPipeline.mHeroProbeManager.registerHeroDrawable(mDrawable);
|
||||
}
|
||||
else
|
||||
{
|
||||
gPipeline.mHeroProbeManager.unregisterHeroDrawable(mDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLVOVolume::isMirror() const
|
||||
{
|
||||
return getParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE);
|
||||
}
|
||||
|
||||
BOOL LLVOVolume::isReflectionProbe() const
|
||||
|
|
|
|||
|
|
@ -209,7 +209,6 @@ public:
|
|||
/*virtual*/ S32 setTEBumpmap(const U8 te, const U8 bump) override;
|
||||
/*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny) override;
|
||||
/*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright) override;
|
||||
/*virtual*/ S32 setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target) override;
|
||||
/*virtual*/ S32 setTEBumpShinyFullbright(const U8 te, const U8 bump) override;
|
||||
/*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags) override;
|
||||
/*virtual*/ S32 setTEGlow(const U8 te, const F32 glow) override;
|
||||
|
|
@ -295,6 +294,10 @@ public:
|
|||
F32 getLightRadius() const;
|
||||
F32 getLightFalloff(const F32 fudge_factor = 1.f) const;
|
||||
F32 getLightCutoff() const;
|
||||
|
||||
// Mirrors
|
||||
bool setIsMirror(BOOL is_mirror);
|
||||
void updateMirrorDrawable();
|
||||
|
||||
// Reflection Probes
|
||||
bool setIsReflectionProbe(BOOL is_probe);
|
||||
|
|
|
|||
|
|
@ -2406,7 +2406,15 @@ even though the user gets a free copy.
|
|||
name="object_horizontal"
|
||||
top_pad="10"
|
||||
width="278" />
|
||||
|
||||
<check_box
|
||||
height="16"
|
||||
label="Mirror"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="Mirror Checkbox Ctrl"
|
||||
tool_tip="Causes object to be a mirror"
|
||||
top_pad="8"
|
||||
width="60" />
|
||||
<check_box
|
||||
height="16"
|
||||
label="Light"
|
||||
|
|
|
|||
Loading…
Reference in New Issue