Merge pull request #7668 from piranha771/matter-update

matter-js updated to version 0.9.0
This commit is contained in:
Horiuchi_H
2016-01-20 17:10:18 +09:00
2 changed files with 3094 additions and 1425 deletions
+13 -13
View File
@@ -7,25 +7,25 @@ var Engine = Matter.Engine,
Composites = Matter.Composites,
Constraint = Matter.Constraint,
Events = Matter.Events,
Query = Matter.Query
Query = Matter.Query;
var engine = Engine.create(document.body)
var engine = Engine.create();
//Bodies
var box1 = Bodies.rectangle(400,200,80,80)
var box1 = Bodies.rectangle(400,200,80,80);
var box2 = Bodies.rectangle(400,610,810,60, {
angle: 10,
angularSpeed: 11,
angularVelocity: 1,
density: 4,
isStatic: true
})
});
var circle1 = Bodies.circle(100,100,50)
var circle1 = Bodies.circle(100,100,50);
World.addBody(engine.world, box1)
World.add(engine.world, [box2, circle1])
World.addBody(engine.world, box1);
World.add(engine.world, [box2, circle1]);
//Composites
@@ -40,18 +40,18 @@ var constraint1 = Constraint.create({
bodyA: box1,
bodyB: box2,
stiffness: 0.02
})
});
//Query
var collisions = Query.ray([box1, box2, circle1], {x:1, y:2}, {x:3, y:4});
World.addConstraint(engine.world, constraint1)
World.addConstraint(engine.world, constraint1);
//events
Events.on(engine, "beforeTick", (e:any)=>{
})
Events.on(engine, "beforeTick", (e:Matter.IEventTimestamped<Matter.Engine>)=>{
});
Engine.run(engine)
Engine.run(engine);
+3081 -1412
View File
File diff suppressed because it is too large Load Diff