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 [
| 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 | * |
nothing calls this directly
no test coverage detected