How to interact with the bodies using javascript

General discussion about the R.U.B.E editor
Post Reply
Abhishek
Posts: 5
Joined: Thu Feb 21, 2013 6:49 am

How to interact with the bodies using javascript

Post by Abhishek »

Once we export the json file and load it in js, hw can I apply forces,impulses to specific bodies,use contact listeners, etc???
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to interact with the bodies using javascript

Post by iforce2d »

Check out the examples in the sampleLoaders folder (the one which uses ajac, not the 'standalone' one). For example in vehicles_bike.js, specific bodies are obtained with getNameBodies. You can see other available functions at the bottom of loadrube.js

You can also find some general info in the integrated help in RUBE ("Using exported data" -> "Supported loaders" -> "Javascript").
Post Reply