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

Method Draw

Source/Objects/dynamiclightobject.cpp:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void DynamicLightObject::Draw() {
45 if (g_debug_runtime_disable_dynamic_light_object_draw) {
46 return;
47 }
48
49 if (!Graphics::Instance()->media_mode() && light_id_ != -1 && scenegraph_ && scenegraph_->map_editor->state_ != MapEditor::kInGame) {
50 const DynamicLight *light = scenegraph_->dynamic_light_collection.GetLightFromID(light_id_);
51 if (light) {
52 mat4 transform;
53 if (selected_) {
54 transform.SetScale(vec3(RadiusFromScale(scale_)));
55 transform.SetTranslationPart(translation_);
56 DebugDraw::Instance()->AddWireMesh(HardcodedPaths::paths[HardcodedPaths::kPointLight], transform, vec4(light->color, 0.025f), _delete_on_draw);
57 }
58 transform.SetScale(vec3(0.1f));
59 transform.SetTranslationPart(translation_);
60 DebugDraw::Instance()->AddWireMesh(HardcodedPaths::paths[HardcodedPaths::kPointLight], transform, vec4(light->color, 0.25f), _delete_on_draw);
61 }
62 }
63}
64
65bool DynamicLightObject::Initialize() {
66 LOG_ASSERT(light_id_ == -1);

Callers

nothing calls this directly

Calls 8

RadiusFromScaleFunction · 0.85
media_modeMethod · 0.80
GetLightFromIDMethod · 0.80
SetTranslationPartMethod · 0.80
AddWireMeshMethod · 0.80
vec3Class · 0.50
vec4Class · 0.50
SetScaleMethod · 0.45

Tested by

no test coverage detected