Ray

Hierarchy

  • Ray

Index

Constructors

constructor

Properties

direction

direction: Vector3

length

length: number

origin

origin: Vector3

Methods

intersectionSegment

  • intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number
  • Intersection test between the ray and a given segment whithin a given tolerance (threshold)

    Parameters

    • sega: Vector3

      the first point of the segment to test the intersection against

    • segb: Vector3

      the second point of the segment to test the intersection against

    • threshold: number

      the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful

    Returns number

    the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection

intersectsBox

intersectsBoxMinMax

intersectsMesh

intersectsMeshes

intersectsPlane

intersectsSphere

intersectsTriangle

update

  • update(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray
  • Parameters

    • x: number
    • y: number
    • viewportWidth: number
    • viewportHeight: number
    • world: Matrix
    • view: Matrix
    • projection: Matrix

    Returns Ray

Static CreateNew

  • CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray
  • Parameters

    • x: number
    • y: number
    • viewportWidth: number
    • viewportHeight: number
    • world: Matrix
    • view: Matrix
    • projection: Matrix

    Returns Ray

Static CreateNewFromTo

  • Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be transformed to the given world matrix.

    Parameters

    • origin: Vector3

      The origin point

    • end: Vector3

      The end point

    • Optional world: Matrix

      a matrix to transform the ray to. Default is the identity matrix.

    Returns Ray

Static Transform

Static TransformToRef

  • TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void
  • Parameters

    Returns void

Static Zero

Generated using TypeDoc