public override void Draw() { base.Draw(); Text("Node Allocs/Deallocs from last update: {0}", m_allocs); foreach (var handler in m_sortedHandlers) { MyRenderProxy.DebugDraw6FaceConvex(handler.FrustumBounds, new Color(My2DClipmapHelpers.LodColors[handler.Lod], 1), 0.2f, true, true); } m_activeClipmap = 0; for (; m_activeClipmap < m_tree.Length; m_activeClipmap++) { var t = m_tree[m_activeClipmap]; var wpos = Vector3.Transform(m_tree[m_activeClipmap].LastPosition, m_tree[m_activeClipmap].WorldMatrix); MyRenderProxy.DebugDrawSphere(wpos, 500, Color.Red, 1, true); MyRenderProxy.DebugDrawText3D(wpos, ((Base6Directions.Direction)m_activeClipmap).ToString(), Color.Blue, 1, true); // local space basis var center = t.WorldMatrix.Translation; Vector3D right = Vector3D.Transform(Vector3D.Right * 10000, t.WorldMatrix); Vector3D up = Vector3D.Transform(Vector3D.Up * 10000, t.WorldMatrix); MyRenderProxy.DebugDrawText3D(center, ((Base6Directions.Direction)m_activeClipmap).ToString(), Color.Blue, 1, true); MyRenderProxy.DebugDrawLine3D(center, up, Color.Green, Color.Green, true); MyRenderProxy.DebugDrawLine3D(center, right, Color.Red, Color.Red, true); } }
private int m_hasParallelWorkPending; // Has to be int because interlocked does not work on bools. #endregion #endregion public new void DebugDraw() { if (LodLevel < 0 && !HasPhysics) { return; } Color color = Color.Red; if (MyPlanetEnvironmentSessionComponent.ActiveSector == this) { color = Color.LimeGreen; if (DataView != null) { if (MyPlanetEnvironmentSessionComponent.DebugDrawActiveSectorItems) { for (int index = 0; index < DataView.Items.Count; index++) { var item = DataView.Items[index]; var pos = item.Position + SectorCenter; MyRuntimeEnvironmentItemInfo def; Owner.GetDefinition((ushort)item.DefinitionIndex, out def); MyRenderProxy.DebugDrawText3D(pos, string.Format("{0} i{1} m{2} d{3}", def.Type.Name, index, item.ModelIndex, item.DefinitionIndex), color, 0.7f, true); } } if (MyPlanetEnvironmentSessionComponent.DebugDrawActiveSectorProvider) { foreach (var log in DataView.LogicalSectors) { log.DebugDraw(DataView.Lod); } } } } else if (HasPhysics && LodLevel == -1) { color = Color.RoyalBlue; } var center = (Bounds[4] + Bounds[7]) / 2; if (MyPlanetEnvironmentSessionComponent.ActiveSector == this || Vector3D.DistanceSquared(center, MySector.MainCamera.Position) < MyPlanetEnvironmentSessionComponent.DebugDrawDistance * MyPlanetEnvironmentSessionComponent.DebugDrawDistance) { var label = ToString(); MyRenderProxy.DebugDrawText3D(center, label, color, 1, true); } MyRenderProxy.DebugDraw6FaceConvex(Bounds, color, 1, true, false); }
public void DebugDraw() { var dsq = MyPlanetEnvironmentSessionComponent.DebugDrawDistance * MyPlanetEnvironmentSessionComponent.DebugDrawDistance; foreach (var sector in m_sectors.Values.ToArray()) { MyRenderProxy.DebugDraw6FaceConvex(sector.Bounds, Color.Violet, .5f, true, false); var center = (sector.Bounds[4] + sector.Bounds[7]) / 2; if (Vector3D.DistanceSquared(center, MySector.MainCamera.Position) < dsq) { var offset = -MySector.MainCamera.UpVector * 3; MyRenderProxy.DebugDrawText3D(center + offset, sector.ToString(), Color.Violet, 1, true); } } }