File tree 5 files changed +23
-13
lines changed
5 files changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export type Material = {
7
7
transparent : boolean ;
8
8
type : string ;
9
9
doubleSide : boolean ;
10
+ skybox : boolean ;
10
11
} ;
11
12
export type Mesh = {
12
13
geometry : any ;
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ class default_1 extends Controller {
20
20
scene . background = new THREE . Color ( sceneValue . material . color ) ;
21
21
}
22
22
if ( sceneValue . material . map ) {
23
- scene . background = new THREE . TextureLoader ( ) . load ( sceneValue . material . map ) ;
23
+ const texture = new THREE . TextureLoader ( ) . load ( sceneValue . material . map ) ;
24
+ if ( sceneValue . material . skybox )
25
+ texture . mapping = THREE . EquirectangularReflectionMapping ;
26
+ scene . background = texture ;
24
27
}
25
28
const cameras = [ ] ;
26
29
for ( let cameraData of rendererValue . cameras ) {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export type Material = {
10
10
transparent : boolean ;
11
11
type : string ;
12
12
doubleSide : boolean ;
13
+ skybox : boolean ;
13
14
}
14
15
15
16
export type Mesh = {
@@ -61,12 +62,18 @@ export default class extends Controller {
61
62
let scene = new THREE . Scene ( ) ;
62
63
const light = new THREE . AmbientLight ( 0x404040 ) ; // Lumière ambiante
63
64
scene . add ( light ) ;
65
+
64
66
if ( sceneValue . material . color ) {
65
67
scene . background = new THREE . Color ( sceneValue . material . color ) ;
66
68
}
67
69
if ( sceneValue . material . map ) {
68
- scene . background = new THREE . TextureLoader ( ) . load ( sceneValue . material . map ) ;
69
- }
70
+ const texture = new THREE . TextureLoader ( ) . load ( sceneValue . material . map ) ;
71
+ if ( sceneValue . material . skybox )
72
+ texture . mapping = THREE . EquirectangularReflectionMapping ;
73
+ scene . background = texture ;
74
+
75
+ }
76
+
70
77
71
78
/** cameras */
72
79
const cameras : THREE . Camera [ ] = [ ] ;
Original file line number Diff line number Diff line change 28
28
}
29
29
},
30
30
"require" : {
31
- "php" : " >=8.1" ,
32
- "symfony/config" : " ^5.4|^6.0|^7.0" ,
33
- "symfony/dependency-injection" : " ^5.4|^6.0|^7.0" ,
34
- "symfony/http-kernel" : " ^5.4|^6.0|^7.0" ,
35
- "symfony/stimulus-bundle" : " ^2.9.1"
31
+ "php" : " >=8.3" ,
32
+ "symfony/stimulus-bundle" : " ^2.18.1"
36
33
},
37
34
"require-dev" : {
38
- "symfony/framework-bundle" : " ^5.4|^6.0|^7.0" ,
39
- "symfony/phpunit-bridge" : " ^5.4|^6.0|^7.0" ,
40
- "symfony/twig-bundle" : " ^5.4|^6.0|^7.0" ,
41
- "symfony/var-dumper" : " ^5.4|^6.0|^7.0"
35
+ "symfony/asset-mapper" : " ^6.4|^7.0" ,
36
+ "symfony/framework-bundle" : " ^6.4|^7.0" ,
37
+ "symfony/phpunit-bridge" : " ^6.4|^7.0" ,
38
+ "symfony/twig-bundle" : " ^6.4|^7.0" ,
39
+ "symfony/ux-twig-component" : " ^2.18"
42
40
},
43
41
"conflict" : {
44
- "symfony/flex " : " <1.13 "
42
+ "symfony/ux-twig-component " : " <2.21 "
45
43
},
46
44
"extra" : {
47
45
"thanks" : {
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public function __construct(
25
25
public float $ opacity = 1 ,
26
26
public string $ map = '' ,
27
27
public bool $ doubleSide = false ,
28
+ public bool $ skybox = false ,
28
29
29
30
) {
30
31
$ this ->transparent = $ this ->opacity < 1 ;
You can’t perform that action at this time.
0 commit comments