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



  • 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
        }
    


  • 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 (((


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.