Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PickingRaycaster

Raycasting points is not supported as necessary in Three.js. This class extends a [[THREE.Raycaster]] and adds the width / height of the canvas to allow picking of screen space geometry.

internal

Hierarchy

  • Raycaster
    • PickingRaycaster

Index

Constructors

constructor

Properties

camera

camera: Camera

The camera to use when raycasting against view-dependent objects such as billboarded objects like Sprites. This field can be set manually or is set when calling "setFromCamera".

Readonly canvasSize

canvasSize: Vector2

the canvas width and height.

far

far: number

The far factor of the raycaster. This value indicates which objects can be discarded based on the distance. This value shouldn't be negative and should be larger than the near property.

default

Infinity

layers

layers: Layers

Used by Raycaster to selectively ignore 3D objects when performing intersection tests.

default

new THREE.Layers()

near

near: number

The near factor of the raycaster. This value indicates which objects can be discarded based on the distance. This value shouldn't be negative and should be smaller than the far property.

default

0

params

params: RaycasterParameters
default

{ Mesh: {}, Line: { threshold: 1 }, LOD: {}, Points: { threshold: 1 }, Sprite: {} }

ray

ray: Ray

The Ray used for the raycasting.

Methods

intersectObject

  • intersectObject(object: Object3D, recursive?: undefined | false | true, optionalTarget?: Intersection[]): Intersection[]
  • Parameters

    • object: Object3D
    • Optional recursive: undefined | false | true
    • Optional optionalTarget: Intersection[]

    Returns Intersection[]

intersectObjects

  • intersectObjects(objects: Object3D[], recursive?: undefined | false | true, optionalTarget?: Intersection[]): Intersection[]
  • Parameters

    • objects: Object3D[]
    • Optional recursive: undefined | false | true
    • Optional optionalTarget: Intersection[]

    Returns Intersection[]

set

  • set(origin: Vector3, direction: Vector3): void
  • Updates the ray with a new origin and direction.

    Parameters

    • origin: Vector3

      The origin vector where the ray casts from.

    • direction: Vector3

      The normalized direction vector that gives direction to the ray.

    Returns void

setFromCamera

  • setFromCamera(coords: { x: number; y: number }, camera: Camera): void
  • Updates the ray with a new origin and direction.

    Parameters

    • coords: { x: number; y: number }

      2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1.

      • x: number
      • y: number
    • camera: Camera

      camera from which the ray should originate

    Returns void

Generated using TypeDoc