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

Function Quat_Basis

engine/script/src/script_vmath.cpp:1302–1313  ·  view source on GitHub ↗

creates a quaternion from three base unit vectors * * The resulting quaternion describes the rotation from the * identity quaternion (no rotation) to the coordinate system * as described by the given x, y and z base unit vectors. * * @name vmath.quat_basis * @param x [type:vector3] x base vector * @param y [type:vector3] y base vector * @param z [type:v

Source from the content-addressed store, hash-verified

1300 * ```
1301 */
1302 static int Quat_Basis(lua_State* L)
1303 {
1304 Vector3* x = CheckVector3(L, 1);
1305 Vector3* y = CheckVector3(L, 2);
1306 Vector3* z = CheckVector3(L, 3);
1307 Matrix3 m;
1308 m.setCol0(*x);
1309 m.setCol1(*y);
1310 m.setCol2(*z);
1311 PushQuat(L, Quat(m));
1312 return 1;
1313 }
1314
1315 /*# creates a quaternion from rotation around x-axis
1316 *

Callers

nothing calls this directly

Calls 3

CheckVector3Function · 0.85
PushQuatFunction · 0.85
QuatClass · 0.50

Tested by

no test coverage detected