コード例 #1
0
ファイル: Bounds3.cs プロジェクト: wittrup/flysight
        /// <summary>
        /// Returns the union of two <see cref="Bounds3"/> objects.
        /// </summary>
        /// <param name="with"><see cref="Bounds3"/> object to unite with.</param>
        /// <returns>Union of two <see cref="Bounds3"/> objects.</returns>
        public Bounds3 Union(Bounds3 with)
        {
            if (with == null)
            {
                throw new ArgumentNullException("with");
            }

            return(new Bounds3(Math.Min(MinX, with.MinX), Math.Min(MinY, with.MinY), Math.Min(MinZ, with.MinZ),
                               Math.Max(MaxX, with.MaxX), Math.Max(MaxY, with.MaxY), Math.Max(MaxZ, with.MaxZ)));
        }
コード例 #2
0
ファイル: Bounds3.cs プロジェクト: wittrup/flysight
        /// <summary>
        /// Compares the current <see cref="Bounds3"/> object to the specified object for equivalence.
        /// </summary>
        /// <param name="obj">The <see cref="Bounds3"/> object to test for equivalence with the current object.</param>
        /// <returns>
        /// <c>true</c> if the two <see cref="Bounds3"/> objects are equal; otherwise, <c>false</c>.
        /// </returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            Bounds3 that = obj as Bounds3;

            if (that == null)
            {
                return(false);
            }

            return(minX.Equals(that.minX) && minY.Equals(that.minY) && minZ.Equals(that.minZ) &&
                   maxX.Equals(that.maxX) && maxY.Equals(that.MaxY) && maxZ.Equals(that.MaxZ));
        }
コード例 #3
0
ファイル: Bounds3.cs プロジェクト: helgef/flysight
        /// <summary>
        /// Returns the union of two <see cref="Bounds3"/> objects.
        /// </summary>
        /// <param name="with"><see cref="Bounds3"/> object to unite with.</param>
        /// <returns>Union of two <see cref="Bounds3"/> objects.</returns>
        public Bounds3 Union(Bounds3 with)
        {
            if (with == null)
                throw new ArgumentNullException ("with");

            return new Bounds3 (Math.Min (MinX, with.MinX), Math.Min (MinY, with.MinY), Math.Min (MinZ, with.MinZ),
                Math.Max (MaxX, with.MaxX), Math.Max (MaxY, with.MaxY), Math.Max (MaxZ, with.MaxZ));
        }
コード例 #4
0
ファイル: Bounds3.cs プロジェクト: wittrup/flysight
 /// <summary>
 /// Checks if the object intersects with specified boundaries.
 /// </summary>
 /// <param name="other">The other boundaries.</param>
 /// <returns>
 ///     <c>True</c> if it intersects, <c>false</c> otherwise.
 /// </returns>
 public bool IntersectsWith(Bounds3 other)
 {
     return(IntersectsWith(other.minX, other.minY, other.minZ, other.maxX, other.maxY, other.maxZ));
 }
コード例 #5
0
ファイル: Bounds3.cs プロジェクト: helgef/flysight
 /// <summary>
 /// Checks if the object intersects with specified boundaries.
 /// </summary>
 /// <param name="other">The other boundaries.</param>
 /// <returns>
 /// 	<c>True</c> if it intersects, <c>false</c> otherwise.
 /// </returns>
 public bool IntersectsWith(Bounds3 other)
 {
     return IntersectsWith (other.minX, other.minY, other.minZ, other.maxX, other.maxY, other.maxZ);
 }