function.rotationFromDirection
API > rotationFromDirection
Function: rotationFromDirection
rotationFromDirection(
dir
,snapToAxis
?):quat
Retuns a quaternion computed for the given direction. Will compute rotation with Y as the up vector unless direction is Y or snapToAxis is given
Parameters
Parameter | Type | Description |
---|---|---|
dir | ReadonlyVec3 | Direction vector. |
snapToAxis ? | quat | Snap to custom rotation, uses Y as up otherwise |
Returns
quat
Rotation computed for the given direction and snap axis.