1 |
- {"ast":null,"code":"import { Texture } from \"./texture.js\";\n\n/**\n * Class used to store 3D textures containing user data\n */\nexport class RawTexture3D extends Texture {\n /**\n * Gets the width of the texture\n */\n get width() {\n return this._texture ? this._texture.width : 0;\n }\n /**\n * Gets the height of the texture\n */\n get height() {\n return this._texture ? this._texture.height : 0;\n }\n /**\n * Gets the depth of the texture\n */\n get depth() {\n return this._texture ? this._texture.depth : 0;\n }\n /**\n * Create a new RawTexture3D\n * @param data defines the data of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param depth defines the depth of the texture\n * @param format defines the texture format to use\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\n * @param invertY defines if texture must be stored with Y axis inverted\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n */\n constructor(data, width, height, depth, /** Gets or sets the texture format to use */\n format, scene, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) {\n super(null, scene, !generateMipMaps, invertY);\n this.format = format;\n this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\n this.is3D = true;\n }\n /**\n * Update the texture with new data\n * @param data defines the data to store in the texture\n */\n update(data) {\n if (!this._texture) {\n return;\n }\n this._getEngine().updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);\n }\n}","map":{"version":3,"names":["Texture","RawTexture3D","width","_texture","height","depth","constructor","data","format","scene","generateMipMaps","invertY","samplingMode","TRILINEAR_SAMPLINGMODE","textureType","creationFlags","getEngine","createRawTexture3D","is3D","update","_getEngine","updateRawTexture3D","type"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/rawTexture3D.js"],"sourcesContent":["import { Texture } from \"./texture.js\";\n\n/**\n * Class used to store 3D textures containing user data\n */\nexport class RawTexture3D extends Texture {\n /**\n * Gets the width of the texture\n */\n get width() {\n return this._texture ? this._texture.width : 0;\n }\n /**\n * Gets the height of the texture\n */\n get height() {\n return this._texture ? this._texture.height : 0;\n }\n /**\n * Gets the depth of the texture\n */\n get depth() {\n return this._texture ? this._texture.depth : 0;\n }\n /**\n * Create a new RawTexture3D\n * @param data defines the data of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param depth defines the depth of the texture\n * @param format defines the texture format to use\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\n * @param invertY defines if texture must be stored with Y axis inverted\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n */\n constructor(data, width, height, depth, \n /** Gets or sets the texture format to use */\n format, scene, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) {\n super(null, scene, !generateMipMaps, invertY);\n this.format = format;\n this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\n this.is3D = true;\n }\n /**\n * Update the texture with new data\n * @param data defines the data to store in the texture\n */\n update(data) {\n if (!this._texture) {\n return;\n }\n this._getEngine().updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;;AAEtC;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASD,OAAO,CAAC;EACtC;AACJ;AACA;EACI,IAAIE,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACC,QAAQ,GAAG,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