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

    Variable PhysicsMaterialsConst

    PhysicsMaterials: {
        bouncy: { density: 0.5; friction: 0.1; restitution: 0.9 };
        character: {
            density: 1;
            fixedRotation: true;
            friction: 0.5;
            restitution: 0;
        };
        ice: { density: 0.9; friction: 0.02; restitution: 0.05 };
        metal: { density: 1.5; friction: 0.3; restitution: 0.1 };
        rubber: { density: 1; friction: 0.9; restitution: 0.7 };
        terrain: { density: 0; friction: 0.6; restitution: 0 };
        wood: { density: 0.7; friction: 0.4; restitution: 0.2 };
    } = ...

    Predefined material presets for common physics behaviors

    Type Declaration

    • Readonlybouncy: { density: 0.5; friction: 0.1; restitution: 0.9 }

      Bouncy ball - high restitution, low friction

    • Readonlycharacter: { density: 1; fixedRotation: true; friction: 0.5; restitution: 0 }

      Character - no rotation, medium friction

    • Readonlyice: { density: 0.9; friction: 0.02; restitution: 0.05 }

      Ice - very low friction, low restitution

    • Readonlymetal: { density: 1.5; friction: 0.3; restitution: 0.1 }

      Metal object - high density, low restitution

    • Readonlyrubber: { density: 1; friction: 0.9; restitution: 0.7 }

      Rubber - high friction, high restitution

    • Readonlyterrain: { density: 0; friction: 0.6; restitution: 0 }

      Static terrain - no density (immovable), high friction

    • Readonlywood: { density: 0.7; friction: 0.4; restitution: 0.2 }

      Wooden box - medium density, medium friction

    const ball = asPhysicsEntity(sprite, world, {
    type: 'dynamic',
    ...PhysicsMaterials.bouncy
    });