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

Function Matrix4_Frustum

engine/script/src/script_vmath.cpp:1466–1481  ·  view source on GitHub ↗

creates a frustum matrix * * Constructs a frustum matrix from the given values. The left, right, * top and bottom coordinates of the view cone are expressed as distances * from the center of the near clipping plane. The near and far coordinates * are expressed as distances from the tip of the view frustum cone. * * @name vmath.matrix4_frustum * @param left [

Source from the content-addressed store, hash-verified

1464 * ```
1465 */
1466 static int Matrix4_Frustum(lua_State* L)
1467 {
1468 float left = (float) luaL_checknumber(L, 1);
1469 float right = (float) luaL_checknumber(L, 2);
1470 float bottom = (float) luaL_checknumber(L, 3);
1471 float top = (float) luaL_checknumber(L, 4);
1472 float near_z = (float) luaL_checknumber(L, 5);
1473 if(near_z == 0.0f)
1474 {
1475 luaL_where(L, 1);
1476 dmLogWarning("%sperspective projection invalid, znear = 0", lua_tostring(L,-1));
1477 }
1478 float far_z = (float) luaL_checknumber(L, 6);
1479 PushMatrix4(L, Matrix4::frustum(left, right, bottom, top, near_z, far_z));
1480 return 1;
1481 }
1482
1483 /*# creates a look-at view matrix
1484 *

Callers

nothing calls this directly

Calls 3

luaL_checknumberFunction · 0.85
luaL_whereFunction · 0.85
PushMatrix4Function · 0.85

Tested by

no test coverage detected