Atlas Engine
API Referenceatlasatlas/units

Position3d

Three-component value. Arithmetic returns new values; up is +Y and forward is +Z.

Module: atlas/units

Three-component value. Arithmetic returns new values; up is +Y and forward is +Z.

Declaration

export class Position3d { ... }

Constructors

constructor(x: number, y: number, z: number);

Properties

x

x: number;

y

y: number;

z

z: number;

Methods

zero

static zero(): Position3d;

down

static down(): Position3d;

up

static up(): Position3d;

forward

static forward(): Position3d;

back

static back(): Position3d;
static right(): Position3d;

left

static left(): Position3d;

invalid

Returns a value whose coordinate components are NaN.

static invalid(): Position3d;

add

Returns a new value by adding the operand component-wise; a numeric operand applies to every component.

add(other: Position3d | number): Position3d;

subtract

Returns a new value by subtracting the operand component-wise; a numeric operand applies to every component.

subtract(other: Position3d | number): Position3d;

multiply

Returns a new value by multiplying by the operand component-wise; a numeric operand applies to every component.

multiply(other: Position3d | number): Position3d;

divide

Returns a new value by dividing by the operand component-wise; a numeric operand applies to every component.

divide(other: Position3d | number): Position3d;

is

Tests exact equality of all components.

is(other: Position3d): boolean;

normalized

Returns a unit-length copy, or a zero vector if the length is zero.

normalized(): Position3d;

toString

toString(): string;

On this page