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

Function RenderScript_SetProjection

engine/render/src/render/render_script.cpp:1930–1940  ·  view source on GitHub ↗

sets the projection matrix * Sets the projection matrix to use when rendering. * * @name render.set_projection * @param matrix [type:matrix4] projection matrix * @examples * * How to set the projection to orthographic with world origo at lower left, * width and height as set in project settings and depth (z) between -1 and 1: * * ```lua * rend

Source from the content-addressed store, hash-verified

1928 * ```
1929 */
1930 int RenderScript_SetProjection(lua_State* L)
1931 {
1932 RenderScriptInstance* i = RenderScriptInstance_Check(L);
1933 dmVMath::Matrix4 projection = *dmScript::CheckMatrix4(L, 1);
1934 dmVMath::Matrix4* matrix = new dmVMath::Matrix4;
1935 *matrix = projection;
1936 if (InsertCommand(i, Command(COMMAND_TYPE_SET_PROJECTION, (uint64_t)matrix)))
1937 return 0;
1938 else
1939 return luaL_error(L, "Command buffer is full (%d).", i->m_CommandBuffer.Capacity());
1940 }
1941
1942 /*#
1943 * @name render.FRUSTUM_PLANES_SIDES

Callers

nothing calls this directly

Calls 6

CheckMatrix4Function · 0.85
InsertCommandFunction · 0.85
luaL_errorFunction · 0.85
CommandClass · 0.70
CapacityMethod · 0.45

Tested by

no test coverage detected