Vector3
Overview
Vector3 is a class in Aspose.3D FOSS for Typescript.
Vector3.constructor creates a new Vector3 with given x, y, z components.
This class provides 16 methods for working with Vector3 objects in Typescript programs.
Available methods include: angleBetween, compareTo, constructor, cos, cross, dot, equals, getItem, minus, normalize, parse, set, and 4 additional methods.
All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package.
Properties: length, length2, one, unitX, unitY, unitZ, and 4 more.
Description
Vector3 is a class in the Aspose.3D FOSS library for TypeScript that exposes 15 methods and 10 properties for programmatic use.
Core capabilities include: number; number; number. These operations enable developers to integrate vector3 functionality directly into TypeScript applications.
The class also provides the length property (gets the length), the length2 property (gets the length2), the zero property (gets the zero).
The class offers 4 constructor overloads, allowing flexible initialization depending on the calling context.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
x | number | Read/Write | Gets the x. |
y | number | Read/Write | Gets the y. |
z | number | Read/Write | Gets the z. |
length | number | Read | Gets the length. |
length2 | number | Read | Gets the length2. |
zero | Vector3 | Read | Gets the zero. |
one | Vector3 | Read | Gets the one. |
unitX | Vector3 | Read | Gets the unit x. |
unitY | Vector3 | Read | Gets the unit y. |
unitZ | Vector3 | Read | Gets the unit z. |
Methods
| Signature | Description |
|---|---|
constructor(x: number, y: number, z: number) | Creates a new Vector3 using either a number or FVector3 for x and separate y, z |
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 vector and dir, using up as reference |
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 of this vector with another vector |
parse(input: string) → Vector3 | Creates a Vector3 from a string representation |
getItem(key: number) → number | |
setItem(key: number, value: number) | Sets the item value. |
toString() → string | |
equals(other: Vector3) → boolean | Returns true if this vector has the same components as another |
minus(v: Vector3) → Vector3 | Returns a new vector equal to this vector minus the given vector |
times(scalar: number) → Vector3 | Returns a new vector scaled by the given scalar |