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

Method AddProbe

Source/Graphics/lightprobecollection.cpp:71–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71int LightProbeCollection::AddProbe(const vec3& pos, bool negative, const float* coeff) {
72 light_probes.resize(light_probes.size() + 1);
73 LightProbe& probe = light_probes.back();
74 probe.pos = pos;
75 probe.negative = negative;
76 probe.id = next_id++;
77 if (!negative && !coeff) {
78 LightProbeUpdateEntry entry;
79 entry.id = probe.id;
80 entry.pass = 0;
81 to_process.push(entry);
82 } else if (coeff) {
83 for (unsigned int i = 0; i < 6; i++) {
84 probe.ambient_cube_color[i].entries[0] = coeff[i * 3 + 0];
85 probe.ambient_cube_color[i].entries[1] = coeff[i * 3 + 1];
86 probe.ambient_cube_color[i].entries[2] = coeff[i * 3 + 2];
87 }
88 }
89 tet_mesh_needs_update = true;
90 return probe.id;
91}
92
93bool LightProbeCollection::MoveProbe(int id, const vec3& pos) {
94 LightProbe* probe = GetProbeFromID(id);

Callers 1

InitializeMethod · 0.80

Calls 4

resizeMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected