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

Function Matrix4_AxisAngle

engine/script/src/script_vmath.cpp:1625–1631  ·  view source on GitHub ↗

creates a matrix from an axis and an angle * The resulting matrix describes a rotation around the axis by the specified angle. * * @name vmath.matrix4_axis_angle * @param v [type:vector3] axis * @param angle [type:number] angle in radians * @return m [type:matrix4] matrix represented by axis and angle * @examples * * ```lua * local vec = vmath.vect

Source from the content-addressed store, hash-verified

1623 * ```
1624 */
1625 static int Matrix4_AxisAngle(lua_State* L)
1626 {
1627 Vector3* axis = CheckVector3(L, 1);
1628 float angle = (float) luaL_checknumber(L, 2);
1629 PushMatrix4(L, Matrix4::rotation(angle, *axis));
1630 return 1;
1631 }
1632
1633 /*# creates a matrix from rotation around x-axis
1634 * The resulting matrix describes a rotation around the x-axis

Callers

nothing calls this directly

Calls 3

CheckVector3Function · 0.85
luaL_checknumberFunction · 0.85
PushMatrix4Function · 0.85

Tested by

no test coverage detected