| 69 | } |
| 70 | |
| 71 | int 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 | |
| 93 | bool LightProbeCollection::MoveProbe(int id, const vec3& pos) { |
| 94 | LightProbe* probe = GetProbeFromID(id); |
no test coverage detected