findCollisionBounds() 
	{
		let xMin = 0;
		let xMax = 0;
		let yMin = 0;
		let yMax = 0;
		let zMin = 0;
		let zMax = 0;

		let xCache = [];
		let yCache = [];
		let zCache = [];

		for (let p = 0; p < this.polydefs.length; p++)
		{
			let poly = this.polydefs[p][0]
			let p1 = this.cloud.get(poly.p1);
			let p2 = this.cloud.get(poly.p2);
			let p3 = this.cloud.get(poly.p3);
			let p4 = this.cloud.get(poly.p4);

			//This should probably be really fast, so I'll write it all out manually for now.
			if (p1.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}

			if (p1.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}

			if (p2.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}

			if (p2.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}

			if (p3.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}

			if (p3.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}

			if (p4.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}

			if (p4.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}



			if (p1.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}

			if (p1.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}

			if (p2.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}

			if (p2.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}

			if (p3.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}

			if (p3.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}

			if (p4.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}

			if (p4.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}



			if (p1.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}

			if (p1.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}

			if (p2.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}

			if (p2.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}

			if (p3.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}

			if (p3.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}

			if (p4.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}

			if (p4.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}
		}
		this.collider = {
			"xMin" : xMin,
			"xMax" : xMax,
			"yMin" : yMin,
			"yMax" : yMax,
			"zMin" : zMin,
			"zMax" : zMax
		};
	}
// Calculates the collision boundaries of the model. coincidentally, this could also be used to calculate the model's dimensions.

Calculates the collision boundaries of the model. coincidentally, this could also be used to calculate the model's dimensions.
Calculates the collision boundaries of the model . coincidentally this could also be used to calculate the model ' s dimensions .
findCollisionBounds() 
	{
		let xMin = 0;
		let xMax = 0;
		let yMin = 0;
		let yMax = 0;
		let zMin = 0;
		let zMax = 0;
		let xCache = [];
		let yCache = [];
		let zCache = [];
		for (let p = 0; p < this.polydefs.length; p++)
		{
			let poly = this.polydefs[p][0]
			let p1 = this.cloud.get(poly.p1);
			let p2 = this.cloud.get(poly.p2);
			let p3 = this.cloud.get(poly.p3);
			let p4 = this.cloud.get(poly.p4);
			if (p1.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}
			if (p1.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}
			if (p2.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}
			if (p2.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}
			if (p3.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}
			if (p3.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}
			if (p4.pub.x < xMin)
			{
				xMin = p1.pub.x; 
			}
			if (p4.pub.x > xMax)
			{
				xMax = p1.pub.x;
			}
			if (p1.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}
			if (p1.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}
			if (p2.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}
			if (p2.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}
			if (p3.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}
			if (p3.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}
			if (p4.pub.y < yMin)
			{
				yMin = p1.pub.y; 
			}
			if (p4.pub.y > yMax)
			{
				yMax = p1.pub.y;
			}
			if (p1.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}
			if (p1.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}
			if (p2.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}
			if (p2.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}
			if (p3.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}
			if (p3.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}
			if (p4.pub.z < zMin)
			{
				zMin = p1.pub.z; 
			}
			if (p4.pub.z > zMax)
			{
				zMax = p1.pub.z;
			}
		}
		this.collider = {
			"xMin" : xMin,
			"xMax" : xMax,
			"yMin" : yMin,
			"yMax" : yMax,
			"zMin" : zMin,
			"zMax" : zMax
		};
	}
findCollisionBounds ( ) { let xMin = 0 ; let xMax = 0 ; let yMin = 0 ; let yMax = 0 ; let zMin = 0 ; let zMax = 0 ; let xCache = [ ] ; let yCache = [ ] ; let zCache = [ ] ; for ( let p = 0 ; p < this . polydefs . length ; p ++ ) { let poly = this . polydefs [ p ] [ 0 ] let p1 = this . cloud . get ( poly . p1 ) ; let p2 = this . cloud . get ( poly . p2 ) ; let p3 = this . cloud . get ( poly . p3 ) ; let p4 = this . cloud . get ( poly . p4 ) ; if ( p1 . pub . x < xMin ) { xMin = p1 . pub . x ; } if ( p1 . pub . x > xMax ) { xMax = p1 . pub . x ; } if ( p2 . pub . x < xMin ) { xMin = p1 . pub . x ; } if ( p2 . pub . x > xMax ) { xMax = p1 . pub . x ; } if ( p3 . pub . x < xMin ) { xMin = p1 . pub . x ; } if ( p3 . pub . x > xMax ) { xMax = p1 . pub . x ; } if ( p4 . pub . x < xMin ) { xMin = p1 . pub . x ; } if ( p4 . pub . x > xMax ) { xMax = p1 . pub . x ; } if ( p1 . pub . y < yMin ) { yMin = p1 . pub . y ; } if ( p1 . pub . y > yMax ) { yMax = p1 . pub . y ; } if ( p2 . pub . y < yMin ) { yMin = p1 . pub . y ; } if ( p2 . pub . y > yMax ) { yMax = p1 . pub . y ; } if ( p3 . pub . y < yMin ) { yMin = p1 . pub . y ; } if ( p3 . pub . y > yMax ) { yMax = p1 . pub . y ; } if ( p4 . pub . y < yMin ) { yMin = p1 . pub . y ; } if ( p4 . pub . y > yMax ) { yMax = p1 . pub . y ; } if ( p1 . pub . z < zMin ) { zMin = p1 . pub . z ; } if ( p1 . pub . z > zMax ) { zMax = p1 . pub . z ; } if ( p2 . pub . z < zMin ) { zMin = p1 . pub . z ; } if ( p2 . pub . z > zMax ) { zMax = p1 . pub . z ; } if ( p3 . pub . z < zMin ) { zMin = p1 . pub . z ; } if ( p3 . pub . z > zMax ) { zMax = p1 . pub . z ; } if ( p4 . pub . z < zMin ) { zMin = p1 . pub . z ; } if ( p4 . pub . z > zMax ) { zMax = p1 . pub . z ; } } this . collider = { "xMin" : xMin , "xMax" : xMax , "yMin" : yMin , "yMax" : yMax , "zMin" : zMin , "zMax" : zMax } ; }
Calculates the collision boundaries of the model.
Calculates the collision boundaries of the model .
//This should probably be really fast, so I'll write it all out manually for now.
