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

    Rectangle-shaped physics body with visual representation. More...

    Import Statement: import Clayground.Physics
    Inherited By:

    RectTrigger

    Detailed Description

    RectBoxBody combines a visual Rectangle with a Box2D box fixture, providing an easy way to create rectangular physics objects.

    Example usage:

    import Clayground.Physics
    import Box2D
    
    RectBoxBody {
        xWu: 5; yWu: 10
        widthWu: 2; heightWu: 1
        color: "blue"
        bodyType: Body.Dynamic
        density: 1
        friction: 0.3
        restitution: 0.5
    }

    Properties

    The Box2D box fixture.

    Fill color of the rectangle.

    Corner radius of the rectangle.

    Border properties of the rectangle.

    Fixture density affecting mass.

    Friction coefficient (0-1).

    Bounciness coefficient (0-1).

    If true, detects collisions without physical response.

    Collision category bits.

    Collision mask bits.

    Collision group index.