#NEWLINE# def makeBlock( self , drawResourcesFactories , x , y , x1 , y1 , tileCenter , collision ) : #NEWLINE# #INDENT# drawResourcesFactory = drawResourcesFactories [ self . LOD ] #NEWLINE# tile = drawResourcesFactory . getTile ( ) #NEWLINE# resources = drawResourcesFactory . getDrawResources ( self . dataIndex [ self . LOD ] ) #NEWLINE# terrain = GeoMipTerrain ( 'TerrainTile' ) #NEWLINE# heightTex = tile . bakedTile . renderMaps [ self . specialMaps [ 'height' ] ] . tex #NEWLINE# heightTexSize = heightTex . getXSize ( ) #NEWLINE# pnmImage = PNMImage ( ) #NEWLINE# heightTex . store ( pnmImage ) #NEWLINE# terrain . setHeightfield ( pnmImage ) #NEWLINE# terrain . setBruteforce ( True ) #NEWLINE# root = terrain . getRoot ( ) #NEWLINE# root . setPos ( ( tile . bakedTile . x - tileCenter . getX ( ) ) , ( tile . bakedTile . y - tileCenter . getY ( ) ) , 0 ) #NEWLINE# for t in self . texList : #NEWLINE# #INDENT# texScale = ( 1.0 / t [ 1 ] ) #NEWLINE# root . setTexture ( t [ 0 ] , t [ 2 ] ) #NEWLINE# root . setShaderInput ( ( 'tex2D_' + t [ 3 ] ) , t [ 2 ] ) #NEWLINE# root . setTexScale ( t [ 0 ] , ( texScale * tile . tileScale ) ) #NEWLINE# root . setTexOffset ( t [ 0 ] , ( ( tile . getX ( ) % t [ 1 ] ) * texScale ) , ( ( tile . getY ( ) % t [ 1 ] ) * texScale ) ) #NEWLINE# #UNINDENT# for t in self . mapTexStages : #NEWLINE# #INDENT# tex = tile . bakedTile . renderMaps [ t ] . tex #NEWLINE# root . setTexture ( self . mapTexStages [ t ] , tex ) #NEWLINE# #UNINDENT# root . setShaderInput ( 'offset' , tile . bakedTile . x , tile . bakedTile . y , 0.0 , 0.0 ) #NEWLINE# root . setShaderInput ( 'scale' , tile . bakedTile . scale ) #NEWLINE# xyScale = ( float ( tile . tileScale ) / ( heightTexSize - 1 ) ) #NEWLINE# root . setScale ( xyScale , xyScale , self . heightScale ) #NEWLINE# if self . shader : #NEWLINE# #INDENT# root . setShader ( self . shader ) #NEWLINE# #UNINDENT# terrain . generate ( ) #NEWLINE# if collision : #NEWLINE# #INDENT# col = collisionUtil . rebuildGeomNodesToColPolys ( root , collision ) #NEWLINE# col . setCollideMask ( collisionUtil . groundMask ) #NEWLINE# col . reparentTo ( collision ) #NEWLINE# #UNINDENT# return root