Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Walls collisions doesnt works

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7512

    Vlad

    Hi

     

    I’m used Wall entity from previous Felgo version and it works ok in Felgo 1.5.x

    but now in Felgo 2.0 it doesnt works anymore

    Did you changed something in this area?

     

    thanks

     

    #7513

    Christian
    Felgo Team

    Hi Vlad,

    no we didn’t change anything there (on purpose). Can you post the code that shows the issue?

    Cheers, Chris

    #7515

    Vlad

    Hi

     

    it seems, CircleCollider gets broken

    If I’ll change entity to boxcollider, its looks much better

    #7516

    Vlad

    ok, some mystic:

    here is level01.qml

    import QtQuick 2.0
    import "entities"
    
    Item {
        id: _root
        //anchors.fill: parent
        x: 0
        y: 0
        width: parent.width
        height: parent.height
        
        // these entities will be created when the game launches
    
        Wall {
            height: 1
            width: parent.width
            y: 0
            x: 0
            variationType: "ceil"
        }
    
        Wall {
            height: 1
            width: parent.width
            y: parent.height
            x: 0
            variationType: "floor"
        }
        
        Wall {
            width: 1
            height: _root.height
            x: 0
            y: 0
            boxColliderX: 1
            variationType: "left"
            onHeightChanged: console.log("level01 wall h:", height)
        }
        
        Wall {
            width: 1
            height: _root.height
            x: parent.width
            y: 0
            variationType: "right"
            boxColliderX: 1
        }
    
        Component.onCompleted: {
            entityManager.createPooledEntitiesFromUrl(Qt.resolvedUrl("entities/Corn.qml"))
        }
        onWidthChanged: console.log("leel01 w:", width)
        onHeightChanged: console.log("leel01 h:", height)
    }
    
    

    here is Wall.qml

    import QtQuick 2.0
    import Felgo 3.0
    //import Box2D 1.0
    
    
    EntityBase {
        id: entity
        entityType: "wall"
        collidersActive: true
        preventFromRemovalFromEntityManager: true
        property alias boxColliderX: boxCollider.x
        property alias boxColliderY: boxCollider.y
    
        BoxCollider {
            id: boxCollider
            categories: Box.Category1
            //collisionTestingOnlyMode: true
            // the wall shouldnt move
            bodyType: Body.Static
            anchors.fill: rect
        }
    
        
        Rectangle {
            id: rect
            color: "brown"
            anchors.fill: parent
        }
    }
    
    

     

    turning on debug draws in PhysicsWorld I’ve discovered that only one wall (variationType:  “right”) gets correct size of parent.height/width

    there rest elements gets something about 32 pixels

    If I set numbers explicitly, everything works ok

     

    can you explain this?

    #7537

    Vlad

    any thoughts?

     

    #7538

    Alex
    Felgo Team

    Hi vladest,

    sorry for the late response. Can you please send a small project that contains the issues you mentioned to support@felgo.com? Then i can dive into debugging the problems right away.

    Cheers,
    Alex

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.