summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/asset.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-06-11 13:27:54 -0500
committerGitHub <noreply@github.com>2024-06-11 13:27:54 -0500
commit429c92ad75fd3b3f7b9dfc52ed034b25004a3b9c (patch)
tree2df4c730b78cdd1cd6bac4c119585f9ad44718d1 /indra/newview/gltf/asset.h
parent961b6b0c7e2499118c294810aeb9c5c0ac5df189 (diff)
#1687 Add support for KHR_texture_transform (#1717)
Diffstat (limited to 'indra/newview/gltf/asset.h')
-rw-r--r--indra/newview/gltf/asset.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/gltf/asset.h b/indra/newview/gltf/asset.h
index 8f28e5905f..bca269d5dc 100644
--- a/indra/newview/gltf/asset.h
+++ b/indra/newview/gltf/asset.h
@@ -57,6 +57,21 @@ namespace LL
bool mPresent = false;
};
+ class TextureTransform : public Extension // KHR_texture_transform implementation
+ {
+ public:
+ vec2 mOffset = vec2(0.f, 0.f);
+ F32 mRotation = 0.f;
+ vec2 mScale = vec2(1.f, 1.f);
+ S32 mTexCoord = INVALID_INDEX;
+
+ // get the texture transform as a packed array of floats
+ // dst MUST point to at least 8 floats
+ void getPacked(F32* dst) const;
+
+ const TextureTransform& operator=(const Value& src);
+ void serialize(boost::json::object& dst) const;
+ };
class Material
{
@@ -82,6 +97,8 @@ namespace LL
S32 mIndex = INVALID_INDEX;
S32 mTexCoord = 0;
+ TextureTransform mTextureTransform;
+
bool operator==(const TextureInfo& rhs) const;
bool operator!=(const TextureInfo& rhs) const;