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. QML Particles QVector<T>::operator[]: "index out of range"

QML Particles QVector<T>::operator[]: "index out of range"

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 706 Views
  • 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.
  • G Offline
    G Offline
    Galbarad
    wrote on last edited by Galbarad
    #1

    Hi all
    I have some problem with particles. I'll try create effect of burning ground.
    but I see C++ exception instead of burning ground))
    maybe somebody found mistake in my code
    thank you

    update1

    1. I create new particles so each ImageParticle belong to only one group, but without result
    2. error raise only when emitter enabled first time or never, looks like a bug?

    update 2
    there is small project for watching error
    (just pres mouse when application started)
    https://drive.google.com/open?id=0B_sjcKIz2wKGQUM0OUY0djdOTXM

    update 3
    I leave in GroupGoal only one group by still take same error
    looks like I miss some basic

    update 4
    my particle system has very bad performance also ((

    thank you

    ParticleSystem {
            id: psMain
            anchors.fill: parent
            z: 50
        }
    
        ImageParticle {
            id: ipSmoke
            system: psMain
    
            groups: ["smoke", "flame_ground"]
            source: "qrc:///particleresources/glowdot.png"
            color: "#FF000011"
            colorVariation: 0
            z: 50
        }
    
        ImageParticle {
            id: ipFlame
            system: psMain
    
            groups: ["flame", "flame_ground"]
            source: "qrc:///particleresources/glowdot.png"
            color: "#11ff400f"
            colorVariation: 0.1
            z: 50
        }
    
        AngleDirection {
            id: agFire
            angle: 40
            magnitude: 500
            angleVariation: 2
            magnitudeVariation: 5
        }
    
        AngleDirection {
            id: agGround
            angle: 270
            magnitude: 500
            angleVariation: 180
            magnitudeVariation: 50
        }
    
        GroupGoal {
            id: ggGround
            groups: ["flame", "smoke"]
            goalState: "burn_ground"
            system: psMain
    
            height: 100
            anchors.bottom: parent.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            jump: true
        }
    
        ParticleGroup {
            name: "burn_ground"
            duration: 500
            system: psMain
    
            TrailEmitter {
                group: "flame_ground"
                //system: psMain
                enabled: true
                anchors.fill: parent
                lifeSpan: 300
                emitRatePerParticle: 5
                size: 10
                velocity: agGround
                acceleration: PointDirection {y: 20}
            }
        }
    
        Emitter {
            id: eFire
            x: 0
            y: 0
            z: 50
    
            group: "flame"
            system: psMain
    
            width: 10
            height: 10
    
            enabled: false
            emitRate: 1500
            lifeSpan: 1500
            size: 15
            endSize: 15
            sizeVariation: 10
            acceleration: PointDirection { y: 80; x: 100 }
            velocity: agFire
        }
    
        TrailEmitter {
            id: eSmoke
            group: "smoke"
            follow: "flame"
            system: psMain
    
            emitRatePerParticle: 1
            lifeSpan: 1400
            lifeSpanVariation: 400
            size: 16
            endSize: 8
            sizeVariation: 8
            acceleration: PointDirection { y: -120;}
            velocity: agFire
        }
    
    1 Reply Last reply
    0
    • G Offline
      G Offline
      Galbarad
      wrote on last edited by Galbarad
      #2

      looks like problem with few groups in ImageParticle
      there same minimal project where problem fixed
      https://drive.google.com/file/d/0B_sjcKIz2wKGd2xHS21Db0ZfQms/view?usp=sharing

      ImageParticle {
              id: ipSmoke
              system: psMain
      
              groups: ["smoke"]
              source: "qrc:///particleresources/glowdot.png"
              color: "#FF000011"
              colorVariation: 0
              z: 50
          }
      
          ImageParticle {
              id: ipFlame
              system: psMain
      
              groups: ["flame"]
              source: "qrc:///particleresources/glowdot.png"
              color: "#11ff400f"
              colorVariation: 0.1
              z: 50
          }
      
          ImageParticle {
              id: ipGroundSmoke
              system: psMain
      
              groups: ["smoke_ground"]
              source: "qrc:///particleresources/glowdot.png"
              color: "#FF000011"
              colorVariation: 0
              z: 50
          }
      
          ImageParticle {
              id: ipGroundFlame
              system: psMain
      
              groups: ["flame_ground"]
              source: "qrc:///particleresources/glowdot.png"
              color: "#11ff400f"
              colorVariation: 0.1
              z: 50
          }
      

      but performance still too bad (((

      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