summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2024-05-06 10:07:02 -0700
committerCosmic Linden <cosmic@lindenlab.com>2024-05-10 17:42:54 -0700
commit9441608623a2692263191c254db23765eefa2cef (patch)
tree2c72d060ba9457ddb49516cfa4cd5b1ff0477f99 /indra/llprimitive
parent155ddf23363f1d5c534c69f50505faf67e51948f (diff)
secondlife/viewer#907: Local PBR terrain texture transforms
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp11
-rw-r--r--indra/llprimitive/llgltfmaterial.h7
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index 12af568b7e..94bc5ef74c 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -81,7 +81,7 @@ LLGLTFMaterial::LLGLTFMaterial()
#endif
}
-void LLGLTFMaterial::TextureTransform::getPacked(F32 (&packed)[8]) const
+void LLGLTFMaterial::TextureTransform::getPacked(Pack& packed) const
{
packed[0] = mScale.mV[VX];
packed[1] = mScale.mV[VY];
@@ -92,6 +92,15 @@ void LLGLTFMaterial::TextureTransform::getPacked(F32 (&packed)[8]) const
packed[3] = packed[6] = packed[7] = 0.f;
}
+void LLGLTFMaterial::TextureTransform::getPackedTight(PackTight& packed) const
+{
+ packed[0] = mScale.mV[VX];
+ packed[1] = mScale.mV[VY];
+ packed[2] = mRotation;
+ packed[3] = mOffset.mV[VX];
+ packed[4] = mOffset.mV[VY];
+}
+
bool LLGLTFMaterial::TextureTransform::operator==(const TextureTransform& other) const
{
return mOffset == other.mOffset && mScale == other.mScale && mRotation == other.mRotation;
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index 90f1ecfa8f..7888ba3b05 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -68,7 +68,12 @@ public:
LLVector2 mScale = { 1.f, 1.f };
F32 mRotation = 0.f;
- void getPacked(F32 (&packed)[8]) const;
+ static const size_t PACK_SIZE = 8;
+ static const size_t PACK_TIGHT_SIZE = 5;
+ using Pack = F32[PACK_SIZE];
+ using PackTight = F32[PACK_TIGHT_SIZE];
+ void getPacked(Pack& packed) const;
+ void getPackedTight(PackTight& packed) const;
bool operator==(const TextureTransform& other) const;
bool operator!=(const TextureTransform& other) const { return !(*this == other); }