November 1, 2011

malikaliabbas malikaliabbas
Lab Rat
10 posts

Apply Linear Impulse using Box2d in QML

 

Hello All,

I am in a process of developing a game using Box2d physics engine. I am stuck in a situation, in which I need to apply linear impulse on a component/body (game character) that is created using Qt Quick in qml file. Kindly guide me how to apply Linear impulse on that Body, Thanks in advance

Regards,
Ali Abbas

4 replies

November 1, 2011

malikaliabbas malikaliabbas
Lab Rat
10 posts

Hello All,

I have found the way to apply Linear Impulse. My object name is ‘strikerBody’ and I used the following command to do it

strikerBody.applyLinearImpulse(Qt.point(0, -100), Qt.point(0,0))

Regards,
Ali Abbas

November 7, 2011

raja26 raja26
Lab Rat
77 posts

I never really thought of using Box2D with QML. Can you write a small guide, for e.g. Moving an object.

November 10, 2011

malikaliabbas malikaliabbas
Lab Rat
10 posts

Dear Raja,

You can find some help from the following demo projects. Later as I have some time I’ll write a helping page.

https://projects.developer.nokia.com/qmlbox2ddemo

https://projects.developer.nokia.com/mototrialracer

I am using the first one demo for my project

Regards,
Ali Abbas

November 10, 2011

raja26 raja26
Lab Rat
77 posts

I already know about this, but I’m looking for a very basic tutorial. It would be useful only when they know about Box2D I think.

 
  ‹‹ Continuous ListView update causing UI to stuck.      [SOLVED] how to dynamic assign a value to qml item’s property transform ››

You must log in to post a reply. Not a member yet? Register here!