diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2025-12-04 14:19:04 +0200 |
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2025-12-04 14:19:22 +0200 |
| commit | a377ec310848657ca6f4b76bdf74aca9cfc6f9da (patch) | |
| tree | dfb181330de5d5d64981d50171f37c3d0d376ee1 /indra/llprimitive | |
| parent | 1073444a44c5d0a877fb91dbdde06aa37fea7644 (diff) | |
| parent | c4ec3d866082d588de671e833413474d7ab19524 (diff) | |
Merge branch 'release/2026.01' into maxim/2025.07-Flat-UI
Diffstat (limited to 'indra/llprimitive')
| -rw-r--r-- | indra/llprimitive/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | indra/llprimitive/llgltfmaterial.cpp | 31 | ||||
| -rw-r--r-- | indra/llprimitive/llgltfmaterial.h | 8 | ||||
| -rw-r--r-- | indra/llprimitive/llmediaentry.cpp | 2 | ||||
| -rw-r--r-- | indra/llprimitive/llmodel.cpp | 4 | ||||
| -rw-r--r-- | indra/llprimitive/llmodel.h | 3 | ||||
| -rw-r--r-- | indra/llprimitive/llmodelloader.h | 10 |
7 files changed, 59 insertions, 10 deletions
diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index e13f0bbd96..ff0cad58d6 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -65,11 +65,20 @@ target_link_libraries(llprimitive llxml llcharacter llrender - llphysicsextensions_impl ll::colladadom ll::glm ) +if (HAVOK OR HAVOK_TPV) + target_link_libraries(llprimitive + llphysicsextensions_impl + ) +else() + target_link_libraries(llprimitive + llphysicsextensionsos + ) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp index cc4921416f..930222e3db 100644 --- a/indra/llprimitive/llgltfmaterial.cpp +++ b/indra/llprimitive/llgltfmaterial.cpp @@ -923,3 +923,34 @@ void LLGLTFMaterial::updateTextureTracking() // setTEGLTFMaterialOverride is responsible for tracking // for material overrides editor will set it } + +void LLGLTFMaterial::convertTextureTransformToPBR( + F32 tex_scale_s, + F32 tex_scale_t, + F32 tex_offset_s, + F32 tex_offset_t, + F32 tex_rotation, + LLVector2& pbr_scale, + LLVector2& pbr_offset, + F32& pbr_rotation) +{ + pbr_scale.set(tex_scale_s, tex_scale_t); + pbr_rotation = -(tex_rotation) / 2.f; + const F32 adjusted_offset_s = tex_offset_s; + const F32 adjusted_offset_t = -tex_offset_t; + F32 center_adjust_s = 0.5f * (1.0f - tex_scale_s); + F32 center_adjust_t = 0.5f * (1.0f - tex_scale_t); + + if (pbr_rotation != 0.0f) + { + const F32 c = cosf(pbr_rotation); + const F32 s = sinf(pbr_rotation); + const F32 tmp_s = center_adjust_s * c - center_adjust_t * s; + const F32 tmp_t = center_adjust_s * s + center_adjust_t * c; + center_adjust_s = tmp_s; + center_adjust_t = tmp_t; + } + + pbr_offset.set(adjusted_offset_s + center_adjust_s, + adjusted_offset_t + center_adjust_t); +} diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h index 10df4c8ee1..8d45cb6185 100644 --- a/indra/llprimitive/llgltfmaterial.h +++ b/indra/llprimitive/llgltfmaterial.h @@ -214,6 +214,14 @@ public: bool hasLocalTextures() { return !mTrackingIdToLocalTexture.empty(); } virtual bool replaceLocalTexture(const LLUUID& tracking_id, const LLUUID &old_id, const LLUUID& new_id); virtual void updateTextureTracking(); + + // Convert legacy TE transform values to PBR transform values. + static void convertTextureTransformToPBR(F32 tex_scale_s, F32 tex_scale_t, + F32 tex_offset_s, F32 tex_offset_t, + F32 tex_rotation, + LLVector2& pbr_scale, + LLVector2& pbr_offset, + F32& pbr_rotation); protected: static LLVector2 vec2FromJson(const std::map<std::string, tinygltf::Value>& object, const char* key, const LLVector2& default_value); static F32 floatFromJson(const std::map<std::string, tinygltf::Value>& object, const char* key, const F32 default_value); diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp index b5b17c53aa..48c6ba1fa5 100644 --- a/indra/llprimitive/llmediaentry.cpp +++ b/indra/llprimitive/llmediaentry.cpp @@ -74,7 +74,7 @@ const char* LLMediaEntry::WHITELIST_KEY = MEDIA_WHITELIST_KEY_STR; const char* LLMediaEntry::PERMS_INTERACT_KEY = MEDIA_PERMS_INTERACT_KEY_STR; const char* LLMediaEntry::PERMS_CONTROL_KEY = MEDIA_PERMS_CONTROL_KEY_STR; -#define DEFAULT_URL_PREFIX "http://" +#define DEFAULT_URL_PREFIX "https://" // Constructor(s) LLMediaEntry::LLMediaEntry() : diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 00ef79ce7f..8055bffd32 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1296,10 +1296,10 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) } void LLModel::setConvexHullDecomposition( - const LLModel::convex_hull_decomposition& decomp) + const LLModel::convex_hull_decomposition& decomp, const std::vector<LLModel::PhysicsMesh>& decomp_mesh) { mPhysics.mHull = decomp; - mPhysics.mMesh.clear(); + mPhysics.mMesh = decomp_mesh; updateHullCenters(); } diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 6501b3dc50..ac88af18f0 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -305,7 +305,8 @@ public: S32 mDecompID; void setConvexHullDecomposition( - const convex_hull_decomposition& decomp); + const convex_hull_decomposition& decomp, + const std::vector<LLModel::PhysicsMesh>& decomp_mesh); void updateHullCenters(); LLVector3 mCenterOfHullCenters; diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 335d809386..8acc75b1be 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -29,7 +29,7 @@ #include "llmodel.h" #include "llthread.h" -#include <boost/function.hpp> +#include <functional> #include <list> class LLJoint; @@ -57,25 +57,25 @@ public: // Callback with loaded model data and loaded LoD // - typedef boost::function<void (scene&, model_list&, S32, void*)> load_callback_t; + typedef std::function<void (scene&, model_list&, S32, void*)> load_callback_t; // Function to provide joint lookup by name // (within preview avi skeleton, for example) // - typedef boost::function<LLJoint* (const std::string&, void*)> joint_lookup_func_t; + typedef std::function<LLJoint* (const std::string&, void*)> joint_lookup_func_t; // Func to load and associate material with all it's textures, // returned value is the number of textures loaded // intentionally non-const so func can modify material to // store platform-specific data // - typedef boost::function<U32 (LLImportMaterial&, void*)> texture_load_func_t; + typedef std::function<U32 (LLImportMaterial&, void*)> texture_load_func_t; // Callback to inform client of state changes // during loading process (errors will be reported // as state changes here as well) // - typedef boost::function<void (U32, void*)> state_callback_t; + typedef std::function<void (U32, void*)> state_callback_t; typedef enum { |
