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.

92 lines (91 loc) 4.19 kB
import type { DeepImmutable } from "../types.js"; import type { IVector2Like, IVector3Like, IVector4Like } from "./math.like.js"; /** * Creates a string representation of the IVector2Like * @param vector defines the IVector2Like to stringify * @param decimalCount defines the number of decimals to use * @returns a string with the IVector2Like coordinates. */ export declare function Vector2ToFixed(vector: DeepImmutable<IVector2Like>, decimalCount: number): string; /** * Computes the dot product of two IVector3Like objects. * @param a defines the first vector * @param b defines the second vector * @returns the dot product */ export declare function Vector3Dot(a: DeepImmutable<IVector3Like>, b: DeepImmutable<IVector3Like>): number; /** * Computes the squared length of the IVector3Like * @param vector the vector to measure * @returns the squared length of the vector */ export declare function Vector3LengthSquared(vector: DeepImmutable<IVector3Like>): number; /** * Computes the length of the IVector3Like * @param vector the vector to measure * @returns the length of the vector */ export declare function Vector3Length(vector: DeepImmutable<IVector3Like>): number; /** * Computes the squared distance between the IVector3Like objects * @param a defines the first vector * @param b defines the second vector * @returns the squared distance */ export declare function Vector3DistanceSquared(a: DeepImmutable<IVector3Like>, b: DeepImmutable<IVector3Like>): number; /** * Computes the distance between the IVector3Like objects * @param a defines the first vector * @param b defines the second vector * @returns the distance */ export declare function Vector3Distance(a: DeepImmutable<IVector3Like>, b: DeepImmutable<IVector3Like>): number; /** * Sets the given floats into the result. * @param x defines the x coordinate * @param y defines the y coordinate * @param z defines the z coordinate * @param result defines the result vector * @returns the result vector */ export declare function Vector3FromFloatsToRef<T extends IVector3Like>(x: number, y: number, z: number, result: T): T; /** * Stores the scaled values of a vector into the result. * @param a defines the source vector * @param scale defines the scale factor * @param result defines the result vector * @returns the scaled vector */ export declare function Vector3ScaleToRef<T extends IVector3Like>(a: DeepImmutable<IVector3Like>, scale: number, result: T): T; /** * Scales the current vector values in place by a factor. * @param vector defines the vector to scale * @param scale defines the scale factor * @returns the scaled vector */ export declare function Vector3ScaleInPlace<T extends IVector3Like>(vector: T, scale: number): T; export declare function Vector3SubtractToRef<T extends IVector3Like>(a: DeepImmutable<IVector3Like>, b: DeepImmutable<IVector3Like>, result: T): T; export declare function Vector3CopyToRef<T extends IVector3Like>(source: IVector3Like, result: T): T; export declare function Vector3LerpToRef<T extends IVector3Like>(start: T, end: T, amount: number, result: T): T; export declare function Vector3NormalizeToRef<T extends IVector3Like>(vector: DeepImmutable<T>, result: T): T; /** * Creates a string representation of the IVector3Like * @param vector defines the IVector3Like to stringify * @param decimalCount defines the number of decimals to use * @returns a string with the IVector3Like coordinates. */ export declare function Vector3ToFixed(vector: DeepImmutable<IVector3Like>, decimalCount: number): string; /** * Computes the dot product of two IVector4Like objects * @param a defines the first vector * @param b defines the second vector * @returns the dot product */ export declare function Vector4Dot(a: DeepImmutable<IVector4Like>, b: DeepImmutable<IVector4Like>): number; /** * Creates a string representation of the IVector4Like * @param vector defines the IVector4Like to stringify * @param decimalCount defines the number of decimals to use * @returns a string with the IVector4Like coordinates. */ export declare function Vector4ToFixed(vector: DeepImmutable<IVector4Like>, decimalCount: number): string;