diff options
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 13 | ||||
-rw-r--r-- | indra/llprimitive/llgltfloader.cpp | 3 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 16 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.h | 5 | ||||
-rw-r--r-- | indra/llprimitive/llmodelloader.cpp | 1 | ||||
-rw-r--r-- | indra/llprimitive/object_flags.h | 12 |
7 files changed, 34 insertions, 19 deletions
diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index b98edc67de..e9f9e06e1f 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -8,7 +8,6 @@ include(LLCommon) include(LLCoreHttp) include(LLPhysicsExtensions) include(LLPrimitive) -include(GLH) include(GLM) include(TinyGLTF) @@ -90,7 +89,7 @@ target_link_libraries(llprimitive llrender llphysicsextensions_impl ll::colladadom - ll::glh_linear + ll::glm ) include(LibraryInstall) diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 34af3ffece..b634600de0 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -51,7 +51,8 @@ #include "llsdserialize.h" #include "lljoint.h" -#include "glh/glh_linear.h" +#include "glm/mat4x4.hpp" +#include "glm/gtc/type_ptr.hpp" #include "llmatrix4a.h" #include <boost/regex.hpp> @@ -1072,7 +1073,9 @@ bool LLDAELoader::OpenFile(const std::string& filename) LLModel* mdl = *i; if(mdl->getStatus() != LLModel::NO_ERRORS) { - setLoadState(ERROR_MODEL + mdl->getStatus()) ; + // setLoadState() values >= ERROR_MODEL are reserved to + // report errors with the model itself. + setLoadState(ERROR_MODEL + eLoadState(mdl->getStatus())) ; return false; //abort } @@ -1216,9 +1219,9 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do mesh_scale *= normalized_transformation; normalized_transformation = mesh_scale; - glh::matrix4f inv_mat((F32*) normalized_transformation.mMatrix); - inv_mat = inv_mat.inverse(); - LLMatrix4 inverse_normalized_transformation(inv_mat.m); + glm::mat4 inv_mat = glm::make_mat4((F32*)normalized_transformation.mMatrix); + inv_mat = glm::inverse(inv_mat); + LLMatrix4 inverse_normalized_transformation(glm::value_ptr(inv_mat)); domSkin::domBind_shape_matrix* bind_mat = skin->getBind_shape_matrix(); diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp index 776f81cc01..48249aa5c4 100644 --- a/indra/llprimitive/llgltfloader.cpp +++ b/indra/llprimitive/llgltfloader.cpp @@ -51,7 +51,6 @@ #include "llsdserialize.h" #include "lljoint.h" -#include "glh/glh_linear.h" #include "llmatrix4a.h" #include <boost/regex.hpp> @@ -156,7 +155,7 @@ bool LLGLTFLoader::parseMeshes() } else { - setLoadState(ERROR_MODEL + pModel->getStatus()); + setLoadState(ERROR_MODEL + eLoadState(pModel->getStatus())); delete(pModel); return false; } diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index bcd1ee57db..2fb1956301 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -66,7 +66,12 @@ LLModel::~LLModel() { if (mDecompID >= 0) { - LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID); + // can be null on shutdown + LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); + if (decomp) + { + decomp->deleteDecomposition(mDecompID); + } } mPhysics.mMesh.clear(); } @@ -97,7 +102,7 @@ void LLModel::offsetMesh(const LLVector3& pivotPoint) for (LLVolumeFace& face : mVolumeFaces) { - for (U32 i = 0; i < face.mNumVertices; ++i) + for (S32 i = 0; i < face.mNumVertices; ++i) { face.mPositions[i].add(pivot); } @@ -1543,6 +1548,13 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin) mLockScaleIfJointPosition = false; } + // combine mBindShapeMatrix and mInvBindMatrix into mBindPoseMatrix + mBindPoseMatrix.resize(mInvBindMatrix.size()); + for (U32 i = 0; i < mInvBindMatrix.size(); ++i) + { + matMul(mBindShapeMatrix, mInvBindMatrix[i], mBindPoseMatrix[i]); + } + updateHash(); } diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index b9c6c9aa24..af5bbf2da8 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -58,12 +58,15 @@ public: LLUUID mMeshID; std::vector<std::string> mJointNames; mutable std::vector<S32> mJointNums; - typedef std::vector<LLMatrix4a, boost::alignment::aligned_allocator<LLMatrix4a, 16>> matrix_list_t; + typedef std::vector<LLMatrix4a> matrix_list_t; matrix_list_t mInvBindMatrix; // bones/joints position overrides matrix_list_t mAlternateBindMatrix; + // cached multiply of mBindShapeMatrix and mInvBindMatrix + matrix_list_t mBindPoseMatrix; + LL_ALIGN_16(LLMatrix4a mBindShapeMatrix); float mPelvisOffset; diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index 1a64e6227f..84adec4da5 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -31,7 +31,6 @@ #include "lljoint.h" #include "llcallbacklist.h" -#include "glh/glh_linear.h" #include "llmatrix4a.h" #include <boost/bind.hpp> diff --git a/indra/llprimitive/object_flags.h b/indra/llprimitive/object_flags.h index e2cdba072a..06e216ba49 100644 --- a/indra/llprimitive/object_flags.h +++ b/indra/llprimitive/object_flags.h @@ -57,16 +57,16 @@ const U32 FLAGS_CAMERA_SOURCE = (1U << 22); //const U32 FLAGS_UNUSED_001 = (1U << 23); // was FLAGS_CAST_SHADOWS -//const U32 FLAGS_UNUSED_002 = (1U << 24); -//const U32 FLAGS_UNUSED_003 = (1U << 25); -//const U32 FLAGS_UNUSED_004 = (1U << 26); -//const U32 FLAGS_UNUSED_005 = (1U << 27); +const U32 FLAGS_SERVER_AUTOPILOT = (1U << 24); // Update was for an agent AND that agent is being autopiloted from the server +//const U32 FLAGS_UNUSED_002 = (1U << 25); +//const U32 FLAGS_UNUSED_003 = (1U << 26); +//const U32 FLAGS_UNUSED_004 = (1U << 27); const U32 FLAGS_OBJECT_OWNER_MODIFY = (1U << 28); const U32 FLAGS_TEMPORARY_ON_REZ = (1U << 29); -//const U32 FLAGS_UNUSED_006 = (1U << 30); // was FLAGS_TEMPORARY -//const U32 FLAGS_UNUSED_007 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED +//const U32 FLAGS_UNUSED_005 = (1U << 30); // was FLAGS_TEMPORARY +//const U32 FLAGS_UNUSED_006 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED const U32 FLAGS_LOCAL = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE; const U32 FLAGS_WORLD = FLAGS_USE_PHYSICS | FLAGS_PHANTOM | FLAGS_TEMPORARY_ON_REZ; |