topical media & game development
mobile-query-three-plugins-cannonjs-examples-test.htm / htm
<!doctype html><title>Minimal tQuery Page</title>
<script src="../../../build/tquery-bundle-require.js"></script>
<script src="vendor/cannon.js/build/cannon.js"></script>
<script src="../tquery.world.cannonjs.js"></script>
<script src="../tquery.object3d.cannonjs.js"></script>
<body><script>
require(['tquery.poolball'], function(){
var world = tQuery.createWorld().boilerplate().start()
.enableCannonjs()
// put some lights
tQuery.createAmbientLight().addTo(world).color(0x444444);
tQuery.createDirectionalLight().addTo(world).position(1,1,1);
var physicsWorld= world.cannonjsWorld();
physicsWorld.gravity.set(0,0,0);
physicsWorld.solver.iterations = 10;
var object3D = tQuery.createPoolBall().addTo(world)
.enableCannonjs()
var body = object3D.cannonjsBody();
physicsWorld.add(body);
body.angularVelocity.set(0,10,0);
});
</script></body>
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.