import { ExtensionProperty , IProperty , Nullable , vec2 } from '@gltf-transform/core' ; import { PropertyType } from '@gltf-transform/core' ; import { KHR_TEXTURE_TRANSFORM } from '../constants' ; interface ITransform extends IProperty { offset : vec2 ; rotation : number ; scale : vec2 ; texCoord : number | null ; } /**
 * # Transform
 *
 * Defines UV transform for a  TextureInfo . See  TextureTransform .
  export class Transform extends ExtensionProperty < ITransform > { public static EXTENSION_NAME = KHR_TEXTURE_TRANSFORM ; public declare extensionName : typeof KHR_TEXTURE_TRANSFORM ; public declare propertyType : 'Transform' ; public declare parentTypes : [ PropertyType . TEXTURE_INFO ] ; protected init ( ) { this . extensionName = KHR_TEXTURE_TRANSFORM ; this . propertyType = 'Transform' ; this . parentTypes = [ PropertyType . TEXTURE_INFO ] ; } protected getDefaults ( ) { return Object . assign ( super . getDefaults ( ) as IProperty , { offset : [ 0.0 , 0.0 ] as vec2 , rotation : 0 , scale : [ 1.0 , 1.0 ] as vec2 , texCoord : null , } ) ; } public getOffset ( ) { return this . get ( 'offset' ) ; } public setOffset ( offset ) { return this . set ( 'offset' , offset ) ; } public getRotation ( ) { return this . get ( 'rotation' ) ; } public setRotation ( rotation ) { return this . set ( 'rotation' , rotation ) ; } public getScale ( ) { return this . get ( 'scale' ) ; } public setScale ( scale ) { return this . set ( 'scale' , scale ) ; } public getTexCoord ( ) { return this . get ( 'texCoord' ) ; } public setTexCoord ( texCoord ) { return this . set ( 'texCoord' , texCoord ) ; } }