Forums

OverviewV-Play 2 Support (Qt 5)(Free) Particles influenced by entity rotation › Reply To: (Free) Particles influenced by entity rotation

OverviewV-Play 2 Support (Qt 5)(Free) Particles influenced by entity rotation › Reply To: (Free) Particles influenced by entity rotation
#8076

Alex
V-Play Team

Hi Thomas,

we can reproduce the issue and are working on a fix for this. The problem is the following: For the Free positionType, the particle is internally compensating the movement of the parent. Now in your use case, the parent is only rotation, so the particle is taking care of this rotation change to compensate it. This would work fine if the particle would be emitted in the center of the rotating parent. Now that the particle is NOT in the center of the parent, but sitting on the edge instead, it still only sees the rotation change of the parent, and not that the particle itself is effectively also changing its x and y coordinates on the screen, due to sitting on the edge of the rotating parent. Therefore the exact movement of the particle emitter is not fully compensated.

A workaround for you would be to wrap the particle in a parent item that performs the movement by really changing its x and y values. This could look like this:
main.qml

// ...      
      ParticleEmitter {
          id: particleEmitter
          x: scene.width/2
          y: scene.height/2
          jointBody: fix.body
      }

      Item {
        x: particleEmitter.x + particleEmitter.width/2 * Math.cos(particleEmitter.rotation*Math.PI/180)
        y: particleEmitter.y + particleEmitter.width/2 * Math.sin(particleEmitter.rotation*Math.PI/180)
        rotation: particleEmitter.rotation
        Particles {
          id: particles
        }
      }
// ...

If you want to try standard Qt5 Particles instead, this is a nice set of tutorials, also containing one for Particles: http://qmlbook.org/ch08/index.html

Sorry for the inconvenience.

Cheers,
Alex

  • This reply was modified 3 years, 12 months ago by  Alex.
  • This reply was modified 3 years, 12 months 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