From 7691780825940364e3faa7a682490f51491d44dc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 25 May 2017 11:11:02 +0100 Subject: SL-694 - Added extra param field for flags related to extended mesh functionality. Currently this is just one bit to flag an object as able to animate --- indra/llprimitive/llprimitive.cpp | 65 +++++++++++++++++++++++++++++++++++++++ indra/llprimitive/llprimitive.h | 22 +++++++++++++ 2 files changed, 87 insertions(+) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index bfa65666b5..54b87fec78 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1599,6 +1599,8 @@ BOOL LLNetworkData::isValid(U16 param_type, U32 size) return (size == 17); case PARAMS_LIGHT_IMAGE: return (size == 28); + case PARAMS_EXTENDED_MESH: + return (size == 4); } return FALSE; @@ -2026,3 +2028,66 @@ bool LLLightImageParams::fromLLSD(LLSD& sd) return false; } + +//============================================================================ + +LLExtendedMeshParams::LLExtendedMeshParams() +{ + mFlags = 0; +} + +BOOL LLExtendedMeshParams::pack(LLDataPacker &dp) const +{ + dp.packU32(mFlags, "flags"); + + return TRUE; +} + +BOOL LLExtendedMeshParams::unpack(LLDataPacker &dp) +{ + dp.unpackU32(mFlags, "flags"); + + return TRUE; +} + +bool LLExtendedMeshParams::operator==(const LLNetworkData& data) const +{ + if (data.mType != PARAMS_EXTENDED_MESH) + { + return false; + } + + const LLExtendedMeshParams *param = (const LLExtendedMeshParams*)&data; + if ( (param->mFlags != mFlags) ) + { + return false; + } + + return true; +} + +void LLExtendedMeshParams::copy(const LLNetworkData& data) +{ + const LLExtendedMeshParams *param = (LLExtendedMeshParams*)&data; + mFlags = param->mFlags; +} + +LLSD LLExtendedMeshParams::asLLSD() const +{ + LLSD sd; + + sd["flags"] = LLSD::Integer(mFlags); + + return sd; +} + +bool LLExtendedMeshParams::fromLLSD(LLSD& sd) +{ + if (sd.has("flags")) + { + setFlags( sd["flags"].asInteger()); + return true; + } + + return false; +} diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 19d9d52817..9216c04229 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -106,6 +106,7 @@ public: PARAMS_LIGHT_IMAGE = 0x40, PARAMS_RESERVED = 0x50, // Used on server-side PARAMS_MESH = 0x60, + PARAMS_EXTENDED_MESH = 0x70, }; public: @@ -288,6 +289,27 @@ public: }; +class LLExtendedMeshParams : public LLNetworkData +{ +protected: + U32 mFlags; + +public: + static const U32 ANIMATED_MESH_ENABLED_FLAG = 0x1 << 0; + + LLExtendedMeshParams(); + /*virtual*/ BOOL pack(LLDataPacker &dp) const; + /*virtual*/ BOOL unpack(LLDataPacker &dp); + /*virtual*/ bool operator==(const LLNetworkData& data) const; + /*virtual*/ void copy(const LLNetworkData& data); + LLSD asLLSD() const; + operator LLSD() const { return asLLSD(); } + bool fromLLSD(LLSD& sd); + + void setFlags(const U32& flags) { mFlags = flags; } + U32 getFlags() const { return mFlags; } + +}; // This code is not naming-standards compliant. Leaving it like this for // now to make the connection to code in -- cgit v1.2.3 From 4d68945595227b0f863a1c496be5da0f3c3c5113 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 30 May 2017 15:59:23 +0100 Subject: SL-694 - UI initialization, set mType in LLExtendedMeshParams constructor --- indra/llprimitive/llprimitive.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 54b87fec78..c847cf653f 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -2033,6 +2033,7 @@ bool LLLightImageParams::fromLLSD(LLSD& sd) LLExtendedMeshParams::LLExtendedMeshParams() { + mType = PARAMS_EXTENDED_MESH; mFlags = 0; } -- cgit v1.2.3 From 3f9b3e01b9d7ea3a6662adb55027839840198b4c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 21 Feb 2018 22:02:34 +0000 Subject: MAINT-8264 - prevent at least some cases of LODs getting stuck at too-low values. --- indra/llprimitive/lldaeloader.cpp | 10 ++++++++-- indra/llprimitive/llmodel.cpp | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 8401cb976e..8f75d89e5a 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -192,7 +192,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa { return LLModel::BAD_ELEMENT; } - + // VFExtents change face.mExtents[0].set(v[0], v[1], v[2]); face.mExtents[1].set(v[0], v[1], v[2]); } @@ -254,6 +254,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (!found) { + // VFExtents change update_min_max(face.mExtents[0], face.mExtents[1], cv.getPosition()); verts.push_back(cv); if (verts.size() >= 65535) @@ -305,6 +306,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa } face = LLVolumeFace(); + // VFExtents change face.mExtents[0].set(v[0], v[1], v[2]); face.mExtents[1].set(v[0], v[1], v[2]); point_map.clear(); @@ -383,6 +385,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (pos_source) { v = pos_source->getFloat_array()->getValue(); + // VFExtents change face.mExtents[0].set(v[0], v[1], v[2]); face.mExtents[1].set(v[0], v[1], v[2]); } @@ -482,6 +485,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (!found) { + // VFExtents change update_min_max(face.mExtents[0], face.mExtents[1], cv.getPosition()); verts.push_back(cv); if (verts.size() >= 65535) @@ -551,6 +555,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac } face = LLVolumeFace(); + // VFExtents change face.mExtents[0].set(v[0], v[1], v[2]); face.mExtents[1].set(v[0], v[1], v[2]); verts.clear(); @@ -734,7 +739,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac { return LLModel::NO_ERRORS; } - + // VFExtents change face.mExtents[0] = verts[0].getPosition(); face.mExtents[1] = verts[0].getPosition(); @@ -758,6 +763,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac for (std::map::iterator iter = vert_idx.begin(); iter != vert_idx.end(); ++iter) { new_verts[iter->second] = iter->first; + // VFExtents change update_min_max(face.mExtents[0], face.mExtents[1], iter->first.getPosition()); } diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index db6d00bc2c..597cc66088 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -276,6 +276,7 @@ void LLModel::normalizeVolumeFaces() // We shrink the extents so // that they fall within // the unit cube. + // VFExtents change face.mExtents[0].add(trans); face.mExtents[0].mul(scale); -- cgit v1.2.3 From e86839fac19753d0fa4006296c7f8909fe781013 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Jun 2018 15:08:59 +0100 Subject: SL-915 - WIP on dynamic joint box tracking --- indra/llprimitive/llmodel.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 097558ef67..53585d2e04 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -38,7 +38,6 @@ class domMesh; #define MAX_MODEL_FACES 8 - class LLMeshSkinInfo { public: -- cgit v1.2.3 From 68621905004bd783386d37b2d5d4265494ec4c18 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Jun 2018 19:56:34 +0100 Subject: SL-915 - face-level caching, bug fix --- indra/llprimitive/llmodel.cpp | 3 ++- indra/llprimitive/llmodel.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 18f45d3b20..2a55838a4b 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1392,7 +1392,8 @@ bool LLModel::loadDecomposition(LLSD& header, std::istream& is) LLMeshSkinInfo::LLMeshSkinInfo(): mPelvisOffset(0.0), mLockScaleIfJointPosition(false), - mInvalidJointsScrubbed(false) + mInvalidJointsScrubbed(false), + mJointNumsInitialized(false) { } diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 53585d2e04..d7f006753f 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -56,6 +56,7 @@ public: float mPelvisOffset; bool mLockScaleIfJointPosition; bool mInvalidJointsScrubbed; + bool mJointNumsInitialized; }; class LLModel : public LLVolume -- cgit v1.2.3 From edf6795edaa4ec822ac0e2bc906c71606b84b5c8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Jun 2018 21:49:24 +0100 Subject: SL-915, MAINT-8554 - cleanup/reorg, added encroachment fix info to DebugAnimatedObjects output --- indra/llprimitive/llmodel.cpp | 34 ---------------------------------- indra/llprimitive/llmodel.h | 3 --- 2 files changed, 37 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 2a55838a4b..a0e835c577 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -401,40 +401,6 @@ void LLModel::setVolumeFaceData( LLVector4a::memcpyNonAliased16((F32*) face.mIndices, (F32*) ind.get(), size); } -void LLModel::appendFaces(LLModel *model, LLMatrix4 &transform, LLMatrix4& norm_mat) -{ - if (mVolumeFaces.empty()) - { - setNumVolumeFaces(1); - } - - LLVolumeFace& face = mVolumeFaces[mVolumeFaces.size()-1]; - - - for (S32 i = 0; i < model->getNumFaces(); ++i) - { - face.appendFace(model->getVolumeFace(i), transform, norm_mat); - } - -} - -void LLModel::appendFace(const LLVolumeFace& src_face, std::string src_material, LLMatrix4& mat, LLMatrix4& norm_mat) -{ - S32 rindex = getNumVolumeFaces()-1; - if (rindex == -1 || - mVolumeFaces[rindex].mNumVertices + src_face.mNumVertices >= 65536) - { //empty or overflow will occur, append new face - LLVolumeFace cur_face; - cur_face.appendFace(src_face, mat, norm_mat); - addFace(cur_face); - mMaterialList.push_back(src_material); - } - else - { //append to existing end face - mVolumeFaces.rbegin()->appendFace(src_face, mat, norm_mat); - } -} - void LLModel::addFace(const LLVolumeFace& face) { if (face.mNumVertices == 0) diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index d7f006753f..cf3288489a 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -158,9 +158,6 @@ public: EModelStatus getStatus() const {return mStatus;} static std::string getStatusString(U32 status) ; - void appendFaces(LLModel* model, LLMatrix4& transform, LLMatrix4& normal_transform); - void appendFace(const LLVolumeFace& src_face, std::string src_material, LLMatrix4& mat, LLMatrix4& norm_mat); - void setNumVolumeFaces(S32 count); void setVolumeFaceData( S32 f, -- cgit v1.2.3 From 73c76fdccf3da73502403deeab3f2c4e26d68376 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Jul 2018 18:56:08 +0100 Subject: MAINT-8863 - more diagnostics and possible fix --- indra/llprimitive/llmodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index a0e835c577..37548e3fe3 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1366,7 +1366,8 @@ LLMeshSkinInfo::LLMeshSkinInfo(): LLMeshSkinInfo::LLMeshSkinInfo(LLSD& skin): mPelvisOffset(0.0), mLockScaleIfJointPosition(false), - mInvalidJointsScrubbed(false) + mInvalidJointsScrubbed(false), + mJointNumsInitialized(false) { fromLLSD(skin); } -- cgit v1.2.3 From 791979c553a09963f03239cecc90083fe3f8c657 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 8 Aug 2018 13:34:02 +0100 Subject: SL-928 - in mesh upload, warn if bind shape is non-identity and skin weights are enabled. --- indra/llprimitive/llmodelloader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index d64e0a0773..643c45a6d8 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -81,6 +81,7 @@ public: GENERATING_VERTEX_BUFFERS, GENERATING_LOD, DONE, + WARNING_BIND_SHAPE_ORIENTATION, ERROR_PARSING, //basically loading failed ERROR_MATERIALS, ERROR_PASSWORD_REQUIRED, -- cgit v1.2.3