Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Apply Linear Impulse using Box2d in QML
Qt 6.11 is out! See what's new in the release blog

Apply Linear Impulse using Box2d in QML

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 3.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    malikaliabbas
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      malikaliabbas
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • R Offline
        R Offline
        raja26
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • M Offline
          M Offline
          malikaliabbas
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • R Offline
            R Offline
            raja26
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved