phaser - v4.0.0-rc.4
    Preparing search index...

    Type Alias ConstraintType

    type ConstraintType = {
        angleA: number;
        angleB: number;
        angularStiffness: number;
        bodyA?: MatterJS.BodyType;
        bodyB?: MatterJS.BodyType;
        damping: number;
        id: number;
        label: string;
        length: number;
        plugin: any;
        pointA: MatterJS.Vector;
        pointB: MatterJS.Vector;
        render: MatterJS.IConstraintRenderDefinition;
        stiffness: number;
        type: string;
    }
    Index

    Properties

    angleA: number

    Either the angle of BodyA, or a config value.

    0
    
    angleB: number

    Either the angle of BodyB, or a config value.

    0
    
    angularStiffness: number

    A Number that specifies the angular stiffness of the constraint.

    0
    

    The first possible Body that this constraint is attached to.

    null
    

    The second possible Body that this constraint is attached to.

    null
    
    damping: number

    A Number that specifies the damping of the constraint, i.e. the amount of resistance applied to each body based on their velocities to limit the amount of oscillation. Damping will only be apparent when the constraint also has a very low stiffness. A value of 0.1 means the constraint will apply heavy damping, resulting in little to no oscillation. A value of 0 means the constraint will apply no damping.

    0
    
    id: number

    An integer Number uniquely identifying number generated in Composite.create by Common.nextId.

    label: string

    An arbitrary String name to help the user identify and manage bodies.

    "Constraint"
    
    length: number

    A Number that specifies the target resting length of the constraint. It is calculated automatically in Constraint.create from initial positions of the constraint.bodyA and constraint.bodyB.

    plugin: any

    An object reserved for storing plugin-specific properties.

    A Vector that specifies the offset of the constraint from center of the constraint.bodyA if defined, otherwise a world-space position.

    { x: 0, y: 0 }
    

    A Vector that specifies the offset of the constraint from center of the constraint.bodyB if defined, otherwise a world-space position.

    { x: 0, y: 0 }
    

    An Object that defines the rendering properties to be consumed by the module Matter.Render.

    stiffness: number

    A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting constraint.length. A value of 1 means the constraint should be very stiff. A value of 0.2 means the constraint acts like a soft spring.

    1
    
    type: string

    A String denoting the type of object.

    "constraint"