Forums

OverviewV-Play 2 Support (Qt 5)contactNormal property › Reply To: contactNormal property

OverviewV-Play 2 Support (Qt 5)contactNormal property › Reply To: contactNormal property
#7573

Alex
V-Play 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 4 years, 1 month ago by  Alex.
  • This reply was modified 4 years, 1 month ago by  Alex.
  • This reply was modified 4 years, 1 month ago by  Alex.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support