diff options
Diffstat (limited to 'indra/newview')
40 files changed, 574 insertions, 265 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 87952fb47c..5ed4ad2259 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1424,9 +1424,7 @@ if (WINDOWS) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES - # *TODO -reenable this once we get server usage sorted out - #LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:\"__tcmalloc\"" - LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS" + LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" LINK_FLAGS_RELEASE ${release_flags} ) @@ -1642,6 +1640,7 @@ if (WINDOWS) endif (WINDOWS) target_link_libraries(${VIEWER_BINARY_NAME} + ${GOOGLE_PERFTOOLS_LIBRARIES} ${LLAUDIO_LIBRARIES} ${LLCHARACTER_LIBRARIES} ${LLIMAGE_LIBRARIES} @@ -1678,7 +1677,6 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} ${LLLOGIN_LIBRARIES} - ${GOOGLE_PERFTOOLS_LIBRARIES} ${LLCONVEXDECOMP_LIBRARY} ) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f140547497..c07d891800 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1360,10 +1360,8 @@ bool LLAppViewer::cleanup() llinfos << "Cleaning Up" << llendflush; -#if LL_MESH_ENABLED // shut down mesh streamer gMeshRepo.shutdown(); -#endif // Must clean up texture references before viewer window is destroyed. LLHUDManager::getInstance()->updateEffects(); @@ -1761,10 +1759,8 @@ bool LLAppViewer::initThreads() mFastTimerLogThread->start(); } -#if LL_MESH_ENABLED // Mesh streaming and caching gMeshRepo.init(); -#endif LLFilePickerThread::initClass(); diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index afb76735ec..d44fb84f14 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -305,7 +305,6 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content) { } -#if LL_MESH_ENABLED LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, @@ -427,7 +426,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE); } -#endif LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, const LLUUID& vfile_id, @@ -677,7 +675,6 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) } -#if LL_MESH_ENABLED ///////////////////////////////////////////////////// // LLNewAgentInventoryVariablePriceResponder::Impl // ///////////////////////////////////////////////////// @@ -1145,5 +1142,5 @@ void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder>(this))); } } -#endif + diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index a85e84e9f8..268220d4a6 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -34,7 +34,6 @@ #define LL_LLASSETUPLOADRESPONDER_H #include "llhttpclient.h" -#include "llvolume.h" //for LL_MESH_ENABLED // Abstract class for supporting asset upload // via capabilities @@ -62,7 +61,6 @@ protected: std::string mFileName; }; -#if LL_MESH_ENABLED // TODO*: Remove this once deprecated class LLNewAgentInventoryResponder : public LLAssetUploadResponder { @@ -116,7 +114,6 @@ private: class Impl; Impl* mImpl; }; -#endif struct LLBakedUploadData; class LLSendTexLayerResponder : public LLAssetUploadResponder diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 68f52e04bc..efbb62011c 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -189,6 +189,11 @@ LLVOVolume* LLDrawable::getVOVolume() const } } +const LLMatrix4& LLDrawable::getRenderMatrix() const +{ + return isRoot() ? getWorldMatrix() : getParent()->getWorldMatrix(); +} + BOOL LLDrawable::isLight() const { LLViewerObject* objectp = mVObjp; @@ -713,8 +718,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) LLVOVolume* volume = getVOVolume(); if (volume) { - volume->updateRelativeXform(); - pos = volume->getRelativeXform().getTranslation(); + pos.set(getPositionGroup().getF32ptr()); if (isStatic()) { pos += volume->getRegion()->getOriginAgent(); diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index fc90bc57c4..a17e2172aa 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -101,7 +101,7 @@ public: LLVOVolume* getVOVolume() const; // cast mVObjp tp LLVOVolume if OK const LLMatrix4& getWorldMatrix() const { return mXform.getWorldMatrix(); } - const LLMatrix4& getRenderMatrix() const { return isRoot() ? getWorldMatrix() : getParent()->getWorldMatrix(); } + const LLMatrix4& getRenderMatrix() const; void setPosition(LLVector3 v) const { } const LLVector3& getPosition() const { return mXform.getPosition(); } const LLVector3& getWorldPosition() const { return mXform.getPositionW(); } @@ -250,35 +250,37 @@ public: typedef enum e_drawable_flags { - IN_REBUILD_Q1 = 0x00000002, - IN_REBUILD_Q2 = 0x00000004, - IN_LIGHT_Q = 0x00000008, - EARLY_MOVE = 0x00000010, - MOVE_UNDAMPED = 0x00000020, - ON_MOVE_LIST = 0x00000040, - USE_BACKLIGHT = 0x00000080, - UV = 0x00000100, - UNLIT = 0x00000200, - LIGHT = 0x00000400, - LIGHTING_BUILT = 0x00000800, - REBUILD_VOLUME = 0x00001000, //volume changed LOD or parameters, or vertex buffer changed - REBUILD_TCOORD = 0x00002000, //texture coordinates changed - REBUILD_COLOR = 0x00004000, //color changed - REBUILD_POSITION= 0x00010000, //vertex positions/normals changed + IN_REBUILD_Q1 = 0x00000001, + IN_REBUILD_Q2 = 0x00000002, + IN_LIGHT_Q = 0x00000004, + EARLY_MOVE = 0x00000008, + MOVE_UNDAMPED = 0x00000010, + ON_MOVE_LIST = 0x00000020, + USE_BACKLIGHT = 0x00000040, + UV = 0x00000080, + UNLIT = 0x00000100, + LIGHT = 0x00000200, + LIGHTING_BUILT = 0x00000400, + REBUILD_VOLUME = 0x00000800, //volume changed LOD or parameters, or vertex buffer changed + REBUILD_TCOORD = 0x00001000, //texture coordinates changed + REBUILD_COLOR = 0x00002000, //color changed + REBUILD_POSITION= 0x00004000, //vertex positions/normals changed REBUILD_GEOMETRY= REBUILD_POSITION|REBUILD_TCOORD|REBUILD_COLOR, REBUILD_MATERIAL= REBUILD_TCOORD|REBUILD_COLOR, REBUILD_ALL = REBUILD_GEOMETRY|REBUILD_VOLUME, - ON_SHIFT_LIST = 0x00100000, - BLOCKER = 0x00400000, - ACTIVE = 0x00800000, - DEAD = 0x01000000, - INVISIBLE = 0x02000000, // stay invisible until flag is cleared - NEARBY_LIGHT = 0x04000000, // In gPipeline.mNearbyLightSet - BUILT = 0x08000000, - FORCE_INVISIBLE = 0x10000000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned) - CLEAR_INVISIBLE = 0x20000000, // clear FORCE_INVISIBLE next draw frame - REBUILD_SHADOW = 0x40000000, - HAS_ALPHA = 0x80000000, + REBUILD_RIGGED = 0x00008000, + ON_SHIFT_LIST = 0x00010000, + BLOCKER = 0x00020000, + ACTIVE = 0x00040000, + DEAD = 0x00080000, + INVISIBLE = 0x00100000, // stay invisible until flag is cleared + NEARBY_LIGHT = 0x00200000, // In gPipeline.mNearbyLightSet + BUILT = 0x00400000, + FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned) + CLEAR_INVISIBLE = 0x01000000, // clear FORCE_INVISIBLE next draw frame + REBUILD_SHADOW = 0x02000000, + HAS_ALPHA = 0x04000000, + RIGGED = 0x08000000, } EDrawableFlags; LLXformMatrix mXform; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ccc060f3fa..e09e40671d 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -105,7 +105,6 @@ S32 normal_channel = -1; S32 specular_channel = -1; S32 cube_channel = -1; -#if LL_MESH_ENABLED static const U32 rigged_data_mask[] = { LLDrawPoolAvatar::RIGGED_SIMPLE_MASK, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_MASK, @@ -117,7 +116,6 @@ static const U32 rigged_data_mask[] = { LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP_MASK, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE_MASK, }; -#endif static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow"); @@ -198,14 +196,12 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) case 2: beginDeferredSkinned(); break; -#if LL_MESH_ENABLED case 3: beginDeferredRiggedSimple(); break; case 4: beginDeferredRiggedBump(); break; -#endif } } @@ -232,14 +228,12 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) case 2: endDeferredSkinned(); break; -#if LL_MESH_ENABLED case 3: endDeferredRiggedSimple(); break; case 4: endDeferredRiggedBump(); break; -#endif } } @@ -250,11 +244,7 @@ void LLDrawPoolAvatar::renderDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumPostDeferredPasses() { -#if LL_MESH_ENABLED return 6; -#else - return 1; -#endif } void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) @@ -264,7 +254,6 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) case 0: beginPostDeferredAlpha(); break; -#if LL_MESH_ENABLED case 1: beginRiggedFullbright(); break; @@ -280,7 +269,6 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) case 5: beginRiggedGlow(); break; -#endif } } @@ -298,7 +286,6 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha() enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); } -#if LL_MESH_ENABLED void LLDrawPoolAvatar::beginDeferredRiggedAlpha() { sVertexProgram = &gDeferredSkinnedAlphaProgram; @@ -316,7 +303,6 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha() LLVertexBuffer::sWeight4Loc = -1; sVertexProgram = NULL; } -#endif void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) { @@ -325,7 +311,6 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) case 0: endPostDeferredAlpha(); break; -#if LL_MESH_ENABLED case 1: endRiggedFullbright(); break; @@ -341,7 +326,6 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) case 5: endRiggedGlow(); break; -#endif } } @@ -375,11 +359,7 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumShadowPasses() { -#if LL_MESH_ENABLED return 2; -#else - return 1; -#endif } void LLDrawPoolAvatar::beginShadowPass(S32 pass) @@ -470,7 +450,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } -#if LL_MESH_ENABLED else { renderRigged(avatarp, RIGGED_SIMPLE); @@ -480,12 +459,10 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) renderRigged(avatarp, RIGGED_SHINY); renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); } -#endif } S32 LLDrawPoolAvatar::getNumPasses() { -#if LL_MESH_ENABLED if (LLPipeline::sImpostorRender) { return 8; @@ -494,7 +471,6 @@ S32 LLDrawPoolAvatar::getNumPasses() { return 10; } -#else if (LLPipeline::sImpostorRender) { return 1; @@ -503,7 +479,6 @@ S32 LLDrawPoolAvatar::getNumPasses() { return 3; } -#endif } @@ -554,7 +529,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) case 2: beginSkinned(); break; -#if LL_MESH_ENABLED case 3: beginRiggedSimple(); break; @@ -576,7 +550,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) case 9: beginRiggedGlow(); break; -#endif } } @@ -600,7 +573,6 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) case 2: endSkinned(); break; -#if LL_MESH_ENABLED case 3: endRiggedSimple(); break; @@ -622,7 +594,6 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) case 9: endRiggedGlow(); break; -#endif } } @@ -808,7 +779,6 @@ void LLDrawPoolAvatar::endSkinned() gGL.getTexUnit(0)->activate(); } -#if LL_MESH_ENABLED void LLDrawPoolAvatar::beginRiggedSimple() { if (sShaderLevel > 0) @@ -1056,7 +1026,6 @@ void LLDrawPoolAvatar::endDeferredRiggedBump() sDiffuseChannel = 0; sVertexProgram = NULL; } -#endif void LLDrawPoolAvatar::beginDeferredSkinned() { @@ -1202,7 +1171,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } -#if LL_MESH_ENABLED if (pass == 3) { if (is_deferred_render) @@ -1284,7 +1252,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) gGL.setSceneBlendType(LLRender::BT_ALPHA); return; } -#endif if (sShaderLevel > 0) { @@ -1322,9 +1289,14 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } } -#if LL_MESH_ENABLED void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { + LLVector4a* weight = vol_face.mWeights; + if (!weight) + { + return; + } + LLVertexBuffer* buffer = face->mVertexBuffer; U32 data_mask = 0; @@ -1403,8 +1375,6 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* } } - LLVector4a* weight = vol_face.mWeights; - LLMatrix4a bind_shape_matrix; bind_shape_matrix.loadu(skin->mBindShapeMatrix); @@ -1422,7 +1392,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* { F32 w = weight[j][k]; - idx[k] = (S32) floorf(w); + idx[k] = llclamp((S32) floorf(w), 0, 63); wght[k] = w - floorf(w); scale += wght[k]; } @@ -1627,8 +1597,6 @@ void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar) { renderRigged(avatar, RIGGED_GLOW, true); } -#endif - //----------------------------------------------------------------------------- @@ -1729,7 +1697,6 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const return LLColor3(0.f, 1.f, 0.f); } -#if LL_MESH_ENABLED void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) { if (facep->mRiggedIndex.empty()) @@ -1784,7 +1751,6 @@ void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) } } } -#endif LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index d08ae04516..7d7f9319ed 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -34,7 +34,6 @@ #define LL_LLDRAWPOOLAVATAR_H #include "lldrawpool.h" -#include "llvolume.h" // for LL_MESH_ENABLED class LLVOAvatar; class LLGLSLShader; @@ -113,7 +112,6 @@ public: void beginPostDeferredAlpha(); void endPostDeferredAlpha(); -#if LL_MESH_ENABLED void beginRiggedSimple(); void beginRiggedFullbright(); void beginRiggedFullbrightShiny(); @@ -205,7 +203,6 @@ public: void removeRiggedFace(LLFace* facep); std::vector<LLFace*> mRiggedFace[NUM_RIGGED_PASSES]; -#endif /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 7c24eb77cd..29edbc2b03 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -212,13 +212,11 @@ void LLFace::destroy() if (mDrawPoolp) { -#if LL_MESH_ENABLED if (this->isState(LLFace::RIGGED) && mDrawPoolp->getType() == LLDrawPool::POOL_AVATAR) { ((LLDrawPoolAvatar*) mDrawPoolp)->removeRiggedFace(this); } else -#endif { mDrawPoolp->removeFace(this); } @@ -556,8 +554,36 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) } glColor4fv(color.mV); - mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); - mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); + + if (mDrawablep->isState(LLDrawable::RIGGED)) + { + LLVOVolume* volume = mDrawablep->getVOVolume(); + if (volume) + { + LLRiggedVolume* rigged = volume->getRiggedVolume(); + if (rigged) + { + LLGLEnable offset(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(-1.f, -1.f); + glMultMatrixf((F32*) volume->getRelativeXform().mMatrix); + const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset()); + LLVertexBuffer::unbind(); + glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); + if (vol_face.mTexCoords) + { + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); + } + glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + } + } + } + else + { + mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); + mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + } gGL.popMatrix(); } @@ -720,7 +746,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, LLMemType mt1(LLMemType::MTYPE_DRAWABLE); //get bounding box - if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION)) + if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED)) { //VECTORIZE THIS LLMatrix4a mat_vert; diff --git a/indra/newview/llfloaterimportcollada.cpp b/indra/newview/llfloaterimportcollada.cpp index 476c02cd46..000347f68c 100644 --- a/indra/newview/llfloaterimportcollada.cpp +++ b/indra/newview/llfloaterimportcollada.cpp @@ -74,8 +74,6 @@ // floater // -#if LL_MESH_ENABLED - LLFloaterImportCollada::LLFloaterImportCollada(const LLSD& key) : LLFloater(key) { @@ -1113,4 +1111,3 @@ void LLImportCollada::onCommitCancel(LLUICtrl*, void*) getInstance()->endImport(); } -#endif diff --git a/indra/newview/llfloaterimportcollada.h b/indra/newview/llfloaterimportcollada.h index 818b19e403..4eb263901b 100644 --- a/indra/newview/llfloaterimportcollada.h +++ b/indra/newview/llfloaterimportcollada.h @@ -34,9 +34,6 @@ #define LL_LLFLOATERIMPORTCOLLADA_H #include "llfloater.h" -#include "llvolume.h" //for LL_MESH_ENABLED - -#if LL_MESH_ENABLED class LLFloaterImportCollada : public LLFloater { @@ -138,6 +135,4 @@ private: LLMatrix4 mSceneTransformation; }; -#endif - #endif // LL_LLFLOATERIMPORTCOLLADA_H diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 85035fb961..088c9e6546 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -98,9 +98,6 @@ #include "glod/glod.h" - -#if LL_MESH_ENABLED - //static S32 LLFloaterModelPreview::sUploadAmount = 10; LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL; @@ -2603,6 +2600,9 @@ void LLModelPreview::genLODs(S32 which_lod) target_model->mInvBindMatrix = base->mInvBindMatrix; target_model->mBindShapeMatrix = base->mBindShapeMatrix; + //copy material list + target_model->mMaterialList = base->mMaterialList; + if (!validate_model(target_model)) { llerrs << "Invalid model generated when creating LODs" << llendl; @@ -3434,5 +3434,3 @@ void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture preview->refresh(); } -#endif - diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 97e681a6a8..148687aecd 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -40,7 +40,6 @@ #include "llmodel.h" #include "llthread.h" -#if LL_MESH_ENABLED class LLComboBox; class LLJoint; class LLViewerJointMesh; @@ -272,6 +271,4 @@ protected: static S32 sUploadAmount; }; -#endif - #endif // LL_LLFLOATERMODELPREVIEW_H diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index fa5d9b0892..653f838779 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1016,10 +1016,12 @@ S32 LLFloaterTools::calcRenderCost() LLSelectNode *select_node = *selection_iter; if (select_node) { - LLVOVolume *viewer_volume = (LLVOVolume*)select_node->getObject(); - if (viewer_volume) + LLViewerObject *vobj = select_node->getObject(); + if (vobj->getVolume()) { - cost += viewer_volume->getRenderCost(textures); + LLVOVolume* volume = (LLVOVolume*) vobj; + + cost += volume->getRenderCost(textures); for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) { // add the cost of each individual texture in the linkset diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b03947f54d..eb23ab95dd 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -920,7 +920,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, root, uuid); break; -#if LL_MESH_ENABLED case LLAssetType::AT_MESH: if(!(inv_type == LLInventoryType::IT_MESH)) { @@ -928,7 +927,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, } new_listener = new LLMeshBridge(inventory, root, uuid); break; -#endif default: llinfos << "Unhandled asset type (llassetstorage.h): " @@ -2690,9 +2688,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_LINK: -#if LL_MESH_ENABLED case DAD_MESH: -#endif accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, drop); break; @@ -3602,9 +3598,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: -#if LL_MESH_ENABLED case DAD_MESH: -#endif { LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; const LLPermissions& perm = inv_item->getPermissions(); @@ -4793,7 +4787,6 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -#if LL_MESH_ENABLED // +=================================================+ // | LLMeshBridge | // +=================================================+ @@ -4850,7 +4843,6 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -#endif // +=================================================+ // | LLLinkBridge | diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 4c6c3ab82f..e1bfff7e0c 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -40,7 +40,6 @@ #include "llinventoryobserver.h" #include "llviewercontrol.h" #include "llwearable.h" -#include "llvolume.h" //for LL_MESH_ENABLED class LLInventoryPanel; class LLInventoryModel; @@ -530,7 +529,6 @@ protected: }; -#if LL_MESH_ENABLED class LLMeshBridge : public LLItemBridge { friend class LLInvFVBridge; @@ -546,8 +544,6 @@ protected: const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} }; -#endif - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llmeshreduction.cpp b/indra/newview/llmeshreduction.cpp index e785784a32..f56d97abbf 100644 --- a/indra/newview/llmeshreduction.cpp +++ b/indra/newview/llmeshreduction.cpp @@ -37,8 +37,6 @@ #include "glod/glod.h" -#if LL_MESH_ENABLED - static BOOL stop_gloderror() { GLuint error = glodGetError(); @@ -287,5 +285,4 @@ LLPointer<LLModel> LLMeshReduction::reduce(LLModel* in_model, F32 limit, S32 mod return out_model; } -#endif diff --git a/indra/newview/llmeshreduction.h b/indra/newview/llmeshreduction.h index d86696978d..9a7eaa082f 100644 --- a/indra/newview/llmeshreduction.h +++ b/indra/newview/llmeshreduction.h @@ -34,8 +34,6 @@ #include "llmodel.h" -#if LL_MESH_ENABLED - class LLMeshReduction { public: @@ -54,6 +52,4 @@ private: U32 mCounter; }; -#endif - #endif // LL_LLMESHREDUCTION_H diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 069642b711..ecf75415ab 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -68,8 +68,6 @@ #include <queue> -#if LL_MESH_ENABLED - LLFastTimer::DeclareTimer FTM_MESH_UPDATE("Mesh Update"); LLFastTimer::DeclareTimer FTM_LOAD_MESH("Load Mesh"); @@ -2395,6 +2393,13 @@ LLSD LLMeshUploadThread::createObject(LLModelInstance& instance) extra_parameter["param_data"] = v; object_params["extra_parameters"].append(extra_parameter); + LLPermissions perm; + perm.setNextOwnerBits(gAgent.getID(), LLUUID::null, TRUE, LLFloaterPerms::getNextOwnerPerms()); + perm.setGroupBits(gAgent.getID(), LLUUID::null, TRUE, LLFloaterPerms::getGroupPerms()); + perm.setEveryoneBits(gAgent.getID(), LLUUID::null, TRUE, LLFloaterPerms::getEveryonePerms()); + + object_params["permissions"] = ll_create_sd_from_permissions(perm); + return object_params; } @@ -2696,5 +2701,4 @@ void LLPhysicsDecomp::run() mDone = true; } -#endif diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index b26598ce31..a2f403e214 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -39,8 +39,6 @@ #include "llviewertexture.h" #include "llvolume.h" -#if LL_MESH_ENABLED - #define LLCONVEXDECOMPINTER_STATIC 1 #include "llconvexdecomposition.h" @@ -466,5 +464,3 @@ extern LLMeshRepository gMeshRepo; #endif -#endif - diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 91166b0f5b..e900c0bdaf 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -159,9 +159,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_CALLINGCARD: -#if LL_MESH_ENABLED case DAD_MESH: -#endif { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index a2dd8b4d6d..87c3ee4552 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -818,9 +818,7 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_CALLINGCARD: -#if LL_MESH_ENABLED case DAD_MESH: -#endif accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data); if(accept && drop) { @@ -1246,7 +1244,6 @@ LLUIImagePtr LLTaskWearableBridge::getIcon() const return LLInventoryIcon::getIcon(mAssetType, mInventoryType, mFlags, FALSE ); } -#if LL_MESH_ENABLED ///---------------------------------------------------------------------------- /// Class LLTaskMeshBridge ///---------------------------------------------------------------------------- @@ -1358,8 +1355,6 @@ void LLTaskMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -#endif - ///---------------------------------------------------------------------------- /// LLTaskInvFVBridge impl //---------------------------------------------------------------------------- @@ -1439,13 +1434,11 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* object->getUUID(), object->getName()); break; -#if LL_MESH_ENABLED case LLAssetType::AT_MESH: new_bridge = new LLTaskMeshBridge(panel, object->getUUID(), object->getName()); break; -#endif default: llinfos << "Unhandled inventory type (llassetstorage.h): " << (S32)type << llendl; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ff2929695d..21f7e780e2 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5395,6 +5395,42 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) return (mPermissions->allowOperationBy(op, proxy_agent_id, group_id)); } + +//helper function for pushing relevant vertices from drawable to GL +void pushWireframe(LLDrawable* drawable) +{ + if (drawable->isState(LLDrawable::RIGGED)) + { //render straight from rigged volume if this is a rigged attachment + LLVOVolume* vobj = drawable->getVOVolume(); + if (vobj) + { + vobj->updateRiggedVolume(); + LLRiggedVolume* rigged_volume = vobj->getRiggedVolume(); + if (rigged_volume) + { + LLVertexBuffer::unbind(); + gGL.pushMatrix(); + glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix); + for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i) + { + const LLVolumeFace& face = rigged_volume->getVolumeFace(i); + glVertexPointer(3, GL_FLOAT, 16, face.mPositions); + glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + } + gGL.popMatrix(); + } + } + } + else + { + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } + } +} + void LLSelectNode::renderOneWireframe(const LLColor4& color) { LLViewerObject* objectp = getObject(); @@ -5442,11 +5478,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); { glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); - for (S32 i = 0; i < drawable->getNumFaces(); ++i) - { - LLFace* face = drawable->getFace(i); - pushVerts(face, LLVertexBuffer::MAP_VERTEX); - } + pushWireframe(drawable); } } @@ -5455,13 +5487,9 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); LLGLEnable offset(GL_POLYGON_OFFSET_LINE); - glPolygonOffset(3.f, 2.f); + glPolygonOffset(3.f, 3.f); glLineWidth(3.f); - for (S32 i = 0; i < drawable->getNumFaces(); ++i) - { - LLFace* face = drawable->getFace(i); - pushVerts(face, LLVertexBuffer::MAP_VERTEX); - } + pushWireframe(drawable); glLineWidth(1.f); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); gGL.popMatrix(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 425fa42339..56be8af599 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2789,7 +2789,6 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) U32 data_mask = LLVertexBuffer::MAP_VERTEX; -#if LL_MESH_ENABLED if (volume->isMesh()) { LLUUID mesh_id = volume->getVolume()->getParams().getSculptID(); @@ -2826,7 +2825,6 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) return; } } -#endif //LL_MESH_ENABLED //push faces glColor3fv(color.mV); @@ -3035,11 +3033,11 @@ class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect { public: - LLRenderOctreeRaycast(const LLVector3& start, const LLVector3& end) + + LLRenderOctreeRaycast(const LLVector4a& start, const LLVector4a& dir, F32* closest_t) + : LLOctreeTriangleRayIntersect(start, dir, NULL, closest_t, NULL, NULL, NULL, NULL) { - mStart.load3(start.mV); - mEnd.load3(end.mV); - mDir.setSub(mEnd, mStart); + } void visit(const LLOctreeNode<LLVolumeTriangle>* branch) @@ -3047,9 +3045,22 @@ public: LLVolumeOctreeListener* vl = (LLVolumeOctreeListener*) branch->getListener(0); LLVector3 center, size; - center.set(vl->mBounds[0].getF32ptr()); - size.set(vl->mBounds[1].getF32ptr()); + + if (branch->getData().empty()) + { + gGL.color3f(1.f,0.2f,0.f); + center.set(branch->getCenter().getF32ptr()); + size.set(branch->getSize().getF32ptr()); + } + else + { + gGL.color3f(0.75f, 1.f, 0.f); + center.set(vl->mBounds[0].getF32ptr()); + size.set(vl->mBounds[1].getF32ptr()); + } + drawBoxOutline(center, size); + for (U32 i = 0; i < 2; i++) { LLGLDepthTest depth(GL_TRUE, GL_FALSE, i == 1 ? GL_LEQUAL : GL_GREATER); @@ -3061,9 +3072,14 @@ public: else { gGL.color4f(0,0.5f,0.5f, 0.25f); + drawBoxOutline(center, size); + } + + if (i == 1) + { + gGL.flush(); + glLineWidth(3.f); } - - drawBoxOutline(center, size); gGL.begin(LLRender::TRIANGLES); for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin(); @@ -3077,6 +3093,12 @@ public: gGL.vertex3fv(tri->mV[2]->getF32ptr()); } gGL.end(); + + if (i == 1) + { + gGL.flush(); + glLineWidth(1.f); + } } } }; @@ -3096,26 +3118,63 @@ void renderRaycast(LLDrawable* drawablep) LLVOVolume* vobj = drawablep->getVOVolume(); LLVolume* volume = vobj->getVolume(); - for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) + + bool transform = true; + if (drawablep->isState(LLDrawable::RIGGED)) { - const LLVolumeFace& face = volume->getVolumeFace(i); - if (!face.mOctree) + volume = vobj->getRiggedVolume(); + transform = false; + } + + if (volume) + { + for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { - ((LLVolumeFace*) &face)->createOctree(); - } + const LLVolumeFace& face = volume->getVolumeFace(i); + if (!face.mOctree) + { + ((LLVolumeFace*) &face)->createOctree(); + } - gGL.pushMatrix(); - glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix); - LLVector3 start, end; - start = vobj->agentPositionToVolume(gDebugRaycastStart); - end = vobj->agentPositionToVolume(gDebugRaycastEnd); + gGL.pushMatrix(); + glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix); - LLRenderOctreeRaycast render(start, end); - gGL.flush(); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - render.traverse(face.mOctree); - gGL.popMatrix(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + LLVector3 start, end; + if (transform) + { + start = vobj->agentPositionToVolume(gDebugRaycastStart); + end = vobj->agentPositionToVolume(gDebugRaycastEnd); + } + else + { + start = gDebugRaycastStart; + end = gDebugRaycastEnd; + } + + LLVector4a starta, enda; + starta.load3(start.mV); + enda.load3(end.mV); + LLVector4a dir; + dir.setSub(enda, starta); + + F32 t = 1.f; + + LLRenderOctreeRaycast render(starta, dir, &t); + gGL.flush(); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + { + //render face positions + LLVertexBuffer::unbind(); + glColor4f(0,1,1,0.5f); + glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); + glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + } + + render.traverse(face.mOctree); + gGL.popMatrix(); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } } } else if (drawablep->isAvatar()) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 3aaf5f0c9f..3d290b7875 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -295,10 +295,8 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( { BOOL handled = FALSE; - bool is_mesh = false; -#if LL_MESH_ENABLED - is_mesh = cargo_type == DAD_MESH; -#endif + bool is_mesh = cargo_type == DAD_MESH; + if ((cargo_type == DAD_TEXTURE) || is_mesh) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; @@ -1214,10 +1212,8 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, // returns true, then the cast was valid, and we can perform // the third test without problems. LLInventoryItem* item = (LLInventoryItem*)cargo_data; - bool is_mesh = false; -#if LL_MESH_ENABLED - is_mesh = cargo_type == DAD_MESH; -#endif + bool is_mesh = cargo_type == DAD_MESH; + if (getEnabled() && ((cargo_type == DAD_TEXTURE) || is_mesh) && allowDrop(item)) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index b7dc624beb..6f38b0cd65 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -331,9 +331,7 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() addEntry(DAD_ANIMATION, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_GESTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dActivateGesture, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_LINK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); -#if LL_MESH_ENABLED addEntry(DAD_MESH, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dMeshObject, &LLToolDragAndDrop::dad3dNULL)); -#endif // TODO: animation on self could play it? edit it? // TODO: gesture on self could play it? edit it? }; @@ -1037,7 +1035,6 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, hit_obj->sendTEUpdate(); } -#if LL_MESH_ENABLED void LLToolDragAndDrop::dropMesh(LLViewerObject* hit_obj, LLInventoryItem* item, LLToolDragAndDrop::ESource source, @@ -1062,7 +1059,6 @@ void LLToolDragAndDrop::dropMesh(LLViewerObject* hit_obj, dialog_refresh_all(); } -#endif /* void LLToolDragAndDrop::dropTextureOneFaceAvatar(LLVOAvatar* avatar, S32 hit_face, LLInventoryItem* item) @@ -1505,9 +1501,7 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ case DAD_ANIMATION: case DAD_GESTURE: case DAD_CALLINGCARD: -#if LL_MESH_ENABLED case DAD_MESH: -#endif { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) @@ -1864,12 +1858,10 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject( dropTextureOneFace(obj, face, item, mSource, mSourceID); } } -#if LL_MESH_ENABLED else if (cargo_type == DAD_MESH) { dropMesh(obj, item, mSource, mSourceID); } -#endif else { llwarns << "unsupported asset type" << llendl; @@ -1894,15 +1886,11 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject( return dad3dApplyToObject(obj, face, mask, drop, DAD_TEXTURE); } -#if LL_MESH_ENABLED EAcceptance LLToolDragAndDrop::dad3dMeshObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { return dad3dApplyToObject(obj, face, mask, drop, DAD_MESH); } -#endif - - /* diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 09da4c2955..596cc2ee88 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -43,7 +43,6 @@ #include "llpermissions.h" #include "llwindow.h" #include "llviewerinventory.h" -#include "llvolume.h" //for LL_MESH_ENABLED class LLToolDragAndDrop; class LLViewerRegion; @@ -155,10 +154,8 @@ protected: MASK mask, BOOL drop); EAcceptance dad3dTextureObject(LLViewerObject* obj, S32 face, MASK mask, BOOL drop); -#if LL_MESH_ENABLED EAcceptance dad3dMeshObject(LLViewerObject* obj, S32 face, MASK mask, BOOL drop); -#endif // EAcceptance dad3dTextureSelf(LLViewerObject* obj, S32 face, // MASK mask, BOOL drop); EAcceptance dad3dWearItem(LLViewerObject* obj, S32 face, @@ -245,12 +242,10 @@ public: LLInventoryItem* item, ESource source, const LLUUID& src_id); -#if LL_MESH_ENABLED static void dropMesh(LLViewerObject* hit_obj, LLInventoryItem* item, ESource source, const LLUUID& src_id); -#endif //static void dropTextureOneFaceAvatar(LLVOAvatar* avatar,S32 hit_face, // LLInventoryItem* item) diff --git a/indra/newview/llviewerassettype.cpp b/indra/newview/llviewerassettype.cpp index 370767002a..4c088a72b7 100644 --- a/indra/newview/llviewerassettype.cpp +++ b/indra/newview/llviewerassettype.cpp @@ -85,9 +85,7 @@ LLViewerAssetDictionary::LLViewerAssetDictionary() addEntry(LLViewerAssetType::AT_LINK, new ViewerAssetEntry(DAD_LINK)); addEntry(LLViewerAssetType::AT_LINK_FOLDER, new ViewerAssetEntry(DAD_LINK)); -#if LL_MESH_ENABLED addEntry(LLViewerAssetType::AT_MESH, new ViewerAssetEntry(DAD_MESH)); -#endif addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE)); }; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index e165837209..eface0f61d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -176,9 +176,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>); LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>); -#if LL_MESH_ENABLED LLFloaterReg::add("import_collada", "floater_import_collada.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImportCollada>); -#endif LLFloaterReg::add("im_container", "floater_im_container.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloaterContainer>); LLFloaterReg::add("im_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMWellWindow>); LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); @@ -258,9 +256,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload"); LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload"); LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); -#if LL_MESH_ENABLED LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload"); -#endif LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceEffect>); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 20de01b78a..0460ac0988 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -350,7 +350,6 @@ class LLFileUploadImage : public view_listener_t } }; -#if LL_MESH_ENABLED class LLFileUploadScene : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -377,7 +376,6 @@ class LLFileUploadModel : public view_listener_t return TRUE; } }; -#endif class LLFileUploadSound : public view_listener_t { @@ -1186,7 +1184,6 @@ void upload_new_resource( lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << llendl; lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; -#if LL_MESH_ENABLED std::string url = gAgent.getRegion()->getCapability( "NewFileAgentInventory"); @@ -1216,7 +1213,6 @@ void upload_new_resource( LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); } else -#endif { llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl; // check for adequate funds @@ -1264,7 +1260,6 @@ void upload_new_resource( } } -#if LL_MESH_ENABLED BOOL upload_new_variable_price_resource( const LLTransactionID &tid, LLAssetType::EType asset_type, @@ -1336,7 +1331,6 @@ BOOL upload_new_variable_price_resource( return FALSE; } } -#endif LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid) { @@ -1407,10 +1401,8 @@ void init_menu_file() view_listener_t::addCommit(new LLFileUploadImage(), "File.UploadImage"); view_listener_t::addCommit(new LLFileUploadSound(), "File.UploadSound"); view_listener_t::addCommit(new LLFileUploadAnim(), "File.UploadAnim"); -#if LL_MESH_ENABLED view_listener_t::addCommit(new LLFileUploadModel(), "File.UploadModel"); view_listener_t::addCommit(new LLFileUploadScene(), "File.UploadScene"); -#endif view_listener_t::addCommit(new LLFileUploadBulk(), "File.UploadBulk"); view_listener_t::addCommit(new LLFileCloseWindow(), "File.CloseWindow"); view_listener_t::addCommit(new LLFileCloseAllWindows(), "File.CloseAllWindows"); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index bb7cfce862..08444551a9 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -74,7 +74,6 @@ void upload_new_resource( S32 expected_upload_cost, void *userdata); -#if LL_MESH_ENABLED // TODO* : Move all uploads to use this new function // since at some point, that upload path will be deprecated and no longer // used @@ -92,7 +91,6 @@ BOOL upload_new_variable_price_resource( U32 everyone_perms, const std::string& display_name, const LLSD& asset_resources); -#endif LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid); void increase_new_upload_stats(LLAssetType::EType asset_type); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index fd2212f25d..4c1a1958e8 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3279,6 +3279,15 @@ const LLVector3 LLViewerObject::getPositionEdit() const const LLVector3 LLViewerObject::getRenderPosition() const { + if (mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED)) + { + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + return avatar->getPositionAgent(); + } + } + if (mDrawable.isNull() || mDrawable->getGeneration() < 0) { return getPositionAgent(); @@ -3297,6 +3306,11 @@ const LLVector3 LLViewerObject::getPivotPositionAgent() const const LLQuaternion LLViewerObject::getRenderRotation() const { LLQuaternion ret; + if (mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED)) + { + return ret; + } + if (mDrawable.isNull() || mDrawable->isStatic()) { ret = getRotationEdit(); diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 84a42611a4..109add5552 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -543,9 +543,7 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; -#if LL_MESH_ENABLED case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; -#endif default: llassert(0); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 430f83307a..28bcdff7bd 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -604,10 +604,8 @@ public: if (gSavedSettings.getBOOL("DebugShowUploadCost")) { -#if LL_MESH_ENABLED addText(xpos, ypos, llformat(" Meshes: L$%d", gPipeline.mDebugMeshUploadCost)); ypos += y_inc/2; -#endif addText(xpos, ypos, llformat(" Sculpties: L$%d", gPipeline.mDebugSculptUploadCost)); ypos += y_inc/2; addText(xpos, ypos, llformat(" Textures: L$%d", gPipeline.mDebugTextureUploadCost)); @@ -617,7 +615,6 @@ public: ypos += y_inc; } -#if LL_MESH_ENABLED //temporary hack to give feedback on mesh upload progress if (!gMeshRepo.mUploads.empty()) { @@ -647,7 +644,6 @@ public: ypos += y_inc; } -#endif } void draw() diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5448e7dcd9..4ef050e71f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -41,9 +41,11 @@ #include "llviewercontrol.h" #include "lldir.h" #include "llflexibleobject.h" +#include "llfloatertools.h" #include "llmaterialtable.h" #include "llprimitive.h" #include "llvolume.h" +#include "llvolumeoctree.h" #include "llvolumemgr.h" #include "llvolumemessage.h" #include "material_codes.h" @@ -70,6 +72,7 @@ #include "llselectmgr.h" #include "pipeline.h" #include "llsdutil.h" +#include "llmatrix4a.h" #include "llmediaentry.h" #include "llmediadataclient.h" #include "llmeshrepository.h" @@ -943,7 +946,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool BOOL is404 = FALSE; -#if LL_MESH_ENABLED if (isSculpted()) { // if it's a mesh @@ -963,7 +965,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool } } } -#endif // Check if we need to change implementations bool is_flexible = (volume_params.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE); @@ -1012,7 +1013,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool if (isSculpted()) { updateSculptTexture(); -#if LL_MESH_ENABLED // if it's a mesh if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { @@ -1028,7 +1028,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool } } else // otherwise is sculptie -#endif { if (mSculptTexture.notNull()) { @@ -1355,7 +1354,14 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) LLVector4a min,max; - BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION); + BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED); + +// bool rigged = false; + LLVolume* volume = mRiggedVolume; + if (!volume) + { + volume = getVolume(); + } for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++) { @@ -1364,7 +1370,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) { continue; } - res &= face->genVolumeBBoxes(*getVolume(), i, + res &= face->genVolumeBBoxes(*volume, i, mRelativeXform, mRelativeXformInvTrans, (mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global); @@ -1415,7 +1421,21 @@ void LLVOVolume::updateRelativeXform() LLDrawable* drawable = mDrawable; - if (drawable->isActive()) + if (drawable->isState(LLDrawable::RIGGED) && mRiggedVolume.notNull()) + { //rigged volume (which is in agent space) is used for generating bounding boxes etc + //inverse of render matrix should go to partition space + mRelativeXform = getRenderMatrix(); + + F32* dst = (F32*) mRelativeXformInvTrans.mMatrix; + F32* src = (F32*) mRelativeXform.mMatrix; + dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; + dst[3] = src[4]; dst[4] = src[5]; dst[5] = src[6]; + dst[6] = src[8]; dst[7] = src[9]; dst[8] = src[10]; + + mRelativeXform.invert(); + mRelativeXformInvTrans.transpose(); + } + else if (drawable->isActive()) { // setup relative transforms LLQuaternion delta_rot; @@ -1497,11 +1517,22 @@ void LLVOVolume::updateRelativeXform() static LLFastTimer::DeclareTimer FTM_GEN_FLEX("Generate Flexies"); static LLFastTimer::DeclareTimer FTM_UPDATE_PRIMITIVES("Update Primitives"); +static LLFastTimer::DeclareTimer FTM_UPDATE_RIGGED_VOLUME("Update Rigged"); BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) { LLFastTimer t(FTM_UPDATE_PRIMITIVES); + if (mDrawable->isState(LLDrawable::REBUILD_RIGGED)) + { + { + LLFastTimer t(FTM_UPDATE_RIGGED_VOLUME); + updateRiggedVolume(); + } + genBBoxes(FALSE); + mDrawable->clearState(LLDrawable::REBUILD_RIGGED); + } + if (mVolumeImpl != NULL) { BOOL res; @@ -1597,7 +1628,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) { LLPipeline::sCompiles++; } - + mVolumeChanged = FALSE; mLODChanged = FALSE; mSculptChanged = FALSE; @@ -2690,7 +2721,6 @@ BOOL LLVOVolume::isSculpted() const BOOL LLVOVolume::isMesh() const { -#if LL_MESH_ENABLED if (isSculpted()) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); @@ -2702,8 +2732,6 @@ BOOL LLVOVolume::isMesh() const return TRUE; } } -#endif - return FALSE; } @@ -2724,6 +2752,11 @@ BOOL LLVOVolume::isVolumeGlobal() const { return mVolumeImpl->isVolumeGlobal() ? TRUE : FALSE; } + else if (mRiggedVolume.notNull()) + { + return TRUE; + } + return FALSE; } @@ -3218,7 +3251,6 @@ F32 LLVOVolume::getBinRadius() F32 scale = 1.f; -#if LL_MESH_ENABLED if (isSculpted()) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); @@ -3240,7 +3272,6 @@ F32 LLVOVolume::getBinRadius() scale = 1.f/llmax(vert_count/1024.f, 1.f); } } -#endif const LLVector4a* ext = mDrawable->getSpatialExtents(); @@ -3390,12 +3421,37 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e BOOL ret = FALSE; LLVolume* volume = getVolume(); + + bool transform = true; + + if (mDrawable->isState(LLDrawable::RIGGED)) + { + if (LLFloater::isVisible(gFloaterTools) && getAvatar()->isSelf()) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_RIGGED, TRUE); + volume = mRiggedVolume; + transform = false; + } + else + { //cannot pick rigged attachments on other avatars or when not in build mode + return FALSE; + } + } + if (volume) { LLVector3 v_start, v_end, v_dir; - v_start = agentPositionToVolume(start); - v_end = agentPositionToVolume(end); + if (transform) + { + v_start = agentPositionToVolume(start); + v_end = agentPositionToVolume(end); + } + else + { + v_start = start; + v_end = end; + } LLVector3 p; LLVector3 n; @@ -3455,18 +3511,40 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e if (intersection != NULL) { - *intersection = volumePositionToAgent(p); // must map back to agent space + if (transform) + { + *intersection = volumePositionToAgent(p); // must map back to agent space + } + else + { + *intersection = p; + } } if (normal != NULL) { - *normal = volumeDirectionToAgent(n); + if (transform) + { + *normal = volumeDirectionToAgent(n); + } + else + { + *normal = n; + } + (*normal).normVec(); } if (bi_normal != NULL) { - *bi_normal = volumeDirectionToAgent(bn); + if (transform) + { + *bi_normal = volumeDirectionToAgent(bn); + } + else + { + *bi_normal = bn; + } (*bi_normal).normVec(); } @@ -3484,6 +3562,201 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e return ret; } +bool LLVOVolume::treatAsRigged() +{ + return LLFloater::isVisible(gFloaterTools) && + isAttachment() && + getAvatar() && + getAvatar()->isSelf() && + mDrawable.notNull() && + mDrawable->isState(LLDrawable::RIGGED); +} + +LLRiggedVolume* LLVOVolume::getRiggedVolume() +{ + return mRiggedVolume; +} + +void LLVOVolume::clearRiggedVolume() +{ + if (mRiggedVolume.notNull()) + { + mRiggedVolume = NULL; + updateRelativeXform(); + } +} + +void LLVOVolume::updateRiggedVolume() +{ + //Update mRiggedVolume to match current animation frame of avatar. + //Also update position/size in octree. + + if (!treatAsRigged()) + { + clearRiggedVolume(); + + return; + } + + LLVolume* volume = getVolume(); + + const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(volume->getParams().getSculptID()); + + if (!skin) + { + clearRiggedVolume(); + return; + } + + LLVOAvatar* avatar = getAvatar(); + + if (!avatar) + { + clearRiggedVolume(); + return; + } + + if (!mRiggedVolume) + { + LLVolumeParams p; + mRiggedVolume = new LLRiggedVolume(p); + updateRelativeXform(); + } + + mRiggedVolume->update(skin, avatar, volume); + +} + +static LLFastTimer::DeclareTimer FTM_SKIN_RIGGED("Skin"); +static LLFastTimer::DeclareTimer FTM_RIGGED_OCTREE("Octree"); + +void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* volume) +{ + bool copy = false; + if (volume->getNumVolumeFaces() != getNumVolumeFaces()) + { + copy = true; + } + + for (S32 i = 0; i < volume->getNumVolumeFaces() && !copy; ++i) + { + const LLVolumeFace& src_face = volume->getVolumeFace(i); + const LLVolumeFace& dst_face = getVolumeFace(i); + + if (src_face.mNumIndices != dst_face.mNumIndices || + src_face.mNumVertices != dst_face.mNumVertices) + { + copy = true; + } + } + + if (copy) + { + copyVolumeFaces(volume); + } + + //build matrix palette + LLMatrix4a mp[64]; + LLMatrix4* mat = (LLMatrix4*) mp; + + for (U32 j = 0; j < skin->mJointNames.size(); ++j) + { + LLJoint* joint = avatar->getJoint(skin->mJointNames[j]); + if (joint) + { + mat[j] = skin->mInvBindMatrix[j]; + mat[j] *= joint->getWorldMatrix(); + } + } + + for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) + { + const LLVolumeFace& vol_face = volume->getVolumeFace(i); + + LLVolumeFace& dst_face = mVolumeFaces[i]; + + LLVector4a* weight = vol_face.mWeights; + + LLMatrix4a bind_shape_matrix; + bind_shape_matrix.loadu(skin->mBindShapeMatrix); + + LLVector4a* pos = dst_face.mPositions; + + { + LLFastTimer t(FTM_SKIN_RIGGED); + + for (U32 j = 0; j < dst_face.mNumVertices; ++j) + { + LLMatrix4a final_mat; + final_mat.clear(); + + S32 idx[4]; + + LLVector4 wght; + + F32 scale = 0.f; + for (U32 k = 0; k < 4; k++) + { + F32 w = weight[j][k]; + + idx[k] = (S32) floorf(w); + wght[k] = w - floorf(w); + scale += wght[k]; + } + + wght *= 1.f/scale; + + for (U32 k = 0; k < 4; k++) + { + F32 w = wght[k]; + + LLMatrix4a src; + src.setMul(mp[idx[k]], w); + + final_mat.add(src); + } + + + LLVector4a& v = vol_face.mPositions[j]; + LLVector4a t; + LLVector4a dst; + bind_shape_matrix.affineTransform(v, t); + final_mat.affineTransform(t, dst); + pos[j] = dst; + } + + //update bounding box + LLVector4a& min = dst_face.mExtents[0]; + LLVector4a& max = dst_face.mExtents[1]; + + min = pos[0]; + max = pos[1]; + + for (U32 j = 1; j < dst_face.mNumVertices; ++j) + { + min.setMin(min, pos[j]); + max.setMax(max, pos[j]); + } + + dst_face.mCenter->setAdd(dst_face.mExtents[0], dst_face.mExtents[1]); + dst_face.mCenter->mul(0.5f); + + } + + { + LLFastTimer t(FTM_RIGGED_OCTREE); + delete dst_face.mOctree; + dst_face.mOctree = NULL; + + LLVector4a size; + size.setSub(dst_face.mExtents[1], dst_face.mExtents[0]); + size.splat(size.getLength3().getF32()*0.5f); + + dst_face.createOctree(1.f); + } + } +} + U32 LLVOVolume::getPartitionType() const { if (isHUDAttachment()) @@ -3630,7 +3903,6 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); -#if LL_MESH_ENABLED static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) { LLVOAvatar* avatar = vobj->getAvatar(); @@ -3657,7 +3929,6 @@ static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) return NULL; } -#endif void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { @@ -3724,14 +3995,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::HAS_ALPHA); -#if LL_MESH_ENABLED bool rigged = vobj->isAttachment() && vobj->isMesh() && gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID()); -#endif bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic(); + bool is_rigged = false; + //for each face for (S32 i = 0; i < drawablep->getNumFaces(); i++) { @@ -3739,7 +4010,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->updateFaceSize(i); LLFace* facep = drawablep->getFace(i); -#if LL_MESH_ENABLED if (rigged) { if (!facep->isState(LLFace::RIGGED)) @@ -3747,8 +4017,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->mVertexBuffer = NULL; facep->mLastVertexBuffer = NULL; } - + facep->setState(LLFace::RIGGED); + is_rigged = true; //get drawpool of avatar with rigged face LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); @@ -3844,7 +4115,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->clearState(LLFace::RIGGED); } } -#endif if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0) { @@ -3958,6 +4228,15 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->mLastVertexBuffer = NULL; } } + + if (is_rigged) + { + drawablep->setState(LLDrawable::RIGGED); + } + else + { + drawablep->clearState(LLDrawable::RIGGED); + } } group->mBufferUsage = useage; diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index eeb98726c9..f058710a27 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -46,6 +46,8 @@ class LLDrawPool; class LLSelectNode; class LLObjectMediaDataClient; class LLObjectMediaNavigateClient; +class LLVOAvatar; +class LLMeshSkinInfo; typedef std::vector<viewer_media_t> media_list_t; @@ -54,6 +56,18 @@ enum LLVolumeInterfaceType INTERFACE_FLEXIBLE = 1, }; + +class LLRiggedVolume : public LLVolume +{ +public: + LLRiggedVolume(const LLVolumeParams& params) + : LLVolume(params, 0.f) + { + } + + void update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* src_volume); +}; + // Base class for implementations of the volume - Primitive, Flexible Object, etc. class LLVolumeInterface { @@ -289,6 +303,21 @@ public: void removeMDCImpl() { --mMDCImplCount; } S32 getMDCImplCount() { return mMDCImplCount; } + + //rigged volume update (for raycasting) + void updateRiggedVolume(); + LLRiggedVolume* getRiggedVolume(); + + //returns true if volume should be treated as a rigged volume + // - Build tools are open + // - object is an attachment + // - object is attached to self + // - object is rendered as rigged + bool treatAsRigged(); + + //clear out rigged volume and revert back to non-rigged state for picking/LOD/distance updates + void clearRiggedVolume(); + protected: S32 computeLODDetail(F32 distance, F32 radius); BOOL calcLOD(); @@ -322,6 +351,9 @@ private: S32 mLastFetchedMediaVersion; // as fetched from the server, starts as -1 S32 mIndexInTex; S32 mMDCImplCount; + + LLPointer<LLRiggedVolume> mRiggedVolume; + // statics public: static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8b4feac3cd..9ad1df02b8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2039,9 +2039,7 @@ void LLPipeline::rebuildPriorityGroups() assertInitialized(); -#if LL_MESH_ENABLED gMeshRepo.notifyLoadedMeshes(); -#endif // Iterate through all drawables on the priority build queue, for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin(); @@ -3857,7 +3855,6 @@ void LLPipeline::renderDebug() gPipeline.mDebugTextureUploadCost = textures.size() * 10; gPipeline.mDebugSculptUploadCost = sculpts.size()*10; -#if LL_MESH_ENABLED U32 mesh_cost = 0; for (std::set<LLUUID>::iterator iter = meshes.begin(); iter != meshes.end(); ++iter) @@ -3866,7 +3863,6 @@ void LLPipeline::renderDebug() } gPipeline.mDebugMeshUploadCost = mesh_cost; -#endif } for (LLCullResult::bridge_list_t::const_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index bed4155d15..cddcfc2132 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -45,7 +45,6 @@ #include "llgl.h" #include "lldrawable.h" #include "llrendertarget.h" -#include "llmodel.h" //for LL_MESH_ENaBLED #include <stack> @@ -67,9 +66,7 @@ class LLVOAvatar; class LLGLSLShader; class LLCurlRequest; -#if LL_MESH_ENABLED class LLMeshResponder; -#endif typedef enum e_avatar_skinning_method { @@ -475,9 +472,7 @@ public: S32 mDebugTextureUploadCost; S32 mDebugSculptUploadCost; -#if LL_MESH_ENABLED S32 mDebugMeshUploadCost; -#endif S32 mLightingChanges; S32 mGeometryChanges; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index bd07c473de..6b2b5d7d7e 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2163,6 +2163,10 @@ even though the user gets a free copy. label="Cylinder" name="Cylinder" value="Cylinder" /> + <combo_box.item + label="Mesh" + name="Mesh" + value="Mesh" /> </combo_box> </panel> <panel diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 2da5aff8d6..8296c28e80 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -930,6 +930,7 @@ class Linux_i686Manifest(LinuxManifest): self.path("libexpat.so.1") self.path("libglod.so") self.path("libssl.so.0.9.7") + self.path("libuuid.so.1") self.path("libSDL-1.2.so.0") self.path("libELFIO.so") self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3") |