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

Function RenderScript_SetView

engine/render/src/render/render_script.cpp:1903–1914  ·  view source on GitHub ↗

sets the view matrix * * Sets the view matrix to use when rendering. * * @name render.set_view * @param matrix [type:matrix4] view matrix to set * @examples * * How to set the view and projection matrices according to * the values supplied by a camera. * * ```lua * function init(self) * self.view = vmath.matrix4() * self.pro

Source from the content-addressed store, hash-verified

1901 * ```
1902 */
1903 int RenderScript_SetView(lua_State* L)
1904 {
1905 RenderScriptInstance* i = RenderScriptInstance_Check(L);
1906 dmVMath::Matrix4 view = *dmScript::CheckMatrix4(L, 1);
1907
1908 dmVMath::Matrix4* matrix = new dmVMath::Matrix4;
1909 *matrix = view;
1910 if (InsertCommand(i, Command(COMMAND_TYPE_SET_VIEW, (uint64_t)matrix)))
1911 return 0;
1912 else
1913 return luaL_error(L, "Command buffer is full (%d).", i->m_CommandBuffer.Capacity());
1914 }
1915
1916 /*# sets the projection matrix
1917 * Sets the projection matrix to use when rendering.

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