diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-09-23 21:54:25 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-09-23 22:08:43 +0300 |
commit | 46448f9547102cce3e23c522467ef800c8c266fc (patch) | |
tree | 7e0d9f09e0a9049470523fa5b827804a140926f0 /indra/llprimitive | |
parent | 4274eb591a1b0806f8c73ca16df65ade60db2200 (diff) | |
parent | 3747dd9a085e4d75ec21c8048f1269bc3f29e582 (diff) |
Merge branch 'develop' into marchcat/b-develop
# Conflicts:
# indra/newview/llfeaturemanager.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/llvoicewebrtc.cpp
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 9 | ||||
-rw-r--r-- | indra/llprimitive/llgltfloader.cpp | 1 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 7 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.h | 5 | ||||
-rw-r--r-- | indra/llprimitive/llmodelloader.cpp | 1 |
6 files changed, 17 insertions, 9 deletions
diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index 19a43839af..3d8e02cb16 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -7,7 +7,6 @@ include(LLCommon) include(LLCoreHttp) include(LLPhysicsExtensions) include(LLPrimitive) -include(GLH) include(GLM) include(TinyGLTF) @@ -70,7 +69,7 @@ target_link_libraries(llprimitive llrender llphysicsextensions_impl ll::colladadom - ll::glh_linear + ll::glm ) #add unit tests diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 34af3ffece..7fa4230237 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> @@ -1216,9 +1217,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..480012699a 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> diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 77992d93a4..4e3e49ec9f 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1543,6 +1543,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 bd2ac68bed..c89037a2d2 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -56,12 +56,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> |