UNPKG

@turbox3d/math

Version:

Large-scale graphics application math library

24 lines (23 loc) 900 B
import { Box3 } from './Box3'; import { Matrix4 } from './Matrix4'; import { Vector3 } from './Vector3'; declare class Ray { origin: Vector3; direction: Vector3; constructor(origin?: Vector3, direction?: Vector3); set(origin: Vector3, direction: Vector3): this; clone(): Ray; copy(ray: Ray): this; at(t: number, target: Vector3): Vector3; lookAt(v: Vector3): this; recast(t: number): this; closestPointToPoint(point: Vector3, target: Vector3): Vector3; distanceToPoint(point: Vector3): number; distanceSqToPoint(point: Vector3): number; distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number; intersectBox(box: Box3, target: Vector3): Vector3 | null; intersectsBox(box: Box3): boolean; applyMatrix4(matrix4: Matrix4): this; equals(ray: Ray): boolean; } export { Ray };