MCPcopy Create free account
hub / github.com/defold/defold / Quat_AxisAngle

Function Quat_AxisAngle

engine/script/src/script_vmath.cpp:1268–1274  ·  view source on GitHub ↗

creates a quaternion to rotate around a unit vector * * The resulting quaternion describes a rotation of `angle` * radians around the axis described by the unit vector `v`. * * @name vmath.quat_axis_angle * @param v [type:vector3] axis * @param angle [type:number] angle * @return q [type:quaternion] quaternion representing the axis-angle rotation * @exa

Source from the content-addressed store, hash-verified

1266 * ```
1267 */
1268 static int Quat_AxisAngle(lua_State* L)
1269 {
1270 Vector3* axis = CheckVector3(L, 1);
1271 float angle = (float) luaL_checknumber(L, 2);
1272 PushQuat(L, Quat::rotation(angle, *axis));
1273 return 1;
1274 }
1275
1276 /*# creates a quaternion from three base unit vectors
1277 *

Callers

nothing calls this directly

Calls 3

CheckVector3Function · 0.85
luaL_checknumberFunction · 0.85
PushQuatFunction · 0.85

Tested by

no test coverage detected