Refactoring properties
This commit is contained in:
parent
5c9e686052
commit
273d47b5f8
4 changed files with 12 additions and 12 deletions
|
|
@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
if (object3D.TraceData().Contains(intersectionInfo.closestHitObject))
|
||||
{
|
||||
CurrentSelectInfo.PlaneDownHitPos = intersectionInfo.hitPosition;
|
||||
CurrentSelectInfo.PlaneDownHitPos = intersectionInfo.HitPosition;
|
||||
CurrentSelectInfo.LastMoveDelta = new Vector3();
|
||||
return object3D;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,13 +102,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
public override void OnMouseDown(MouseEvent3DArgs mouseEvent3D)
|
||||
{
|
||||
zHitHeight = mouseEvent3D.info.hitPosition.z;
|
||||
zHitHeight = mouseEvent3D.info.HitPosition.z;
|
||||
lastMoveDelta = new Vector3();
|
||||
double distanceToHit = Vector3.Dot(mouseEvent3D.info.hitPosition, mouseEvent3D.MouseRay.directionNormal);
|
||||
double distanceToHit = Vector3.Dot(mouseEvent3D.info.HitPosition, mouseEvent3D.MouseRay.directionNormal);
|
||||
hitPlane = new PlaneShape(mouseEvent3D.MouseRay.directionNormal, distanceToHit, null);
|
||||
|
||||
IntersectInfo info = hitPlane.GetClosestIntersection(mouseEvent3D.MouseRay);
|
||||
zHitHeight = info.hitPosition.z;
|
||||
zHitHeight = info.HitPosition.z;
|
||||
|
||||
var selectedItem = MeshViewerToDrawWith.Scene.SelectedItem;
|
||||
if (selectedItem != null)
|
||||
|
|
@ -126,7 +126,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
if (info != null && MeshViewerToDrawWith.Scene.HasSelection)
|
||||
{
|
||||
var selectedItem = MeshViewerToDrawWith.Scene.SelectedItem;
|
||||
Vector3 delta = new Vector3(0, 0, info.hitPosition.z - zHitHeight);
|
||||
Vector3 delta = new Vector3(0, 0, info.HitPosition.z - zHitHeight);
|
||||
|
||||
// move it back to where it started
|
||||
selectedItem.Matrix *= Matrix4X4.CreateTranslation(new Vector3(-lastMoveDelta));
|
||||
|
|
|
|||
|
|
@ -904,9 +904,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
var center = sourceItemBounds.Center;
|
||||
|
||||
DragDropSource.Matrix *= Matrix4X4.CreateTranslation(-center.x, -center.y, -sourceItemBounds.minXYZ.z);
|
||||
DragDropSource.Matrix *= Matrix4X4.CreateTranslation(new Vector3(intersectInfo.hitPosition));
|
||||
DragDropSource.Matrix *= Matrix4X4.CreateTranslation(new Vector3(intersectInfo.HitPosition));
|
||||
|
||||
CurrentSelectInfo.PlaneDownHitPos = intersectInfo.hitPosition;
|
||||
CurrentSelectInfo.PlaneDownHitPos = intersectInfo.HitPosition;
|
||||
CurrentSelectInfo.LastMoveDelta = Vector3.Zero;
|
||||
|
||||
this.deferEditorTillMouseUp = true;
|
||||
|
|
@ -1330,9 +1330,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
AxisAlignedBoundingBox selectedBounds = meshViewerWidget.Scene.SelectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity);
|
||||
|
||||
if (info.hitPosition.x < selectedBounds.Center.x)
|
||||
if (info.HitPosition.x < selectedBounds.Center.x)
|
||||
{
|
||||
if (info.hitPosition.y < selectedBounds.Center.y)
|
||||
if (info.HitPosition.y < selectedBounds.Center.y)
|
||||
{
|
||||
CurrentSelectInfo.HitQuadrant = HitQuadrant.LB;
|
||||
}
|
||||
|
|
@ -1343,7 +1343,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
else
|
||||
{
|
||||
if (info.hitPosition.y < selectedBounds.Center.y)
|
||||
if (info.HitPosition.y < selectedBounds.Center.y)
|
||||
{
|
||||
CurrentSelectInfo.HitQuadrant = HitQuadrant.RB;
|
||||
}
|
||||
|
|
@ -1392,7 +1392,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
Scene.SelectedItem.Matrix *= totalTransform;
|
||||
}
|
||||
|
||||
Vector3 delta = info.hitPosition - CurrentSelectInfo.PlaneDownHitPos;
|
||||
Vector3 delta = info.HitPosition - CurrentSelectInfo.PlaneDownHitPos;
|
||||
|
||||
double snapGridDistance = meshViewerWidget.SnapGridDistance;
|
||||
if (snapGridDistance > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue