| 1 | function demo() { |
| 2 | |
| 3 | cam (170,30,50); |
| 4 | |
| 5 | world = new OIMO.World({ |
| 6 | timestep: 1/60, |
| 7 | iterations: 8, |
| 8 | broadphase: 2, // 1: brute force, 2: sweep & prune, 3: volume tree |
| 9 | worldscale: 1, |
| 10 | random: true, |
| 11 | info:true // display statistique |
| 12 | }); |
| 13 | |
| 14 | addTower({radius:9,height:20,detail:15,pos:[5,0,5],mass:0.4}); |
| 15 | |
| 16 | add({type:'sphere',move:true,density:0.6,size:[2],pos:[-45,25,0]}) |
| 17 | add({size:[2, 40, 50], pos:[-30,10,0], rot:[0,0,60], density:1, restitution:0.2 }) |
| 18 | world.add({size:[50, 10, 50], pos:[0,-5,0], rot:[0,0,0], density:1, restitution:0.5 }); |
| 19 | |
| 20 | // world internal loop |
| 21 | world.postLoop = postLoop; |
| 22 | world.play(); |
| 23 | |
| 24 | }; |
| 25 | |
| 26 | function addTower(o){ |
| 27 | |