lovr.headset.getDirection

Edit

Returns the direction a device or model is pointing. It will always be normalized.



Arguments

NameTypeDefaultDescription
deviceDevice'head' The device to get the direction of.

Returns

NameTypeDescription
xnumber The x component of the direction.
ynumber The y component of the direction.
znumber The z component of the direction.

Arguments

NameTypeDescription
modelModel The model to get the direction of.

Returns

NameTypeDescription
xnumber The x component of the direction.
ynumber The y component of the direction.
znumber The z component of the direction.

Notes

If the object isn't tracked, this function returns zeroes.

This is the same as quaternion(lovr.headset.getOrientation(device)):direction().

See also