From b0657b08c9cf883b7428286ee5f625d5c859b37f Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 9 Apr 2021 18:14:14 -0700 Subject: [PATCH] Working to debug the height control hit plane --- .../EditorTools/ScaleControls/ScaleHeightControl.cs | 11 +++++++++++ Submodules/agg-sharp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleHeightControl.cs b/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleHeightControl.cs index 68a5da39f..c0acf0b91 100644 --- a/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleHeightControl.cs +++ b/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleHeightControl.cs @@ -210,6 +210,8 @@ namespace MatterHackers.Plugins.EditorTools return worldBottom; } + private Plane debugPlane; + public override void OnMouseDown(Mouse3DEventArgs mouseEvent3D) { if (mouseEvent3D.info != null && Object3DControlContext.Scene.SelectedItem != null) @@ -223,6 +225,11 @@ namespace MatterHackers.Plugins.EditorTools double distanceToHit = Vector3Ex.Dot(mouseEvent3D.info.HitPosition, mouseEvent3D.MouseRay.directionNormal); hitPlane = new PlaneShape(mouseEvent3D.MouseRay.directionNormal, distanceToHit, null); + + debugPlane = hitPlane.Plane; + + // Matrix4X4.LookAt(Object3DControlContext.World.EyePosition, mouseEvent3D.info.HitPosition,) + originalPointToMove = GetTopPosition(selectedItem); initialHitPosition = mouseEvent3D.info.HitPosition; @@ -412,6 +419,10 @@ namespace MatterHackers.Plugins.EditorTools zValueDisplayInfo.OriginRelativeParent = heightDisplayCenter + new Vector2(10, -zValueDisplayInfo.LocalBounds.Center.Y); } } + + Object3DControlContext.World.RenderPlane(debugPlane, Color.Red, true, 500, 300); + + Object3DControlContext.World.RenderPlane((new Plane(new Vector3(0, 0, 3), new Vector3(0, 0, -1))).Transform(Object3DControlContext.World.ModelviewMatrix), Color.Red, false, 50, 30); } public override void Dispose() diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 023939fc5..0da542727 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 023939fc5c45e7e0e55ebfe10f0f2f916d39eebc +Subproject commit 0da542727dcf97b9309f3fe7838230738eb5a4b3