UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

59 lines (58 loc) 1.79 kB
import { Vector3 } from "../Maths/math.vector.js"; import { CastingResult } from "./castingResult.js"; /** * Interface for query parameters in the raycast function. * @see the "Collision Filtering" section in https://github.com/eoineoineoin/glTF/tree/MSFT_RigidBodies/extensions/2.0/Vendor/MSFT_collision_primitives */ export interface IRaycastQuery { /** Membership mask */ membership?: number; /** CollideWith mask */ collideWith?: number; /** Should trigger collisions be considered in the query? */ shouldHitTriggers?: boolean; } /** * Holds the data for the raycast result * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine */ export declare class PhysicsRaycastResult extends CastingResult { private _hitDistance; private _rayFromWorld; private _rayToWorld; /** * Gets the distance from the hit */ get hitDistance(): number; /** * Gets the hit normal/direction in the world */ get hitNormalWorld(): Vector3; /** * Gets the hit point in the world */ get hitPointWorld(): Vector3; /** * Gets the ray "start point" of the ray in the world */ get rayFromWorld(): Vector3; /** * Gets the ray "end point" of the ray in the world */ get rayToWorld(): Vector3; /** * Sets the distance from the start point to the hit point * @param distance defines the distance to set */ setHitDistance(distance: number): void; /** * Calculates the distance manually */ calculateHitDistance(): void; /** * Resets all the values to default * @param from The from point on world space * @param to The to point on world space */ reset(from?: Vector3, to?: Vector3): void; }