Axiom.Math.AxisAlignedBox.SetExtents C# (CSharp) Method

SetExtents() public method

Sets both Minimum and Maximum at once, so that UpdateCorners only needs to be called once as well.
public SetExtents ( Vector3 min, Vector3 max ) : void
min Vector3
max Vector3
return void
		public void SetExtents( Vector3 min, Vector3 max )
		{
			isNull = false;
			isInfinite = false;

			minVector = min;
			maxVector = max;

			UpdateCorners();
		}

Usage Example

Example #1
0
		/// <summary>
		///		Sets the corners of the rectangle, in relative coordinates.
		/// </summary>
		/// <param name="left">Left position in screen relative coordinates, -1 = left edge, 1.0 = right edge.</param>
		/// <param name="top">Top position in screen relative coordinates, 1 = top edge, -1 = bottom edge.</param>
		/// <param name="right">Position in screen relative coordinates.</param>
		/// <param name="bottom">Position in screen relative coordinates.</param>
		/// <param name="updateAABB"></param>
		public void SetCorners( float left, float top, float right, float bottom, bool updateAABB )
		{
			var data = new float[]
			           {
			           	left, top, -1, left, bottom, -1, right, top, -1, // Fix for Issue #1187096
			           	right, bottom, -1
			           };

			var buffer = vertexData.vertexBufferBinding.GetBuffer( POSITION );

			buffer.WriteData( 0, buffer.Size, data, true );

			if ( updateAABB )
			{
				box = new AxisAlignedBox();
				box.SetExtents( new Vector3( left, top, 0 ), new Vector3( right, bottom, 0 ) );
			}
		}
All Usage Examples Of Axiom.Math.AxisAlignedBox::SetExtents