deltaluca

Untitled

Mar 29th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var weldJoint = new SymbolicConstraint("
  2. body b1
  3. body b2
  4.  
  5. vector anchor1
  6. vector anchor2
  7. scalar phase
  8.  
  9. let r1 = relative b1.rot anchor1 in
  10. let r2 = relative b2.rot anchor2 in
  11. { (b2.pos + r2) - (b1.pos + r1)
  12.    b2.rot - b1.rot - phase     }
  13. ");
  14.  
  15. weldJoint.setBody("b1", ...);
  16. weldJoint.setBody("b2", ...);
  17. weldJoint.setVector("anchor1", new Vec2(...));
  18. weldJoint.setVector("anchor2", new Vec2(...));
  19. weldJoint.setScalar("phase", ...);
  20.  
  21. weldJoint.space = space;
  22.  
  23. trace(weldJoint.debug());
Advertisement
Add Comment
Please, Sign In to add comment