/// <summary> /// Instantiates a new Arcball with the specified boundaries /// for the width and height /// </summary> /// <param name="width">The width</param> /// <param name="height">The height</param> /// <param name="sensitivity">The sensitivity of the trackball</param> public Arcball(int width, int height, double sensitivity = 0.01) { this.Sensitivity = sensitivity; this.Drawable = null; clickStartVector = new Vector3d(); clickEndVector = new Vector3d(); SetBounds(width, height); buttonMapping[MouseButtons.Left] = false; buttonMapping[MouseButtons.Middle] = false; buttonMapping[MouseButtons.Right] = false; }
/// <summary> /// Initializes a new AABB instance with the specified Drawable owner and /// the minimum and maximum points. The specified color will be used for drawing this AABB. /// </summary> /// <param name="owner">The owner of this AABB.</param> /// <param name="minPoint">The min point of this AABB.</param> /// <param name="maxPoint">The max point of this AABB.</param> /// <param name="color">The drawing color of this AABB.</param> public AABB(Drawable3D owner, Vector3d minPoint, Vector3d maxPoint, Color color) { this.Parent = owner; this.MinPoint = minPoint; this.MaxPoint = maxPoint; this.Color = color; ComputeVertices(); this.AABB = this; this.Transform = owner.Transform; CalculateCenter(); // Assign the half points this.HalfPoints = MaxPoint - Center; ComputeVertices(); }
/// <summary> /// Creates a new instance of this class. /// </summary> /// <param name="drawable">The Drawable instance that was hit.</param> /// <param name="hitPoint">The hit point.</param> /// <param name="triangleHit">The triangle that was hit.</param> public MeshHitTestResult(Drawable3D drawable, Vector3d hitPoint, Triangle triangleHit) : base(drawable, hitPoint) { this.TriangleHit = new Triangle(triangleHit.A, triangleHit.B, triangleHit.C); }
/// <summary> /// Initializes a new AABB instance with the specified Drawable owner and /// the minimum and maximum points. The default gizmo color will be used for /// drawing this AABB. /// </summary> /// <param name="owner">The owner of this AABB.</param> /// <param name="minPoint">The min point of this AABB.</param> /// <param name="maxPoint">The max point of this AABB.</param> public AABB(Drawable3D owner, Vector3d minPoint, Vector3d maxPoint) : this(owner, minPoint, maxPoint, Gizmos.AABBColor) { }