@@ -22,16 +22,28 @@ const wallFD = {
22
22
} ;
23
23
24
24
// Left vertical
25
- ground . createFixture ( new Edge ( { x : - 20.0 , y : - 20.0 } , { x : - 20.0 , y : 20.0 } ) , wallFD ) ;
25
+ ground . createFixture ( {
26
+ shape : new Edge ( { x : - 20.0 , y : - 20.0 } , { x : - 20.0 , y : 20.0 } ) ,
27
+ ...wallFD ,
28
+ } ) ;
26
29
27
30
// Right vertical
28
- ground . createFixture ( new Edge ( { x : 20.0 , y : - 20.0 } , { x : 20.0 , y : 20.0 } ) , wallFD ) ;
31
+ ground . createFixture ( {
32
+ shape : new Edge ( { x : 20.0 , y : - 20.0 } , { x : 20.0 , y : 20.0 } ) ,
33
+ ...wallFD ,
34
+ } ) ;
29
35
30
36
// Top horizontal
31
- ground . createFixture ( new Edge ( { x : - 20.0 , y : 20.0 } , { x : 20.0 , y : 20.0 } ) , wallFD ) ;
37
+ ground . createFixture ( {
38
+ shape : new Edge ( { x : - 20.0 , y : 20.0 } , { x : 20.0 , y : 20.0 } ) ,
39
+ ...wallFD ,
40
+ } ) ;
32
41
33
42
// Bottom horizontal
34
- ground . createFixture ( new Edge ( { x : - 20.0 , y : - 20.0 } , { x : 20.0 , y : - 20.0 } ) , wallFD ) ;
43
+ ground . createFixture ( {
44
+ shape : new Edge ( { x : - 20.0 , y : - 20.0 } , { x : 20.0 , y : - 20.0 } ) ,
45
+ ...wallFD ,
46
+ } ) ;
35
47
36
48
const xf1 = new Transform ( ) ;
37
49
xf1 . q . set ( 0.3524 * Math . PI ) ;
@@ -66,8 +78,14 @@ const jet = world.createBody({
66
78
allowSleep : false ,
67
79
} ) ;
68
80
69
- jet . createFixture ( poly1 , 2.0 ) ;
70
- jet . createFixture ( poly2 , 2.0 ) ;
81
+ jet . createFixture ( {
82
+ shape : poly1 ,
83
+ density : 2.0 ,
84
+ } ) ;
85
+ jet . createFixture ( {
86
+ shape : poly2 ,
87
+ density : 2.0 ,
88
+ } ) ;
71
89
72
90
const boxFD = {
73
91
density : 1.0 ,
@@ -80,7 +98,10 @@ for (let i = 0; i < 10; ++i) {
80
98
position : { x : 0.0 , y : 5.0 + 1.54 * i } ,
81
99
} ) ;
82
100
83
- box . createFixture ( new Box ( 0.5 , 0.5 ) , boxFD ) ;
101
+ box . createFixture ( {
102
+ shape : new Box ( 0.5 , 0.5 ) ,
103
+ ...boxFD ,
104
+ } ) ;
84
105
85
106
const gravity = 10.0 ;
86
107
const I = box . getInertia ( ) ;
0 commit comments