Skip to content

Instantly share code, notes, and snippets.

@hashrocketeer
Created April 14, 2014 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashrocketeer/10677275 to your computer and use it in GitHub Desktop.
Save hashrocketeer/10677275 to your computer and use it in GitHub Desktop.
// Generated by CoffeeScript 1.6.3
var constraint, material, mesh, wheel_geometry;
material = Physijs.createMaterial(new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('images/checker.gif')
}), .8, .5);
wheel_geometry = new THREE.CylinderGeometry(5, 5, 2, 16);
mesh = new Physijs.CylinderMesh(wheel_geometry, material, 16);
mesh.position.set(0, 10, 0);
scene.add(mesh);
constraint = new Physijs.DOFConstraint(mesh, mesh.position);
scene.addConstraint(constraint);
constraint.configureAngularMotor(1, 1, 0, -5, 2000);
constraint.enableAngularMotor(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment