import { Mat4 } from './mat4'; /** * Class representing a three-dimensional Vector with properties x, y and z and providing static utilities for mathematical operations */ export declare class Vec3 { readonly x: number; readonly y: number; readonly z: number; /** * Add two Vec3s * * @param left the first Vec3 * @param right the second Vec3 * * @returns the result of the addition */ static add(left: Vec3, right: Vec3): Vec3; /** * Subtract the right Vec3 from the left * * @param left the Vec3 to subtract from * @param right the Vec3 to subtract * * @returns the result of the subtraction */ static sub(left: Vec3, right: Vec3): Vec3; /** * Multiply two Vec3s * * @param left the first Vec3 * @param right the second Vec3 * * @returns the result of the multiplication */ static mult(left: Vec3, right: Vec3): Vec3; /** * Divide the left Vec3 by the right * * @param left the Vec3 to divide * @param right the Vec3 to divide by * * @returns the result of the division */ static div(left: Vec3, right: Vec3): Vec3; /** * Scale a Vec3 by a given factor * * @param v the Vec3 to scale * @param factor the factor to scale by * * @returns the scaled Vec3 */ static scale(v: Vec3, factor: number): Vec3; /** * Negate a Vec3 * * @param v the Vec3 to negate * * @returns the negated Vec3 */ static negate(v: Vec3): Vec3; /** * Invert a Vec3 * * @param v the Vec3 to invert * * @returns the inverse of the Vec3 */ static invert(v: Vec3): Vec3; /** * Normalize a Vec3 * * @param v the Vec3 to normalize * * @return the normalized Vec3 */ static normalize(v: Vec3): Vec3; /** * Calculate the dot product of two Vec3s * * @param left the first Vec3 * @param right the second Vec3 * * @returns the dot product of the two Vec3s */ static dot(left: Vec3, right: Vec3): number; /** * Calculate the cross product of two Vec3s * * @param left the first Vec3 * @param right the second Vec3 * * @returns the cross product of the two Vec3s */ static cross(left: Vec3, right: Vec3): Vec3; /** * Calculate the distance between two Vec3s * * @param left the first Vec3 * @param right the second Vec3 * * @returns the distance between the two Vec3s */ static distanceBetween(left: Vec3, right: Vec3): number; /** * Calculate the angle between two Vec3s * * @param left the first Vec3 * @param right the second Vec3 * * @returns the angle between the two Vec3s (radians) */ static angleBetween(left: Vec3, right: Vec3): number; /** * Rotate a Vec3 by a given angle (radians) about a given orgin around the X axis * * @param v the Vec3 to rotate * @param origin the origin of the rotation * @param angle the angle to rotate by * * @returns the rotated Vec3 */ static rotateX(v: Vec3, origin: Vec3, angle: number): Vec3; /** * Rotate a Vec3 by a given angle (radians) about a given orgin around the Y axis * * @param v the Vec3 to rotate * @param origin the origin of the rotation * @param angle the angle to rotate by * * @returns the rotated Vec3 */ static rotateY(v: Vec3, origin: Vec3, angle: number): Vec3; /** * Rotate a Vec3 by a given angle (radians) about a given orgin around the Z axis * * @param v the Vec3 to rotate * @param origin the origin of the rotation * @param angle the angle to rotate by * * @returns the rotated Vec3 */ static rotateZ(v: Vec3, origin: Vec3, angle: number): Vec3; /** * Transform a Vec3 by a given Mat4 transformation matrix * * @param v the Vec3 to transform * @param m the Mat4 to transform by * * @returns the transformed Vec3 */ static transformByMat4(v: Vec3, m: Mat4): Vec3; /** * Constructor. Take and store the Vec3's x, y and z properties * * @param x the Vec3's x; defaults to 0 * @param y the Vec3's y; defaults to 0 * @param z the Vec3's z; defaults to 0 */ constructor(x?: number, y?: number, z?: number); /** * Getter for the Vec3's magnitude */ get magnitude(): number; /** * Getter for the Array form of the Vec3 */ get array(): Array; /** * Getter for the Float32Array form of the Vec3 */ get float32Array(): Float32Array; /** * Getter for the readable string form of the Vec3 */ get string(): string; /** * Set the Vec3's x, y and z to the given values * * @param x the new x; defaults to 0 * @param y the new y; defaults to 0 * @param z the new z; defaults to 0 */ set(x?: number, y?: number, z?: number): void; /** * Set the Vec3's x to the given value * * @param x the new x; defaults to 0 */ setX(x?: number): void; /** * Set the Vec3's y to the given value * * @param y the new y; defaults to 0 */ setY(y?: number): void; /** * Set the Vec3's y to the given value * * @param y the new y; defaults to 0 */ setZ(z?: number): void; /** * Clone the Vec3 * * @returns a new Vec3 with the same x, y and z as this one */ clone(): Vec3; /** * Getter for a Mutable cast of the Vec3 instance; used for enabling internal-only mutation in the set*() methods * * @returns the typecasted Mutable Vec3 instance */ private get mutable(); }