Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › contactNormal property

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #7547

    Vlad

    Hi

     

    just curious, what was happend with contactNormal property, which worked in Felgo 1.x, but now it give very weird data

     

    thanks

    #7549

    Alex
    Felgo Team

    Hi vladest,

    what data are you receiving? We just ran some tests and got the same results on VPlay 1.5 and 2.0.

    Cheers,
    Alex

    #7550

    Vlad

    the x value is always 0 and the y is very small, something like 2e-45

    #7552

    Alex
    Felgo Team

    Is it possible to create a small project that contains the error and send it to support@felgo.com ? We haven’t been able to reproduce that issue so far.

    Cheers,
    Alex

    #7554

    Vlad

    Hi Alex

     

    this happens only when collisionTestingOnlyMode: true

    br,

    Vlad

    #7555

    Alex
    Felgo Team

    Hi Vlad,

    the contactNormal is calculated to determine the reaction of a body after a collision. As colliders with collisionTestingOnlyMode true do NOT respond to the collision, it is not calculated by Box2D internally. So this is the expected Box2D behavior, and it applies to both VPlay 1.5 and Felgo 3.0 in our tests.

    Why do you need to know the contactNormal in this type of collision?

    Cheers,
    Alex

    #7561

    Vlad

    Hi Alex

     

    I’ve implementing pool-like playfield. I’ve took CarChallenge demo as example of pool-physics, however my items starting from the edges of the screen and at appear time it becomes collided with walls. So I’m trying to avoid this

    #7573

    Alex
    Felgo Team

    I see, that’s a little tricky.

    The first approach that came to my mind is the following:

    No use of collisionTestingOnlyMode at all. Instead you set the “categories” property of the Walls to e.g. Box.Category1 and the “collidesWith” property of your items to e.g. Box.Category2 (different from the walls) initially

    This way they won’t collide upon appearance of the item. And once the item passed the wall after creation, you can change the “collidesWith” property of your item to the same as the walls have.

    You will just have to figure out how to find out that the item has passed the wall initially. You could e.g. use a Timer and change the Category after a time that you are completely sure that you passed the wall. Or you use onXChanged and onYChanged signals to determine if the item is inside the “game field”, which of course could affect performance as they are called continuous. I am pretty sure there are also other and better possibilities, depending on your implementation.

    Could this work for you?

    Cheers,
    Alex

    • This reply was modified 9 years, 11 months ago by  Alex.
    • This reply was modified 9 years, 11 months ago by  Alex.
    • This reply was modified 9 years, 11 months ago by  Alex.
    #7580

    Vlad

    Hi Alex

     

    yes, Timer trick works it seems

    Thanks

     

Viewing 9 posts - 1 through 9 (of 9 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded