public override void DebugDraw() { base.DebugDraw(); if (m_path == null || !m_path.IsValid) { return; } if (MyDebugDrawSettings.ENABLE_DEBUG_DRAW && MyFakes.DEBUG_DRAW_FOUND_PATH) { m_path.DebugDraw(); } }
public override void Draw() { base.Draw(); if (MySector.MainCamera != null) { var pos = MySector.MainCamera.Position; var dir = MySector.MainCamera.ForwardVector; var hit = MyPhysics.CastRay(pos, pos + 500 * dir); if (hit.HasValue) { var entity = hit.Value.HkHitInfo.GetHitEntity(); if (entity != null) { var voxel = entity.GetTopMostParent() as MyVoxelPhysics; if (voxel != null) { var planet = voxel.Parent; var grav = planet as IMyGravityProvider; if (grav != null) { var gravity = grav.GetWorldGravity(hit.Value.Position); gravity.Normalize(); var point = planet.PositionComp.GetPosition() - gravity * 9503; MyRenderProxy.DebugDrawSphere(point, 0.5f, Color.Red, 1, false); MyRenderProxy.DebugDrawSphere(point, 5.5f, Color.Yellow, 1, false); hit = MyPhysics.CastRay(point, point + gravity * 500); if (hit.HasValue) { MyRenderProxy.DebugDrawText2D(new Vector2(10, 10), (hit.Value.HkHitInfo.HitFraction * 500).ToString(), Color.White, 0.8f); } } } } } } if (!MyDebugDrawSettings.ENABLE_DEBUG_DRAW) { return; } if (MyCubeBuilder.Static == null) { return; } if (m_smartPath != null) { m_smartPath.DebugDraw(); VRageRender.MyRenderProxy.DebugDrawSphere(m_currentTarget, 2.0f, Color.HotPink, 1.0f, false); for (int i = 1; i < m_pastTargets.Count; ++i) { VRageRender.MyRenderProxy.DebugDrawLine3D(m_pastTargets[i], m_pastTargets[i - 1], Color.Blue, Color.Blue, false); } } var bb = MyCubeBuilder.Static.GetBuildBoundingBox(); VRageRender.MyRenderProxy.DebugDrawOBB(bb, Color.Red, 0.25f, false, false); var src = MyScreenManager.GetScreenWithFocus(); if (MyScreenManager.GetScreenWithFocus() == null || MyScreenManager.GetScreenWithFocus().DebugNamePath != "MyGuiScreenGamePlay") { return; } if (m_drawSphere) { VRageRender.MyRenderProxy.DebugDrawSphere(m_sphere.Center, m_sphere.Radius, Color.Red, 1.0f, false, cull: true); VRageRender.MyRenderProxy.DebugDrawAxis(m_sphereMatrix, 50.0f, false); VRageRender.MyRenderProxy.DebugDrawText2D(new Vector2(200.0f, 0.0f), m_string, Color.Red, 0.5f); } VRageRender.MyRenderProxy.DebugDrawSphere(m_point1, 0.5f, Color.Orange.ToVector3(), 1.0f, true); VRageRender.MyRenderProxy.DebugDrawSphere(m_point2, 0.5f, Color.Orange.ToVector3(), 1.0f, true); foreach (var point in DebugDrawPoints) { //VRageRender.MyRenderProxy.DebugDrawSphere(point.Position, 0.05f, point.Color.ToVector3(), 1.0f, false); VRageRender.MyRenderProxy.DebugDrawSphere(point.Position, 0.03f, point.Color, 1.0f, false); } foreach (var sphere in DebugDrawSpheres) { VRageRender.MyRenderProxy.DebugDrawSphere(sphere.Position, sphere.Radius, sphere.Color, 1.0f, false); } foreach (var box in DebugDrawBoxes) { VRageRender.MyRenderProxy.DebugDrawAABB(box.Box, box.Color, 1.0f, 1.0f, false); } if (DebugDrawMesh != null) { Matrix identity = Matrix.Identity; DebugDrawMesh.DebugDraw(ref identity, MyDebugDrawSettings.DEBUG_DRAW_NAVMESHES); } foreach (var poly in DebugDrawPolys) { MatrixD identity = MatrixD.Identity; poly.DebugDraw(ref identity); } MyPolygonBoolOps.Static.DebugDraw(MatrixD.Identity); if (Boxes != null) { foreach (var box in Boxes) { VRageRender.MyRenderProxy.DebugDrawAABB(box, Color.Red, 1.0f, 1.0f, true); } } }