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

Function CompCameraLateUpdate

engine/gamesys/src/gamesys/components/comp_camera.cpp:245–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 }
244
245 dmGameObject::UpdateResult CompCameraLateUpdate(const dmGameObject::ComponentsUpdateParams& params, dmGameObject::ComponentsUpdateResult& update_result)
246 {
247 CameraWorld* camera_world = (CameraWorld*) params.m_World;
248 DM_PROPERTY_ADD_U32(rmtp_Camera, camera_world->m_Cameras.Size());
249
250 dmRender::RenderContext* render_context = (dmRender::RenderContext*) params.m_Context;
251
252 // Update the cameras based on stack ordering. This is usually the order of which the components were created.
253 uint32_t num_cameras = camera_world->m_CameraStack.Size();
254 for (int i = 0; i < num_cameras; ++i)
255 {
256 CameraComponent* camera = camera_world->m_CameraStack[num_cameras - i - 1];
257 if (!camera->m_AddedToUpdate)
258 continue;
259
260 CompCameraUpdateViewProjection(camera, render_context);
261
262 // Legacy, at some point we should deprecate this
263 if (!PostRenderScriptSetViewProjectionMsg(camera, CameraToURL(camera)))
264 {
265 return dmGameObject::UPDATE_RESULT_UNKNOWN_ERROR;
266 }
267 }
268
269 return dmGameObject::UPDATE_RESULT_OK;
270 }
271
272 dmGameObject::UpdateResult CompCameraOnMessage(const dmGameObject::ComponentOnMessageParams& params)
273 {

Callers

nothing calls this directly

Calls 4

CameraToURLFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected