@moxijs/core - v0.3.4
    Preparing search index...

    Interface PhysicsBodyOptions

    PhysicsBodyLogic configuration.

    interface PhysicsBodyOptions {
        angularVelocity?: number;
        bullet?: boolean;
        collidesWith?: CollisionTag[];
        collisionGroup?: number;
        collisionShape?: Graphics;
        collisionTags?: CollisionTag[];
        density?: number;
        fixedRotation?: boolean;
        friction?: number;
        height?: number;
        isSensor?: boolean;
        linearVelocity?: Point;
        position?: Point;
        radius?: number;
        restitution?: number;
        rotation?: number;
        shape?: ShapeType;
        syncMode?: SyncMode;
        syncPosition?: boolean;
        syncRotation?: boolean;
        type?: BodyType;
        userData?: any;
        vertices?: Point[];
        width?: number;
    }
    Index

    Properties

    angularVelocity?: number

    Initial angular velocity

    bullet?: boolean

    Enable continuous collision detection

    collidesWith?: CollisionTag[]

    Tags this body collides with (e.g., ['terrain', 'enemy'])

    collisionGroup?: number

    Collision group (negative = never collide within group)

    collisionShape?: Graphics

    Graphics object defining the collision shape.

    • For Graphics entities: Auto-extracted from entity if not provided
    • For Sprite entities: Must be provided
    collisionTags?: CollisionTag[]

    Tags this body has (e.g., ['player', 'character'])

    density?: number

    Density (default: 1.0)

    fixedRotation?: boolean

    Prevent rotation (default: false)

    friction?: number

    Friction (default: 0.3)

    height?: number

    Use collisionShape instead

    isSensor?: boolean

    Is sensor (trigger volume, no collision response)

    linearVelocity?: Point

    Initial linear velocity

    position?: Point

    Initial position in pixels

    radius?: number

    Use collisionShape instead

    restitution?: number

    Restitution/bounciness (default: 0.0)

    rotation?: number

    Initial rotation in radians

    shape?: ShapeType

    Use collisionShape instead

    syncMode?: SyncMode

    Synchronization mode (default: 'physics-driven')

    syncPosition?: boolean

    Sync position from physics to sprite (default: true)

    syncRotation?: boolean

    Sync rotation from physics to sprite (default: true)

    type?: BodyType

    Body type (default: 'dynamic')

    userData?: any

    Custom data attached to body

    vertices?: Point[]

    Use collisionShape instead

    width?: number

    Use collisionShape instead