| 1 | var g1, g2, b1, b2; |
| 2 | |
| 3 | function demo() { |
| 4 | |
| 5 | cam ( 90, 20, 100 ); |
| 6 | |
| 7 | world = new OIMO.World({ info:true }); |
| 8 | |
| 9 | g1 = add({ size:[50, 10, 20], pos:[0,-5,12], rot:[0,0,-1], density:1, restitution:0.4 }); |
| 10 | g2 = add({ size:[50, 10, 20], pos:[0,-5,-12], rot:[0,0,1], density:1, restitution:0.6 }); |
| 11 | |
| 12 | // basic geometry body |
| 13 | b1 = add({ type:'sphere', size:[1], pos:[0,60,12], move:true, restitution:0.4 }); |
| 14 | b2 = add({ type:'sphere', size:[1], pos:[0,20,-12], move:true, restitution:0.6 }); |
| 15 | |
| 16 | // world internal loop |
| 17 | world.postLoop = postLoop; |
| 18 | world.play(); |
| 19 | |
| 20 | }; |
| 21 | |
| 22 | function contact () { |
| 23 | |