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.

Properties

NameTypeAccessDescription
xnumberRead/WriteGets the x.
ynumberRead/WriteGets the y.
znumberRead/WriteGets the z.
lengthnumberReadGets the length.
length2numberReadGets the length2.
zeroVector3ReadGets the zero.
oneVector3ReadGets the one.
unitXVector3ReadGets the unit x.
unitYVector3ReadGets the unit y.
unitZVector3ReadGets the unit z.

Methods

SignatureDescription
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)numberReturns the dot product of this vector with another Vector3
cross(rhs: Vector3)Vector3
normalize()Vector3Returns a unit-length vector in the same direction
angleBetween(dir: Vector3, up: Vector3)numberReturns the angle in radians between this vector and dir, using up as reference
sin()Vector3Returns a vector whose components are the sine of this vector’s components
cos()Vector3
compareTo(other: Vector3)numberReturns a numeric comparison of this vector with another vector
parse(input: string)Vector3Creates a Vector3 from a string representation
getItem(key: number)number
setItem(key: number, value: number)Sets the item value.
toString()string
equals(other: Vector3)booleanReturns true if this vector has the same components as another
minus(v: Vector3)Vector3Returns a new vector equal to this vector minus the given vector
times(scalar: number)Vector3Returns a new vector scaled by the given scalar

See Also