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

Method AddLight

Source/Graphics/dynamiclightcollection.cpp:50–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50int DynamicLightCollection::AddLight(const vec3& pos, const vec3& color, float radius) {
51 dynamic_lights.resize(dynamic_lights.size() + 1);
52 DynamicLight& light = dynamic_lights.back();
53 light.pos = pos;
54 light.id = next_id++;
55 light.color = color;
56 light.radius = radius;
57 return light.id;
58}
59
60bool DynamicLightCollection::MoveLight(int id, const vec3& pos) {
61 DynamicLight* light = GetLightFromID(id);

Callers 2

InitializeMethod · 0.80
SetEnabledMethod · 0.80

Calls 3

resizeMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected