Options
All
  • Public
  • Public/Protected
  • All
Menu

p2-es

Index

Type Aliases

AABBOptions: { lowerBound?: Vec2; upperBound?: Vec2 }

Type declaration

  • Optional lowerBound?: Vec2

    The lower bound of the bounding box.

  • Optional upperBound?: Vec2

    The upper bound of the bounding box.

AddBodyEvent: { body: Body; type: "addBody" }

Type declaration

  • body: Body
  • type: "addBody"
AddSpringEvent: { spring: Spring; type: "addSpring" }

Type declaration

  • spring: Spring
  • type: "addSpring"
BeginContactEvent: { bodyA: Body; bodyB: Body; contactEquations: ContactEquation[]; shapeA: Shape; shapeB: Shape; type: "beginContact" }

Type declaration

BodyEventMap: { sleep: SleepEvent; sleepy: SleepyEvent; wakeup: WakeUpEvent }

Type declaration

ConstraintOptions: { collideConnected?: boolean; wakeUpBodies?: boolean }

Type declaration

  • Optional collideConnected?: boolean

    Set to true if you want the connected bodies to collide.

  • Optional wakeUpBodies?: boolean

    Whether the constraint should wake up bodies when connected

EndContactEvent: { bodyA: Body; bodyB: Body; shapeA: Shape; shapeB: Shape; type: "endContact" }

Type declaration

ImpactEvent: { bodyA: Body; bodyB: Body; contactEquation: ContactEquation; shapeA: Shape; shapeB: Shape; type: "impact" }

Type declaration

PostBroadphaseEvent: { pairs: Body[]; type: "postBroadphase" }

Type declaration

  • pairs: Body[]
  • type: "postBroadphase"
PostStepEvent: { type: "postStep" }

Type declaration

  • type: "postStep"
PreSolveEvent: { contactEquations: ContactEquation[]; frictionEquations: FrictionEquation[]; type: "preSolve" }

Type declaration

RayOptions: { checkCollisionResponse?: boolean; collisionGroup?: number; collisionMask?: number; from?: Vec2; mode?: typeof CLOSEST | typeof ANY | typeof ALL; skipBackfaces?: boolean; to?: Vec2; callback?: any }

Type declaration

  • Optional checkCollisionResponse?: boolean

    Set to true if you want the Ray to take .collisionResponse flags into account on bodies and shapes.

  • Optional collisionGroup?: number

    Collision group

  • Optional collisionMask?: number

    Collision mask

  • Optional from?: Vec2

    Ray start point.

  • Optional mode?: typeof CLOSEST | typeof ANY | typeof ALL

    The intersection mode.

  • Optional skipBackfaces?: boolean

    If set to true, the ray skips any hits with normal.dot(rayDirection) < 0.

  • Optional to?: Vec2

    Ray end point.

  • callback?:function
    • Current, user-provided result callback. Will be used if mode is Ray.ALL.

      Parameters

      Returns void

RemoveBodyEvent: { body: Body; type: "removeBody" }

Type declaration

  • body: Body
  • type: "removeBody"
RemoveSpringEvent: { spring: Spring; type: "removeSpring" }

Type declaration

  • spring: Spring
  • type: "removeSpring"
SleepEvent: { type: "sleep" }

Type declaration

  • type: "sleep"
SleepyEvent: { type: "sleepy" }

Type declaration

  • type: "sleepy"
Vec2: number[] | [number, number] | Float32Array
WakeUpEvent: { type: "wakeup" }

Type declaration

  • type: "wakeup"
WorldEventMap: { addBody: AddBodyEvent; addSpring: AddSpringEvent; beginContact: BeginContactEvent; endContact: EndContactEvent; impact: ImpactEvent; postBroadphase: PostBroadphaseEvent; postStep: PostStepEvent; preSolve: PreSolveEvent; removeBody: RemoveBodyEvent; removeSpring: RemoveSpringEvent }

Type declaration