Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 1 Support › EntityBaseDraggable colliderComponent compatible with ColliderBase?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4572

    hener.stephan

    hey guys,

    i am having a problem using a ColliderBase with an EntityBaseDraggable,

    if i set the colliderComponent property to the ColliderBase i am not getting a

    collider in the game, but if i just use a CircleCollider it works fine

     

    example for a working  CircleCollider:

        CircleCollider {
            id: colliderBase2
            radius: 25
            friction: 1.6
            restitution: 0.2
            density: 50
    }

    but if use a ColliderBase, i am not getting a collider in the game eg:

        ColliderBase {
            id: colliderBase
    
            objectName: "circleCollider"
    
             fixtures: Circle {
    
               friction: 1.6
               restitution: 0.2
               radius: 25
               density: 50
               x: colliderBase.x
               y: colliderBase.y
               sensor: collisionTestingOnlyMode
             }
        }
    

    (which should be same as a CircleCollider according to http://felgo.com/doc/vplay1-colliderbase.html#example-usage)

     

    any idea why it doesn’t work?

     

    cheers

    stephan

    #4573

    Christian
    Felgo Team

    Could you post example code please?

    Out of interest: why would you like to write your own CircleCollider?

    Cheers, Chris

    #4574

    hener.stephan

    hi chris,

    nevermind my problem, i found another way to solve it without using a colliderBase

     

    my issue was that i had several shapes that use largely the same code in their colliders with the exception of the area of the collider,

    so i wanted to put the code for the colliders in the colliderBase in my base class and wanted to define the area via the fixtures property in the shape sub classes

     

    now i just define the colliders in the sub class and just use functions to avoid the duplicate code

    cheers

    stephan

     

     

     

    #4575

    Christian
    Felgo Team

    Sounds like a good solution!

    Cheers, Chris

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded