[ Launch: verlet-js ] 5451027 by garyjbowles
[ Launch: verlet-js ] 5431559 by enjalot
-
-
Save giles-cholmondley-durston/5451027 to your computer and use it in GitHub Desktop.
verlet-js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"verlet-js","endpoint":"","display":"canvas","public":true,"require":[{"name":"verlet-js","url":"http://enjalot.github.io/verlet-js/verlet.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//verlet-js: http://subprotocol.com/2013/04/18/introducing-verlet-js.html | |
var width = tributary.sw; | |
var height = tributary.sh; | |
var sim; | |
tributary.init = function(ctx) { | |
// simulation | |
sim = new VerletJS(width, height, tributary.canvas); | |
sim.friction = 1.015; | |
// entities | |
var tire1 = sim.tire(new Vec2(383,-11), 102, 7, 1.463616, 0.15); | |
console.log("sim", sim) | |
} | |
tributary.run = function(ctx, t) { | |
if(sim) { | |
sim.frame(11); | |
sim.draw(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment