MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Draw

Method Draw

Source/Objects/envobject.cpp:217–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void EnvObject::Draw() {
218 if (g_debug_runtime_disable_env_object_draw) {
219 return;
220 }
221
222 EnvObject* instances[1];
223 instances[0] = this;
224 Camera* camera = ActiveCameras::Get();
225 Graphics* graphics = Graphics::Instance();
226 mat4 proj_view_mat = camera->GetProjMatrix() * camera->GetViewMatrix();
227 mat4 prev_proj_view_mat = camera->GetProjMatrix() * camera->prev_view_mat;
228 vec3 cam_pos = camera->GetPos();
229 std::vector<mat4> shadow_matrix;
230 shadow_matrix.resize(4);
231 for (int i = 0; i < 4; ++i) {
232 shadow_matrix[i] = camera->biasMatrix * graphics->cascade_shadow_mat[i];
233 }
234 last_ofr_is_valid = false;
235 DrawInstances(instances, 1, proj_view_mat, prev_proj_view_mat, &shadow_matrix, cam_pos, Object::kFullDraw);
236 AfterDrawInstances();
237 DrawDetailObjectInstances(instances, 1, Object::kFullDraw);
238}
239
240static void UpdateNormalOverride(EnvObject* obj, Model* model) {
241 PROFILER_ZONE(g_profiler_ctx, "UpdateNormalOverride");

Callers 1

Calls 5

GetProjMatrixMethod · 0.80
GetViewMatrixMethod · 0.80
GetFunction · 0.50
GetPosMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected