Vector3
Overview
Vector3 is a class in Aspose.3d for Typescript.
Inherits from: Vector3.
Vector3 provides full 3‑D vector functionality including dot and cross products, normalization, angle calculation, trigonometric helpers, component‑wise arithmetic, and static unit vectors (zero, one, unitX/Y/Z).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
x | number | Read | Is the X coordinate of the vector |
y | number | Read | |
z | number | Read | |
length | number | Read | |
length2 | number | Read | Is the squared length of the vector |
zero | Vector3 | Read | Is a static vector (0,0,0) |
one | Vector3 | Read | Is a static vector (1,1,1) |
unitX | Vector3 | Read | Is a static unit vector along the X axis (1,0,0) |
unitY | Vector3 | Read | |
unitZ | Vector3 | Read |
Methods
| Signature | Description |
|---|---|
constructor(x: number, y: number, z: number) | Creates a new Vector3 from components, a single value, or another FVector3 |
constructor(vec: FVector3) | |
constructor(v: number) | |
constructor(x: number | FVector3, y: number, z: number) | |
set(newX: number, newY: number, newZ: number) | Assigns new X, Y, Z values to the vector |
dot(rhs: Vector3) → number | Returns the dot product of this vector with another Vector3 |
cross(rhs: Vector3) → Vector3 | |
normalize() → Vector3 | Returns a unit-length vector in the same direction |
angleBetween(dir: Vector3, up: Vector3) → number | Returns the angle in radians between this direction and another, using an up vector |
sin() → Vector3 | Returns a vector whose components are the sine of this vector’s components |
cos() → Vector3 | |
compareTo(other: Vector3) → number | Returns a numeric comparison result with another Vector3 |
parse(input: string) → Vector3 | Creates a Vector3 from a string representation |
getItem(key: number) → number | |
setItem(key: number, value: number) | Sets the component at the given index to a value |
toString() → string | |
equals(other: Vector3) → boolean | Checks if this vector equals another Vector3 |
minus(v: Vector3) → Vector3 | Returns a new Vector3 that is this vector minus another |
times(scalar: number) → Vector3 | Returns a new Vector3 scaled by the given scalar |