public void QueueVertices() { double TriangleCount = Math.Pow(4, mDepth - 1) * 6; if (TriangleCount > short.MaxValue) { throw (new Exception("TriangleCount exceeds short.MaxValue")); } mBufferedVertices = new VertexQueue<VertexPositionNormalTexture>((short)TriangleCount); mRoot.collectVertices(mBufferedVertices, 2); }
public void collectVertices( VertexQueue<VertexPositionNormalTexture> VertexQueue, int TestDrawDepth ) { /* if( TestDrawDepth > 0 ) { if( !InsideViewFrustum() ) { return; } }*/ if( mSubdivisions == null ) { VertexQueue.add( new VertexPositionNormalTexture( mCorners[ 0, 0 ].mLocation, mCorners[ 0, 0 ].mNormal, new Vector2( 0, 0 ) ) ); VertexQueue.add( new VertexPositionNormalTexture( mCorners[ 1, 0 ].mLocation, mCorners[ 1, 0 ].mNormal, new Vector2( 1, 0 ) ) ); VertexQueue.add( new VertexPositionNormalTexture( mCorners[ 0, 1 ].mLocation, mCorners[ 0, 1 ].mNormal, new Vector2( 0, 1 ) ) ); VertexQueue.add( new VertexPositionNormalTexture( mCorners[ 1, 0 ].mLocation, mCorners[ 1, 0 ].mNormal, new Vector2( 1, 0 ) ) ); VertexQueue.add( new VertexPositionNormalTexture( mCorners[ 1, 1 ].mLocation, mCorners[ 1, 1 ].mNormal, new Vector2( 1, 1 ) ) ); VertexQueue.add( new VertexPositionNormalTexture( mCorners[ 0, 1 ].mLocation, mCorners[ 0, 1 ].mNormal, new Vector2( 0, 1 ) ) ); } else { mSubdivisions[ 0, 0 ].collectVertices( VertexQueue, TestDrawDepth - 1 ); mSubdivisions[ 0, 1 ].collectVertices( VertexQueue, TestDrawDepth - 1 ); mSubdivisions[ 1, 0 ].collectVertices( VertexQueue, TestDrawDepth - 1 ); mSubdivisions[ 1, 1 ].collectVertices( VertexQueue, TestDrawDepth - 1 ); } }