public void Init() { GfxBoundBox = new BBox(); if (VertexArray.Vertices != null && VertexArray.Vertices.Count > 0) { var v = VertexArray.Vertices.Values.First(); GfxBoundBox.Min = v.Origin; // ref? GfxBoundBox.Max = v.Origin; foreach (var vertex in VertexArray.Vertices.Values) { GfxBoundBox.AdjustBBox(vertex.Origin); } } else { GfxBoundBox.Min = Vector3.Zero; GfxBoundBox.Max = Vector3.Zero; } }
public void Init() { GfxBoundBox = new BBox(); if (VertexArray.Vertices != null) { var v = VertexArray.Vertices.Values.First(); GfxBoundBox.Min = new Vector3(v.X, v.Y, v.Z); GfxBoundBox.Max = new Vector3(v.X, v.Y, v.Z); foreach (var vertex in VertexArray.Vertices.Values) { GfxBoundBox.AdjustBBox(new Vector3(vertex.X, vertex.Y, vertex.Z)); } } else { GfxBoundBox.Min = Vector3.Zero; GfxBoundBox.Max = Vector3.Zero; } }