atmoky Engage Server SDK is now available! Check out the documentation to learn more.
API Reference
Classes
Vector3D

Vector3D

Summary
Class representing a vector in 3D space.
đź’ˇ
This class isn't a full implementation of a Vector, it just provides all necessary functionality within this library.

Constructor

Constructs an instance with the given values.
Signature
new Vector3D(x: number, y: number, z: number)
NameTypeDescription
xnumberx-value
ynumbery-value
znumberz-value

Methods

copy

Creates a copy of this instance.
Signature
copy()
Returns
Vector3D copy of this instance

cross

Computs the cross-product between this instance and another one.
Signature
cross(other: Vector3D)
NameTypeDescription
otherVector3Dthe other instance
Returns
Vector3D the cross product result

getDifference

Returns the difference between this instance and another one.
Signature
getDifference(other: Vector3D)
NameTypeDescription
otherVector3Dsubtrahend
Returns
Vector3D difference

getLength

Returns the length of this vector.
Signature
getLength()
Returns
number L2-norm

normalize

Normalizes this instance to a length of 1. In case the previous length was 0, no changes are made.
Signature
normalize()
Returns
Vector3D this instance for chaining operations

scale

Scales this instance by a given factor.
Signature
scale(factor: number)
NameTypeDescription
factornumberscaling factor
Returns
Vector3D this iinstance for chaining operations

set

Sets the values of this instance.
Signature
set(x: number, y: number, z: number)
NameTypeDescription
xnumbernew x-value
ynumbernew y-value
znumbernew z-value
Returns
Vector3D the updated instance

atmoky Logo

© 2024 atmoky, GmbH.
All rights reserved.

We use cookies to measure and improve your browsing experience, and serve personalized ads or content.