Class System<TBody>

collision system

Type Parameters

Hierarchy

Constructors

Properties

_maxEntries: number
_minEntries: number
ray: Line<any>

for raycasting

response: Response = ...

the last collision result

Methods

  • Parameters

    • bbox: any
    • path: any
    • level: any

    Returns void

  • Parameters

    • node: any
    • result: any

    Returns any

  • Parameters

    • node: any
    • m: any
    • M: any
    • compare: any

    Returns number

  • Parameters

    • items: any
    • left: any
    • right: any
    • height: any

    Returns {
        children: any;
        height: number;
        leaf: boolean;
        maxX: number;
        maxY: number;
        minX: number;
        minY: number;
    }

    • children: any
    • height: number
    • leaf: boolean
    • maxX: number
    • maxY: number
    • minX: number
    • minY: number
  • Parameters

    • node: any
    • m: any
    • M: any

    Returns void

  • Parameters

    • node: any
    • m: any
    • M: any

    Returns any

  • Parameters

    • bbox: any
    • node: any
    • level: any
    • path: any

    Returns any

  • Parameters

    • item: any
    • level: any
    • isNode: any

    Returns void

  • Parameters

    • insertPath: any
    • level: any

    Returns void

  • Parameters

    • node: any
    • newNode: any

    Returns void

  • check do 2 objects collide

    Parameters

    Returns boolean

  • Parameters

    • bbox: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns number

  • draw exact bodies colliders outline

    Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • draw bounding boxes hierarchy outline

    Parameters

    • context: CanvasRenderingContext2D
    • isTrigger: boolean = true

    Returns void

  • get object potential colliders

    Parameters

    Returns TBody[]

    because it's slower to use than checkOne() or checkAll()

  • re-insert body into collision tree and update its bbox every body can be part of only one system

    Parameters

    Returns this

  • remove body aabb from collision tree

    Parameters

    Returns this

  • separate (move away) 1 body, with optional callback before collision

    Parameters

    Returns void

  • used to find body deep inside data with finder function returning boolean found or not

    Parameters

    Returns undefined | TBody

  • update all bodies aabb

    Returns void

  • updates body in collision tree

    Parameters

    Returns void