Skip to content

Instantly share code, notes, and snippets.

@supereggbert
Created July 25, 2011 15:43
Show Gist options
  • Save supereggbert/1104419 to your computer and use it in GitHub Desktop.
Save supereggbert/1104419 to your computer and use it in GitHub Desktop.
Defining a car through the API
var wheel1 = new GLGE.PhysicsWheel();
wheel1.setRadius(0.5).setLocX(1.4).setLocY(-0.2).setLocY(0.9);
var wheel1Obj=new GLGE.Collada();
wheel1Obj.setDocument("wheel.dae");
wheel1.addCollada(wheel1Obj);
var wheel2 = new GLGE.PhysicsWheel();
wheel2.setRadius(0.5).setLocX(1.4).setLocY(-0.2).setLocY(-0.9);
var wheel2Obj=new GLGE.Collada();
wheel2Obj.setDocument("wheel.dae");
wheel2.addCollada(wheel2Obj);
var wheel3 = new GLGE.PhysicsWheel();
wheel3.setRadius(0.5).setLocX(-1.7).setLocY(-0.2).setLocY(0.9);
var wheel3Obj=new GLGE.Collada();
wheel3Obj.setDocument("wheel.dae");
wheel3.addCollada(wheel3Obj);
var wheel4 = new GLGE.PhysicsWheel();
wheel4.setRadius(0.5).setLocX(-1.7).setLocY(-0.2).setLocY(-0.9);
var wheel4Obj=new GLGE.Collada();
wheel4Obj.setDocument("wheel.dae");
wheel4.addCollada(wheel4Obj);
var carObject=new GLGE.Collada();
carObject.setDocumet("car.dae");
var car = new GLGE.PhysicsCar();
car.addCollada(carObject);
car.addPhysicsWheel(wheel1).addPhysicsWheel(wheel2).addPhysicsWheel(wheel3).addPhysicsWheel(wheel4);
scene.addChild(car);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment