Skip to content

tmpvar/constraint2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

constraint2

api surface

var Constraint2 = require('constraint2')

var c = new Constraint2();
var v = new Vec2(0, 0)

// lets make seg only move vertically
var fn = c.addConstraint(v, function(vec) {
  return new Vec2(v.x, vec.y);
});

// attempt a move
c.position(v, 10, 10);

console.log(v.toString()); // (0, 10);

c.remove(fn);

c.position(v, 10, 10);

console.log(v.toString()); // (10, 10);

license

MIT (see: license.txt)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published