@@ -11,26 +11,26 @@ import { injectBox, injectPlane } from 'angular-three-cannon/services';
11
11
standalone : true ,
12
12
template : `
13
13
<ngt-mesh [ref]="planeApi.ref" [receiveShadow]="true">
14
- <ngt-plane-geometry *args="[1000, 1000] " />
14
+ <ngt-plane-geometry *args="planeArgs " />
15
15
<ngt-mesh-standard-material color="#171717" />
16
16
</ngt-mesh>
17
17
` ,
18
18
imports : [ NgtArgs ] ,
19
19
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
20
20
} )
21
21
export class Plane {
22
- Math = Math ;
23
22
@Input ( ) position : Triplet = [ 0 , 0 , 0 ] ;
23
+ planeArgs = [ 1000 , 1000 ] ;
24
24
25
- planeApi = injectPlane ( ( ) => ( { mass : 0 , position : this . position , args : [ 1000 , 1000 ] } ) ) ;
25
+ planeApi = injectPlane ( ( ) => ( { mass : 0 , position : this . position , args : this . planeArgs } ) ) ;
26
26
}
27
27
28
28
@Component ( {
29
29
selector : 'app-box' ,
30
30
standalone : true ,
31
31
template : `
32
32
<ngt-mesh [ref]="boxApi.ref" [receiveShadow]="true" [castShadow]="true">
33
- <ngt-box-geometry *args="[2, 2, 2] " />
33
+ <ngt-box-geometry *args="boxArgs " />
34
34
<ngt-mesh-standard-material [roughness]="0.5" color="#575757" />
35
35
</ngt-mesh>
36
36
` ,
@@ -39,8 +39,9 @@ export class Plane {
39
39
} )
40
40
export class Box {
41
41
@Input ( ) position : Triplet = [ 0 , 0 , 0 ] ;
42
+ boxArgs : Triplet = [ 2 , 2 , 2 ] ;
42
43
43
- boxApi = injectBox ( ( ) => ( { mass : 10000 , position : this . position , args : [ 2 , 2 , 2 ] } ) ) ;
44
+ boxApi = injectBox ( ( ) => ( { mass : 10000 , position : this . position , args : this . boxArgs } ) ) ;
44
45
}
45
46
46
47
@Component ( {
0 commit comments