Vector4

Overview

Vector4 is a class in Aspose.3D FOSS for Typescript.

Vector4.constructor creates a new Vector4 with default components (0,0,0,0).

This class provides 6 methods for working with Vector4 objects in Typescript programs. Available methods include: constructor, equals, getItem, set, setItem, toString. All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package. Properties: w, x, y, z.

Description

Vector4 is a class in the Aspose.3D FOSS library for TypeScript that exposes 5 methods and 4 properties for programmatic use.

Core capabilities include: number; number; number. These operations enable developers to integrate vector4 functionality directly into TypeScript applications.

The class offers 5 constructor overloads, allowing flexible initialization depending on the calling context.

Properties

NameTypeAccessDescription
xnumberRead/WriteGets the x.
ynumberRead/WriteGets the y.
znumberRead/WriteGets the z.
wnumberRead/WriteGets the w.

Methods

SignatureDescription
constructor()Creates a Vector4 from a mixed first argument (FVector2, FVector3, or number) and y, z, w numbers
constructor(x: number, y: number, z: number, w: number)Creates a Vector4 with the specified x, y, z, and w double components
constructor(vec3: FVector3, w: number)Creates a Vector4 from an FVector3 and a double w component
constructor(vec: FVector2, w: number)Creates a Vector4 from an FVector2 and a double w component
constructor(x: FVector2 | FVector3 | number, y: number, z: number, w: number)Creates a Vector4 from a mixed first argument and remaining double components
set(newX: number, newY: number, newZ: number, newW: number)Assigns new values to x, y, z, and w components
getItem(key: number)numberReturns the component value at the given index (0=x, 1=y, 2=z, 3=w)
setItem(key: number, value: number)Sets the item value.
toString()stringReturns a string representation of this vector
equals(other: Vector4)booleanReturns true if all components match the other Vector4

See Also