Skip to content
ben-sangster edited this page Oct 13, 2010 · 1 revision

Description

The isect module provides an interface for performing intersection testing on the scene.

Functions

API

Found in "dmz/components/isect"

API Constants

  • FirstPoint
  • ClosestPoint
  • AllPoints

API Functions

Object[] {} doIsect (Object {start: Vector startPos, end: Vector endPos | direction: Vector dir, [callback: Function f (Object {} value)] }) Object[] {} doIsect (Object[] {start: Vector startPos, end: Vector endPos | direction: Vector dir, [callback: Function f (Object {} value)] })

  • The function takes as an argument either a single object or an array of objects.

  • The argument Object(s) take the following fields:

    • start: Vector startPos
    • end: Vector endPos
    • direction: Vector dir
    • callback: Function f (Object {} value)
  • The argument object requires start, either end or direction, and optionally callback. The type of intersection testing depends on whether end or direction is specified. The function specified by callback is called on each result.

  • This function always returns an array of results that is the same size as the number of objects uses for arguments. The returned objects (and the object used as an argument to the callback function, have the following fields:

    • id
    • type
    • point
    • normal
    • object
    • distance
Clone this wiki locally