Forums

OverviewV-Play 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://v-play.net/doc/vplay1-colliderbase.html#example-usage)

     

    any idea why it doesn’t work?

     

    cheers

    stephan

    #4573

    Christian
    V-Play 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
    V-Play 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.

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