<commit_before>function Scene()
{
	this.objects			= [];
	this.onChangeListeners	= [];
	this.boundsMin			= new Vector(100000,100000);
	this.boundsMax			= new Vector(-100000,-100000);
	this.name				= "Unnamed Scene";

	this.getBoundsMin = function()
	{
		return this.boundsMin;
	}

	this.getBoundsMax = function()
	{
		return this.boundsMax;
	}

	this.addChangeListener = function(listener)
	{
		this.onChangeListeners.push(listener);
	}

	this.onChange = function()
	{
		this.boundsMin = new Vector(100000,100000);
		this.boundsMax = new Vector(-100000,-100000);

		for (var i=0; i<this.objects.length; ++i)
		{
			if (this.objects[i].getBoundsMin !== undefined)
			{
				this.boundsMin = min(this.boundsMin, this.objects[i].getBoundsMin());
				this.boundsMax = max(this.boundsMax, this.objects[i].getBoundsMax());
			}
		}

		for (var i=0; i!=this.onChangeListeners.length; ++i)
		{
			this.onChangeListeners[i](this);
		}
	}

	this.addObject = function (object, index)
	{
		if (index == undefined)
		{
			this.objects.push(object);
		}
		else
		{
			this.objects.splice(index, 0, object);
		}

		if (object.scene !== null && object.scene !== this)
		{
			object.scene.deleteObjects([object]);
		}

		object.scene = this;

		if (object.addChangeListener !== undefined)
		{
			object.addChangeListener(this.onChange.bind(this));
		}

		this.onChange();
	}
	
	this.deleteObjects = function(objectList)
	{
		for (var i=0; i<this.objects.length; ++i)
		{
			if (objectList.indexOf(this.objects[i])>=0)
			{
				if (this.objects[i].scene !== null)
				{
					this.objects[i].scene = null;
				}

				this.objects.splice(i, 1);
				--i;
			}
		}

		this.onChange();
	}

	this.deleteAllObjects = function()
	{
		this.objects = [];
		this.onChange();
	}

	this.getObjectIndex = function (object)
	{
		return this.objects.indexOf(object);
	}

	this.setObjectIndex = function (object, index, relative)
	{
		var objectIndex = this.objects.indexOf(object);

		if (objectIndex<0)
			return;

		var newIndex = index;

		if (relative == true)
			newIndex = objectIndex + index;

		this.objects.splice(objectIndex, 1);
		this.objects.splice(newIndex, 0, object);

		this.onChange();
	}

	this.draw = function (camera)
	{
		for (var i=0; i<this.objects.length; ++i)
		{
			if (this.objects[i].isVisible != undefined && this.objects[i].isVisible())
			{
				this.objects[i].draw(camera);
			}
		}
	}
	
	this.hitTest = function(a, b)
	{
		var results = [];
		
		for (var i=0; i<this.objects.length; ++i)
		{
			var temp = this.objects[i].hitTest;
			
			if (this.objects[i].hitTest !== undefined && this.objects[i].hitTest(a,b) == true && !this.objects[i].isFrozen()&& this.objects[i].isVisible())
			{
				results.push(this.objects[i]);
			}
		}
		
		return results;
	}

	this.rayHitTest = function(rayPos, rayDir)
	{
		var bestHit = {tRay:1000};
			
		for (var o=0; o<this.objects.length; ++o)
		{
			if (this.objects[o].rayHitTest === undefined)
				continue;

			var hits = this.objects[o].rayHitTest(rayPos, rayDir);
				
			for (var h = 0; h != hits.length; ++h)
			{
				if (hits[h].hit && hits[h].tRay<bestHit.tRay)
				{
					bestHit = hits[h];
				}
			}
		}

		return bestHit;
	}

	this.getSnapPoint = function(mousePos, extraSnapPoints, threshold, ignoreObjectList, enabledTypes)
	{
		var bestPoint = null;
		var bestDistance = 1000;

		if (ignoreObjectList == undefined)
			ignoreObjectList = [];

		for (var i=0; i<this.objects.length; ++i)
		{
			if (this.objects[i].getSnapPoints === undefined)
				continue;

			if (ignoreObjectList.indexOf(this.objects[i]) >= 0)
				continue;

			var points = this.objects[i].getSnapPoints();<commit_msg>Stop snap points from invisible objects from showing up<commit_after>function Scene()
{
	this.objects			= [];
	this.onChangeListeners	= [];
	this.boundsMin			= new Vector(100000,100000);
	this.boundsMax			= new Vector(-100000,-100000);
	this.name				= "Unnamed Scene";

	this.getBoundsMin = function()
	{
		return this.boundsMin;
	}

	this.getBoundsMax = function()
	{
		return this.boundsMax;
	}

	this.addChangeListener = function(listener)
	{
		this.onChangeListeners.push(listener);
	}

	this.onChange = function()
	{
		this.boundsMin = new Vector(100000,100000);
		this.boundsMax = new Vector(-100000,-100000);

		for (var i=0; i<this.objects.length; ++i)
		{
			if (this.objects[i].getBoundsMin !== undefined)
			{
				this.boundsMin = min(this.boundsMin, this.objects[i].getBoundsMin());
				this.boundsMax = max(this.boundsMax, this.objects[i].getBoundsMax());
			}
		}

		for (var i=0; i!=this.onChangeListeners.length; ++i)
		{
			this.onChangeListeners[i](this);
		}
	}

	this.addObject = function (object, index)
	{
		if (index == undefined)
		{
			this.objects.push(object);
		}
		else
		{
			this.objects.splice(index, 0, object);
		}

		if (object.scene !== null && object.scene !== this)
		{
			object.scene.deleteObjects([object]);
		}

		object.scene = this;

		if (object.addChangeListener !== undefined)
		{
			object.addChangeListener(this.onChange.bind(this));
		}

		this.onChange();
	}
	
	this.deleteObjects = function(objectList)
	{
		for (var i=0; i<this.objects.length; ++i)
		{
			if (objectList.indexOf(this.objects[i])>=0)
			{
				if (this.objects[i].scene !== null)
				{
					this.objects[i].scene = null;
				}

				this.objects.splice(i, 1);
				--i;
			}
		}

		this.onChange();
	}

	this.deleteAllObjects = function()
	{
		this.objects = [];
		this.onChange();
	}

	this.getObjectIndex = function (object)
	{
		return this.objects.indexOf(object);
	}

	this.setObjectIndex = function (object, index, relative)
	{
		var objectIndex = this.objects.indexOf(object);

		if (objectIndex<0)
			return;

		var newIndex = index;

		if (relative == true)
			newIndex = objectIndex + index;

		this.objects.splice(objectIndex, 1);
		this.objects.splice(newIndex, 0, object);

		this.onChange();
	}

	this.draw = function (camera)
	{
		for (var i=0; i<this.objects.length; ++i)
		{
			if (this.objects[i].isVisible != undefined && this.objects[i].isVisible())
			{
				this.objects[i].draw(camera);
			}
		}
	}
	
	this.hitTest = function(a, b)
	{
		var results = [];
		
		for (var i=0; i<this.objects.length; ++i)
		{
			var temp = this.objects[i].hitTest;
			
			if (this.objects[i].hitTest !== undefined && this.objects[i].hitTest(a,b) == true && !this.objects[i].isFrozen()&& this.objects[i].isVisible())
			{
				results.push(this.objects[i]);
			}
		}
		
		return results;
	}

	this.rayHitTest = function(rayPos, rayDir)
	{
		var bestHit = {tRay:1000};
			
		for (var o=0; o<this.objects.length; ++o)
		{
			if (this.objects[o].rayHitTest === undefined)
				continue;

			var hits = this.objects[o].rayHitTest(rayPos, rayDir);
				
			for (var h = 0; h != hits.length; ++h)
			{
				if (hits[h].hit && hits[h].tRay<bestHit.tRay)
				{
					bestHit = hits[h];
				}
			}
		}

		return bestHit;
	}

	this.getSnapPoint = function(mousePos, extraSnapPoints, threshold, ignoreObjectList, enabledTypes)
	{
		var bestPoint = null;
		var bestDistance = 1000;

		if (ignoreObjectList == undefined)
			ignoreObjectList = [];

		for (var i=0; i<this.objects.length; ++i)
		{
			if (this.objects[i].getSnapPoints === undefined)
				continue;

			if (!this.objects[i].isVisible())
				continue;

			if (ignoreObjectList.indexOf(this.objects[i]) >= 0)
				continue;

			var points = this.objects[i].getSnapPoints();
{'fraction_non_alphanumeric': 0.1655359565807327, 'fraction_numerical': 0.019267299864314788, 'mean_word_length': 3.2705677867902665, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 7, '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': '7266321', 'n_tokens_mistral': 3238, 'n_tokens_neox': 2683, 'n_words': 472}