Skip to content

Commit

Permalink
expose per-mesh emitters
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrit committed Mar 28, 2024
1 parent c2700a3 commit 804b83c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions SeeSharp/Scene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ public Emitter QueryEmitter(SurfacePoint point) {
return emitter;
}

public FrozenDictionary<int, Emitter> GetMeshEmitters(Mesh mesh) {
// TODO do we even want to support only _some_ triangles of a mesh being emissive?
if (!meshToEmitter.TryGetValue(mesh, out var meshEmitters))
return null;
return meshEmitters;
}

/// <param name="emitter">An emitter object</param>
/// <returns>Index of this emitter in the <see cref="Emitters"/> list</returns>
public int GetEmitterIndex(Emitter emitter) => emitterToIdx[emitter];
Expand Down

0 comments on commit 804b83c

Please sign in to comment.