<commit_before>define([
	"physics/vector2"
], function(
	Vector2
) {
	var Invalid = true;
	var Valid = false;

	var AABB = function(minPt, maxPt) {
		this.Min = minPt || new Vector2(0.0, 0.0);
		this.Max = maxPt || new Vector2(0.0, 0.0);
		this.Validity = typeof minPt === "undefined" ? Invalid : Valid;
	};	

	AABB.prototype.clear = function() {
		this.Min = new Vector2(0.0, 0.0);
		this.Max = new Vector2(0.0, 0.0);
		this.Validity = Invalid;
	};	

	AABB.prototype.expandToInclude = function(vectorOrAABB) {
		// check for vector
		if(typeof vectorOrAABB.x !== "undefined") {
			// vector
			var pt = vectorOrAABB;
			
			if (this.Validity == Valid) {
				if (pt.x < this.Min.x) { this.Min.x = pt.x; }
				else if (pt.x > this.Max.x) { this.Max.x = pt.x; }
				
				if (pt.y < this.Min.y) { this.Min.y = pt.y; }
				else if (pt.y > this.Max.y) { this.Max.y = pt.y; }
			} else {
				this.Min = pt.copy();
				this.Max = pt.copy();
				this.Validity = Valid;
			};
		} else {
			// AABB
			this.expandToInclude(vectorOrAABB.Min);
			this.expandToInclude(vectorOrAABB.Max);
		};
	};	

	AABB.prototype.contains = function(pt) {
			if (this.Validity == Invalid) { return false; };

			return ((pt.x >= this.Min.x) && (pt.x <= this.Max.x) && (pt.y >= this.Min.y) && (pt.y <= this.Max.y));
	};

	AABB.prototype.intersects = function(box) {
			var overlapX = ((this.Min.x <= box.Max.x) && (this.Max.x >= box.Min.x));
			var overlapY = ((this.Min.y <= box.Max.y) && (this.Max.y >= box.Min.y));
			
			return (overlapX && overlapY);
	};	<commit_msg>use Vector2.set instead of copy in AABB<commit_after>define([
	"physics/vector2"
], function(
	Vector2
) {
	var Invalid = true;
	var Valid = false;

	var AABB = function(minPt, maxPt) {
		this.Min = minPt || Vector2.Zero.copy();
		this.Max = maxPt || Vector2.Zero.copy();
		this.Validity = typeof minPt === "undefined" ? Invalid : Valid;
	};	

	AABB.prototype.clear = function() {
		this.Min.set(Vector2.Zero);
		this.Max.set(Vector2.Zero);
		this.Validity = Invalid;
	};	

	AABB.prototype.expandToInclude = function(vectorOrAABB) {
		// check for vector
		if(typeof vectorOrAABB.x !== "undefined") {
			// vector
			var pt = vectorOrAABB;
			
			if (this.Validity == Valid) {
				if (pt.x < this.Min.x) { this.Min.x = pt.x; }
				else if (pt.x > this.Max.x) { this.Max.x = pt.x; }
				
				if (pt.y < this.Min.y) { this.Min.y = pt.y; }
				else if (pt.y > this.Max.y) { this.Max.y = pt.y; }
			} else {
				this.Min.set(pt);
				this.Max.set(pt);
				this.Validity = Valid;
			};
		} else {
			// AABB
			console.log("aabb in aabb");
			this.expandToInclude(vectorOrAABB.Min);
			this.expandToInclude(vectorOrAABB.Max);
		};
	};	

	AABB.prototype.contains = function(pt) {
			if (this.Validity == Invalid) { return false; };

			return ((pt.x >= this.Min.x) && (pt.x <= this.Max.x) && (pt.y >= this.Min.y) && (pt.y <= this.Max.y));
	};

	AABB.prototype.intersects = function(box) {
			var overlapX = ((this.Min.x <= box.Max.x) && (this.Max.x >= box.Min.x));
			var overlapY = ((this.Min.y <= box.Max.y) && (this.Max.y >= box.Min.y));
			
			return (overlapX && overlapY);
	};	
{'fraction_non_alphanumeric': 0.1971153846153846, 'fraction_numerical': 0.009294871794871795, 'mean_word_length': 2.7022538552787663, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6468776', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1255, 'n_words': 243}