LM

LM Constants

The following constants are defined in the LM namespace. To use one of these constants, be sure to prepend

LM.

to the constant's name. For example,

LM.X_AXIS

is valid, while

X_AXIS

is not complete.

Axis

The following constants are used to specify an axis in 3D space.

X_AXIS

Positive X axis

Y_AXIS

Positive Y axis

Z_AXIS

Positive Z axis

NEGX_AXIS

Negative X axis

NEGY_AXIS

Negative Y axis

NEGZ_AXIS

Negative Z axis

FREE_AXIS

Arbitrary free axis

LM Functions

The following functions are defined in the LM namespace. To call one of these functions, be sure to prepend

LM.
to the function's name. For example,
LM.Beep()
is valid, while
Beep()
is not complete.


void Beep()

Causes to computer to beep.

Return value: none

void Snooze(milliseconds)

Causes Moho to pause for the specified number of milliseconds.

milliseconds (int): duration to pause
Return value: none

int Round(value)

Returns the closest integer to the supplied value. In other words, value is rounded off.

value (float): a number to round
Return value (int): closest integer to the value passed in

float Clamp(value, min, max)

Clamps a value to ensure that it is within certain bounds. This function returns min if value is less than min, max if value is greater than max, and value otherwise.

value (float): a number to clamp
min (float): minimum acceptable value
max (float): maximum acceptable value
Return value (float): the clamped value

float Lerp(value, start, end)

This function is a shortcut for linear interpolation between two numbers. If value is 0, then start is returned. If value is 1, end is returned. For anything in between, the function interpolates between start and end.

value (float): a number between (and including) 0 and 1
start (float): the starting value to interpolate
end (float): the end value to interpolate
Return value (float): a linear interpolation between start and end

float Slerp(value, start, end)

This function is a shortcut for smooth interpolation between two numbers. If value is 0, then start is returned. If value is 1, end is returned. For anything in between, the function interpolates between start and end.

value (float): a number between (and including) 0 and 1
start (float): the starting value to interpolate
end (float): the end value to interpolate
Return value (float): a smooth interpolation between start and end