UpdatePointLightVisualizer2 function
void
UpdatePointLightVisualizer2(
- MeshData md,
- Vector3 pos,
- double range
)
Implementation
void UpdatePointLightVisualizer2(MeshData md, VM.Vector3 pos, double range) {
List<VM.Vector3> points = [];
List<int> faces = [];
// Rays from center
for (VM.Vector3 v in IcosahedronVertexList) {
faces.add(points.length);
faces.add(IcosahedronVertexList.length);
points.add(pos + (v * range));
}
points.add(pos);
// Faces
for (Face3 f in IcosahedronFaceList) {
faces.add(f.a);
faces.add(f.b);
faces.add(f.b);
faces.add(f.c);
faces.add(f.c);
faces.add(f.a);
}
md.AddVertices(FlattenVector3List(points));
md.ChangeFaces(faces);
}