import type { Context } from "../../context"; import * as BABYLON from "@babylonjs/core"; import type * as Inputs from "../../inputs"; import type { Base } from "../../inputs"; /** * Rays: a start point and a direction, optionally with a length, used to pick what lies along a * line of sight or to test intersections. `createPickingRay` builds the ray from the camera through * the pointer, the others build one from points. */ export declare class BabylonRay { private readonly context; constructor(context: Context); /** * Builds a ray from the active camera through the pointer's current position on the canvas, the * ray a click would pick with. * @returns The ray * @group create * @shortname create picking ray * @example * ```typescript * const ray = bitbybit.babylon.ray.createPickingRay(); * const pick = bitbybit.babylon.pick.pickWithRay({ ray }); * ``` */ createPickingRay(): BABYLON.Ray; /** * Builds a ray starting at `origin` and pointing along `direction`; `length` limits how far it * reaches, and 0 or nothing leaves it unlimited. * @param inputs - The origin, the direction and the optional length * @returns The ray * @group create * @shortname create custom ray * @example * ```typescript * const ray = bitbybit.babylon.ray.createRay({ origin: [0, 10, 0], direction: [0, -1, 0], length: 100 }); * ``` */ createRay(inputs: Inputs.BabylonRay.BaseRayDto): BABYLON.Ray; /** * Builds a ray that starts at `from`, points toward `to` and is exactly as long as the distance * between them. * @param inputs - The start point and the end point * @returns The ray * @group create * @shortname create ray from to * @example * ```typescript * const ray = bitbybit.babylon.ray.createRayFromTo({ from: [0, 10, 0], to: [0, 0, 0] }); * ``` */ createRayFromTo(inputs: Inputs.BabylonRay.FromToDto): BABYLON.Ray; /** * Reads the point a ray starts from, as a point in the scene. * @param inputs - The ray * @returns The origin point * @group get * @shortname get ray origin */ getOrigin(inputs: Inputs.BabylonRay.RayDto): Base.Point3; /** * Reads the direction a ray points in, as a unit vector. * @param inputs - The ray * @returns The direction vector * @group get * @shortname get ray direction */ getDirection(inputs: Inputs.BabylonRay.RayDto): Base.Vector3; /** * Reads how far a ray reaches; an unlimited ray reports a very large number. * @param inputs - The ray * @returns The length * @group get * @shortname get ray length */ getLength(inputs: Inputs.BabylonRay.RayDto): number; }