public void DebugDraw(ref Matrix drawMatrix, MyWingedEdgeMesh mesh) { var binEnum = m_outerEdgePoints.EnumerateBins(); int i = 0; while (binEnum.MoveNext()) { int binIndex = Sandbox.Game.Gui.MyCestmirDebugInputComponent.BinIndex; if (binIndex == m_outerEdgePoints.InvalidIndex || i == binIndex) { Vector3I position = binEnum.Current.Key; int storageIndex = binEnum.Current.Value; BoundingBoxD bb, bbTform; m_outerEdgePoints.GetLocalBinBB(ref position, out bb); bbTform.Min = Vector3D.Transform(bb.Min, drawMatrix); bbTform.Max = Vector3D.Transform(bb.Max, drawMatrix); while (storageIndex != m_outerEdgePoints.InvalidIndex) { Vector3 p = m_outerEdgePoints.GetPoint(storageIndex); var edge = mesh.GetEdge(m_outerEdgePoints.GetData(storageIndex).EdgeIndex); Vector3 v1 = mesh.GetVertexPosition(edge.Vertex1); Vector3 v2 = mesh.GetVertexPosition(edge.Vertex2); Vector3 vc = (v1 + v2) * 0.5f; Vector3D vcTformed = Vector3D.Transform((Vector3D)vc, drawMatrix); Vector3D pTformed = Vector3D.Transform((Vector3D)p, drawMatrix); VRageRender.MyRenderProxy.DebugDrawArrow3D(vcTformed, pTformed, Color.Yellow, Color.Yellow, false); storageIndex = m_outerEdgePoints.GetNextBinIndex(storageIndex); } VRageRender.MyRenderProxy.DebugDrawAABB(bbTform, Color.PowderBlue, 1.0f, 1.0f, false); } i++; } }