Orthographic projection mode with dynamic near/far.

This commit is contained in:
fortsnek9348 2022-03-02 00:52:04 +00:00
parent 0834aff9f4
commit e7947a2fd2
70 changed files with 2548 additions and 244 deletions

View file

@ -93,6 +93,19 @@ namespace MatterHackers.MatterControl.DesignTools
GL.Enable(EnableCap.Lighting);
}
public AxisAlignedBoundingBox GetEditorWorldspaceAABB(Object3DControlsLayer layer)
{
if (layer.Scene.SelectedItem != null
&& layer.Scene.SelectedItem.DescendantsAndSelf().Where((i) => i == this).Any())
{
var currentMatrixInv = Matrix.Inverted;
var aabb = this.GetAxisAlignedBoundingBox(currentMatrixInv);
return AxisAlignedBoundingBox.CenteredBox(new Vector3(Diameter, Diameter, aabb.ZSize), new Vector3(rotationCenter, aabb.Center.Z)).NewTransformed(this.WorldMatrix());
}
return AxisAlignedBoundingBox.Empty();
}
public override void OnInvalidate(InvalidateArgs invalidateArgs)
{
if ((invalidateArgs.InvalidateType.HasFlag(InvalidateType.Children)