OverviewFelgo 2 Support (Qt 5) › (Free) Particles influenced by entity rotation


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #8073


    Hello everyone,


    when rotating an entity which includes a particle emitter, the movement of the emitted particles is influenced by the rotation of the entity. The effect becomes more obvious for fast rotation velocities. Here is some code which showcases the behaviour:



    import Felgo 3.0
    import QtQuick 2.0
    GameWindow {
      id: gameWindow
      activeScene: scene
      width: 960
      height: 640
      EntityManager {
        id: entityManager
        entityContainer: scene
      Scene {
        id: scene
        width: 480
        height: 320
          BoxCollider {
        	  id: fix
        	  x: scene.width / 2
        	  y: scene.height / 2
        	  bodyType: Body.Static
          ParticleEmitter {
          	  x: scene.width/2
          	  y: scene.height/2
          	  jointBody: fix.body
          PhysicsWorld {
            id: world
            updatesPerSecondForPhysics: 60
            gravity.y: 0.0
            velocityIterations: 5
            positionIterations: 5
            running: true
      }// scene


    import QtQuick 2.0
    import Felgo 3.0
    EntityBase {
      id: root
      width: 40
      height: 10
      //transformOrigin: Item.TopLeft
      property variant jointBody: null
      property alias body: collider.body
      BoxCollider {
        id: collider
        width: root.width
        height: root.height
        x: -root.width / 2
        y: -root.height / 2
        density: 0.05
        torque: {
        Rectangle {
          id: rect
          anchors.fill: parent
          color: "red"
      RevoluteJoint {
        id: joint
        bodyA: body
        bodyB: jointBody
        localAnchorA: Qt.point(-20, 0)
        world: physicsWorld
        id: particles
        x: 20


    import QtQuick 2.0
    import Felgo 3.0
    ParticleVPlay {
      id: particle
      fileName: "FireParticle.json"
      startParticleSize: 10
      startParticleSizeVariance: 0
      finishParticleSize: 10
      finishParticleSizeVariance: 0
      particleLifespan: 3
      positionType: ParticleVPlayBase.Free
      // start when finished loading
      autoStart: true


    For the particles “FireParticle.json” and “particleFire.png” are used which are included in the ParticleEditor demo.


    Any hint is highly appreciated!




    Felgo 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:

    // ...      
          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:

    Sorry for the inconvenience.


    • This reply was modified 5 years, 10 months ago by  Alex.
    • This reply was modified 5 years, 10 months ago by  Alex.
Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

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
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support