← Back to Docs
  • index.html
  • Clayground
  • Clayground.Physics
  • PhysicsUtils
  • Clayground 2025.2
  • PhysicsUtils QML Type

    Singleton utility providing physics collision connection helpers. More...

    Import Statement: import Clayground.Physics

    Detailed Description

    PhysicsUtils offers convenience functions for connecting to Box2D fixture collision signals, automatically extracting the target item from contacted fixtures.

    Example usage:

    import Clayground.Physics
    
    Component.onCompleted: {
        PhysicsUtils.connectOnEntered(myFixture, (entity) => {
            console.log("Collided with:", entity)
        })
    }

    Methods

    Connects a callback to the fixture's beginContact signal.

    Connects a callback to the fixture's endContact signal.