idTech4.idBounds.AddBounds C# (CSharp) Method

AddBounds() public method

public AddBounds ( idBounds b ) : bool
b idBounds
return bool
		public bool AddBounds(idBounds b)
		{
			bool expanded = false;

			if(b.Min.X < this.Min.X)
			{
				this.Min.X = b.Min.X;
				expanded = true;
			}

			if(b.Min.Y < this.Min.Y)
			{
				this.Min.Y = b.Min.Y;
				expanded = true;
			}

			if(b.Min.Z < this.Min.Z)
			{
				this.Min.Z = b.Min.Z;
				expanded = true;
			}

			if(b.Max.X > this.Max.X)
			{
				this.Max.X = b.Max.X;
				expanded = true;
			}

			if(b.Max.Y > this.Max.Y)
			{
				this.Max.Y = b.Max.Y;
				expanded = true;
			}

			if(b.Max.Z > this.Max.Z)
			{
				this.Max.Z = b.Max.Z;
				expanded = true;
			}

			return expanded;
		}

Usage Example

示例#1
0
        public static idBounds operator +(idBounds a, idBounds b)
        {
            idBounds newBounds = new idBounds();

            newBounds.AddBounds(a);
            newBounds.AddBounds(b);

            return(newBounds);
        }
All Usage Examples Of idTech4.idBounds::AddBounds