From 99fd5d6766d1346f8f4ecdf6d257c8bb2b05e992 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Thu, 24 Aug 2023 15:33:19 -0400 Subject: [PATCH] Add DataCubeTexure --- src/textures/DataCubeTexture.js | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/textures/DataCubeTexture.js diff --git a/src/textures/DataCubeTexture.js b/src/textures/DataCubeTexture.js new file mode 100644 index 00000000000000..95ddda4b461e92 --- /dev/null +++ b/src/textures/DataCubeTexture.js @@ -0,0 +1,35 @@ +import { Texture } from './Texture.js'; +import { CubeReflectionMapping } from '../constants.js'; + +class DataCubeTexture extends Texture { + + constructor( data ) { + + super( data, CubeReflectionMapping ); + + this.isDataCubeTexture = true; + this.isCubeTexture = true; + + this.image = { data, width: data[ 0 ].width, height: data[ 0 ].height }; + + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + + } + + get images() { + + return this.image; + + } + + set images( value ) { + + this.image = value; + + } + +} + +export { DataCubeTexture };