public void Assign(QueuedGeometry qgeom) { // Look up any current geometry var formatString = GetGeometryFormatString(qgeom.geometry); var newBucket = true; if (this.currentGeometryMap.ContainsKey(formatString)) { var gbucket = this.currentGeometryMap[formatString]; // Found existing geometry, try to assign newBucket = !gbucket.Assign(qgeom); // Note that this bucket will be replaced as the 'current' // for this format string below since it's out of space } // Do we need to create a new one? if (newBucket) { var gbucket = new GeometryBucket(this, formatString, qgeom.geometry.vertexData, qgeom.geometry.indexData); // Add to main list this.geometryBucketList.Add(gbucket); // Also index in 'current' list this.currentGeometryMap[formatString] = gbucket; if (!gbucket.Assign(qgeom)) { throw new AxiomException("Somehow we couldn't fit the requested geometry even in a " + "brand new GeometryBucket!! Must be a bug, please report."); } } }
private GeometryBucket(MaterialBucket parent, String formatString, GeometryBucket bucket) : base() { mParent = parent; mFormatString = formatString; mBatch = mParent.Parent.Parent.Parent; if (mBatch.BaseSkeleton != null) { SetCustomParameter(0, new Vector4(mBatch.BaseSkeleton.BoneCount, 0, 0, 0)); } renderOperation = bucket.RenderOperation; mVertexData = renderOperation.vertexData; mIndexData = renderOperation.indexData; BoundingBox = new BoundingBox(new Vector3(-10000, -10000, -10000), new Vector3(10000, 10000, 10000)); }
public void Assign( QueuedGeometry qgeom ) { // Look up any current geometry var formatString = GetGeometryFormatString( qgeom.geometry ); var newBucket = true; if ( this.currentGeometryMap.ContainsKey( formatString ) ) { var gbucket = this.currentGeometryMap[ formatString ]; // Found existing geometry, try to assign newBucket = !gbucket.Assign( qgeom ); // Note that this bucket will be replaced as the 'current' // for this format string below since it's out of space } // Do we need to create a new one? if ( newBucket ) { var gbucket = new GeometryBucket( this, formatString, qgeom.geometry.vertexData, qgeom.geometry.indexData ); // Add to main list this.geometryBucketList.Add( gbucket ); // Also index in 'current' list this.currentGeometryMap[ formatString ] = gbucket; if ( !gbucket.Assign( qgeom ) ) { throw new AxiomException( "Somehow we couldn't fit the requested geometry even in a " + "brand new GeometryBucket!! Must be a bug, please report." ); } } }
private GeometryBucket( MaterialBucket parent, String formatString, GeometryBucket bucket ) : base() { mParent = parent; mFormatString = formatString; mBatch = mParent.Parent.Parent.Parent; if ( mBatch.BaseSkeleton != null ) { SetCustomParameter( 0, new Vector4( mBatch.BaseSkeleton.BoneCount, 0, 0, 0 ) ); } renderOperation = bucket.RenderOperation; mVertexData = renderOperation.vertexData; mIndexData = renderOperation.indexData; BoundingBox = new BoundingBox( new Vector3( -10000, -10000, -10000 ), new Vector3( 10000, 10000, 10000 ) ); }