Raycaster constructor

Raycaster([
  1. Vector3? origin,
  2. Vector3? direction,
  3. num? near,
  4. num? far,
])

Implementation

Raycaster([Vector3? origin, Vector3? direction, num? near, num? far]) {
  ray = Ray(origin, direction);
  // direction is assumed to be normalized (for accurate distance calculations)

  this.near = near ?? 0;
  this.far = far ?? double.infinity;
  layers = Layers();

  params = {
    "Mesh": {},
    "Line": {"threshold": 1},
    "LOD": {},
    "Points": {"threshold": 1},
    "Sprite": {}
  };
}