fCraft.BoundingBox.Contains C# (CSharp) Method

Contains() public method

Checks if another bounding box is wholly contained inside this one.
public Contains ( BoundingBox other ) : bool
other BoundingBox
return bool
        public bool Contains( BoundingBox other ) {
            if( other == null ) throw new ArgumentNullException( "other" );
            return XMin >= other.XMin && XMax <= other.XMax &&
                   YMin >= other.YMin && YMax <= other.YMax &&
                   HMin >= other.HMin && HMax <= other.HMax;
        }

Same methods

BoundingBox::Contains ( int x, int y, int h ) : bool

Usage Example

コード例 #1
0
ファイル: CtfGame.cs プロジェクト: Magi1053/ProCraft
		static void KillExplosion(Player player, Vector3I coords) {
			foreach (Player p in world.Players) {
				if (p == player)
					continue;
				Vector3I cpPos = p.Position.ToBlockCoords();
				Vector3I cpPosMax = new Vector3I(cpPos.X + 2, cpPos.Y + 2, cpPos.Z + 2);
				Vector3I cpPosMin = new Vector3I(cpPos.X - 2, cpPos.Y - 2, cpPos.Z - 2);
				BoundingBox bounds = new BoundingBox(cpPosMin, cpPosMax);
				
				if (bounds.Contains(coords) && p.Team != player.Team)
					Kill(player, p, " &cexploded ");
			}
		}
All Usage Examples Of fCraft.BoundingBox::Contains