UnitsModule


The UnitsModule class provides functionality for converting values into world-space units.

Example

const Diagnostics = require('Diagnostics');
const Units = require('Units');

const value = 5;

Diagnostics.log(value + ' cm => ' + Units.cm(value));
Diagnostics.log(value + ' ft => ' + Units.ft(value));

Properties

This class exposes no properties.

Methods

MethodDescription

cm

cm(centimeters: number): number

Converts the specified centimeter value to world units.

ft

ft(feet: number): number

Converts the specified foot value to world units.

in

in(inches: number): number

Converts the specified inch value to world units.

m

m(meters: number): number

Converts the specified meter value to world units.

mm

mm(millimeters: number): number

Converts the specified millimeter value to world units.

yd

yd(yards: number): number

Converts the specified yard value to world units.

Enums

ValueDescription

WorldUnit

The WorldUnit enum describes the unit of measurement used in world-space.