mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
change examples to render using a fixed resolution
This commit is contained in:
parent
6108a31f27
commit
0895d81fa1
44 changed files with 89 additions and 87 deletions
|
@ -27,6 +27,8 @@
|
||||||
inline: false,
|
inline: false,
|
||||||
preventZoom: true,
|
preventZoom: true,
|
||||||
resetOnOrientation: true,
|
resetOnOrientation: true,
|
||||||
|
routing: true,
|
||||||
|
startExample: 'mixed',
|
||||||
examples: [
|
examples: [
|
||||||
{
|
{
|
||||||
name: 'Air Friction',
|
name: 'Air Friction',
|
||||||
|
|
|
@ -18,8 +18,8 @@ Example.airFriction = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,8 +25,8 @@ Example.avalanche = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,8 +25,8 @@ Example.ballPool = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,8 +22,8 @@ Example.bridge = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.broadphase = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true,
|
showAngleIndicator: true,
|
||||||
showBroadphase: true
|
showBroadphase: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.car = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true,
|
showAngleIndicator: true,
|
||||||
showCollisions: true
|
showCollisions: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ Example.catapult = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true,
|
showAngleIndicator: true,
|
||||||
showCollisions: true,
|
showCollisions: true,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
|
|
|
@ -22,8 +22,8 @@ Example.chains = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true,
|
showAngleIndicator: true,
|
||||||
showCollisions: true,
|
showCollisions: true,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.circleStack = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.cloth = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600)
|
height: 600
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.collisionFiltering = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
wireframes: false,
|
wireframes: false,
|
||||||
background: '#111'
|
background: '#111'
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.compositeManipulation = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.compound = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAxes: true,
|
showAxes: true,
|
||||||
showConvexHulls: true
|
showConvexHulls: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.compoundStack = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.concave = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600)
|
height: 600
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.constraints = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,8 +24,8 @@ Example.doublePendulum = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
wireframes: false,
|
wireframes: false,
|
||||||
background: '#0f0f13'
|
background: '#0f0f13'
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ Example.events = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
wireframes: false
|
wireframes: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,8 +18,8 @@ Example.friction = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.gravity = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showVelocity: true,
|
showVelocity: true,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.gyro = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.manipulation = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAxes: true,
|
showAxes: true,
|
||||||
showCollisions: true,
|
showCollisions: true,
|
||||||
showConvexHulls: true
|
showConvexHulls: true
|
||||||
|
|
|
@ -20,9 +20,9 @@ Example.mixed = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.newtonsCradle = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.pyramid = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,8 +25,8 @@ Example.ragdoll = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true,
|
showAngleIndicator: true,
|
||||||
background: '#0f0f13'
|
background: '#0f0f13'
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@ Example.raycasting = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,8 +18,8 @@ Example.restitution = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true,
|
showAngleIndicator: true,
|
||||||
showCollisions: true,
|
showCollisions: true,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
|
|
|
@ -18,8 +18,8 @@ Example.rounded = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAxes: true
|
showAxes: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.sensors = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
wireframes: false,
|
wireframes: false,
|
||||||
background: '#111'
|
background: '#111'
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ Example.sleeping = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.slingshot = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.softBody = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: false
|
showAngleIndicator: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.sprites = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
background: '#0f0f13',
|
background: '#0f0f13',
|
||||||
showAngleIndicator: false,
|
showAngleIndicator: false,
|
||||||
wireframes: false
|
wireframes: false
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.stack = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.staticFriction = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showVelocity: true
|
showVelocity: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.stress = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600)
|
height: 600
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ Example.stress2 = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600)
|
height: 600
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ Example.svg = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600)
|
height: 600
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ Example.terrain = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600)
|
height: 600
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ Example.timescale = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,8 +23,8 @@ Example.views = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
hasBounds: true,
|
hasBounds: true,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@ Example.wreckingBall = function() {
|
||||||
element: document.body,
|
element: document.body,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
options: {
|
options: {
|
||||||
width: Math.min(document.documentElement.clientWidth, 800),
|
width: 800,
|
||||||
height: Math.min(document.documentElement.clientHeight, 600),
|
height: 600,
|
||||||
showAngleIndicator: true
|
showAngleIndicator: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue