Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f26d50d

Browse files
committedAug 24, 2023
Add DataCubeTexure
1 parent 1e5a61b commit f26d50d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
 

‎src/textures/DataCubeTexture.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Texture } from './Texture.js';
2+
import { CubeReflectionMapping } from '../constants.js';
3+
4+
class DataCubeTexture extends Texture {
5+
6+
constructor( data ) {
7+
8+
super( data, CubeReflectionMapping );
9+
10+
this.isDataCubeTexture = true;
11+
this.isCubeTexture = true;
12+
13+
this.image = { data, width: data[ 0 ].width, height: data[ 0 ].height };
14+
15+
this.generateMipmaps = false;
16+
this.flipY = false;
17+
this.unpackAlignment = 1;
18+
19+
}
20+
21+
get images() {
22+
23+
return this.image;
24+
25+
}
26+
27+
set images( value ) {
28+
29+
this.image = value;
30+
31+
}
32+
33+
}
34+
35+
export { DataCubeTexture };

0 commit comments

Comments
 (0)
Please sign in to comment.