Using physics in monkey
Monkey Forums/User Modules/Using physics in monkey
| ||
Hi everybody Is there any physics's engine for monkey? |
| ||
There are a few on the Module Registry... Box2D https://code.google.com/p/monkeybox2d/ Chipmunk https://code.google.com/p/chipmonkey/ Fling (Physaxe) https://code.google.com/p/fling/ |
| ||
Chipmunk doesn't exist. I tried out Box2D and Fling, both downloaded from browsing the source (zip option) rather than the downloads part. Box2D was great, a little slow on Android, but Android release mode was about 14fps (domino stack test). Fling was a bit slower, but I do like the API a little more than Box2D. Both ran very fast on desktop and html5. Muddy shoes did both remarkably, and he spent more time optimizing Box2D Android than Fling, and the results show. |
| ||
Muddyshoes has done a fantastic job with the Box2D optimisation and the problem I feel now lies with Java rather than his Monkey code. I've used Box2D via the NDK on Android with GLBasics inline C option + static linking. It was very fast when compared to the iOS test I did. So I know it 'can' run very efficiently on Android. Has anyone tried compiling Muddyshoes lib using the NDK target on Android? Google recommends using the NDK for compiling physics libs as part of its NDK introduction. Or some sort of direct linkage to the C lib may be possible now we have an NDK target for Monkey? |
| ||
Ok Added box2d my modules folder of monkey, now I'm looking for some article or tutorial to teach me the basic code of preparation for the physical world and how to add an image to a force. For example AddForce used in Unity3D Could someone pass me an article or tutorial if possible a code showing this early? |
| ||
Dig into the code examples a bit, otherwise you'll probably have to use a tutorial made for box2d's flash port. There is also a C++ manual. That's what I used to learn it -- it's kinda a pain if you're not used to the paradigm, but once it starts to click it's not so bad. |
| ||
thank you my friend |
| ||
apply a vector force to a world pointClass b2body: Method ApplyForce : void (force:b2Vec2, point:b2Vec2) i also think you can SetAwake(true) a b2body and SetLinearVelocity(b2vec2) to do something similar. |
| ||
Hello AdamRedwoods Thanks man, but you can tell me that there is a way to apply that strength in angular points. example in a game of billiards |
| ||
http://www.iforce2d.net/b2dtut/forces |
| ||
Whoops, no NDK target available yet, just thought it wasn't available because I've not got the NDK SDK installed. |
| ||
The iforce tutorials were my goto when i wrote the box2d wrapper for fantomEngine. |