|
@@ -88,28 +88,17 @@ BasicBlock::BasicBlock( const BlockType* zType, const char* texture, ItemType* z
|
|
vertecies[ 23 ].tPos = Vec2< float >( 1.0f, 1.0f );
|
|
vertecies[ 23 ].tPos = Vec2< float >( 1.0f, 1.0f );
|
|
|
|
|
|
data->setVertecies( vertecies, 24 );
|
|
data->setVertecies( vertecies, 24 );
|
|
-
|
|
|
|
- // front side
|
|
|
|
|
|
+ // the order of the polygons has to be NORTH, EAST, SOUTH, WEST, TOP, BOTTOM according to the Area definition
|
|
|
|
+ // down side
|
|
Polygon3D* p = new Polygon3D();
|
|
Polygon3D* p = new Polygon3D();
|
|
p->indexAnz = 6;
|
|
p->indexAnz = 6;
|
|
p->indexList = new int[ p->indexAnz ];
|
|
p->indexList = new int[ p->indexAnz ];
|
|
- p->indexList[ 0 ] = 0;
|
|
|
|
- p->indexList[ 1 ] = 3;
|
|
|
|
- p->indexList[ 2 ] = 2;
|
|
|
|
- p->indexList[ 3 ] = 0;
|
|
|
|
- p->indexList[ 4 ] = 1;
|
|
|
|
- p->indexList[ 5 ] = 3;
|
|
|
|
- data->addPolygon( p );
|
|
|
|
- // back side
|
|
|
|
- p = new Polygon3D();
|
|
|
|
- p->indexAnz = 6;
|
|
|
|
- p->indexList = new int[ p->indexAnz ];
|
|
|
|
- p->indexList[ 0 ] = 4;
|
|
|
|
- p->indexList[ 1 ] = 6;
|
|
|
|
- p->indexList[ 2 ] = 7;
|
|
|
|
- p->indexList[ 3 ] = 4;
|
|
|
|
- p->indexList[ 4 ] = 7;
|
|
|
|
- p->indexList[ 5 ] = 5;
|
|
|
|
|
|
+ p->indexList[ 0 ] = 6 + 16;
|
|
|
|
+ p->indexList[ 1 ] = 2 + 16;
|
|
|
|
+ p->indexList[ 2 ] = 3 + 16;
|
|
|
|
+ p->indexList[ 3 ] = 6 + 16;
|
|
|
|
+ p->indexList[ 4 ] = 3 + 16;
|
|
|
|
+ p->indexList[ 5 ] = 7 + 16;
|
|
data->addPolygon( p );
|
|
data->addPolygon( p );
|
|
// right side
|
|
// right side
|
|
p = new Polygon3D();
|
|
p = new Polygon3D();
|
|
@@ -122,6 +111,17 @@ BasicBlock::BasicBlock( const BlockType* zType, const char* texture, ItemType* z
|
|
p->indexList[ 4 ] = 5 + 8;
|
|
p->indexList[ 4 ] = 5 + 8;
|
|
p->indexList[ 5 ] = 7 + 8;
|
|
p->indexList[ 5 ] = 7 + 8;
|
|
data->addPolygon( p );
|
|
data->addPolygon( p );
|
|
|
|
+ // top side
|
|
|
|
+ p = new Polygon3D();
|
|
|
|
+ p->indexAnz = 6;
|
|
|
|
+ p->indexList = new int[ p->indexAnz ];
|
|
|
|
+ p->indexList[ 0 ] = 4 + 16;
|
|
|
|
+ p->indexList[ 1 ] = 1 + 16;
|
|
|
|
+ p->indexList[ 2 ] = 0 + 16;
|
|
|
|
+ p->indexList[ 3 ] = 4 + 16;
|
|
|
|
+ p->indexList[ 4 ] = 5 + 16;
|
|
|
|
+ p->indexList[ 5 ] = 1 + 16;
|
|
|
|
+ data->addPolygon( p );
|
|
// left side
|
|
// left side
|
|
p = new Polygon3D();
|
|
p = new Polygon3D();
|
|
p->indexAnz = 6;
|
|
p->indexAnz = 6;
|
|
@@ -133,29 +133,29 @@ BasicBlock::BasicBlock( const BlockType* zType, const char* texture, ItemType* z
|
|
p->indexList[ 4 ] = 6 + 8;
|
|
p->indexList[ 4 ] = 6 + 8;
|
|
p->indexList[ 5 ] = 4 + 8;
|
|
p->indexList[ 5 ] = 4 + 8;
|
|
data->addPolygon( p );
|
|
data->addPolygon( p );
|
|
- // top side
|
|
|
|
|
|
+ // back side
|
|
p = new Polygon3D();
|
|
p = new Polygon3D();
|
|
p->indexAnz = 6;
|
|
p->indexAnz = 6;
|
|
p->indexList = new int[ p->indexAnz ];
|
|
p->indexList = new int[ p->indexAnz ];
|
|
- p->indexList[ 0 ] = 4 + 16;
|
|
|
|
- p->indexList[ 1 ] = 1 + 16;
|
|
|
|
- p->indexList[ 2 ] = 0 + 16;
|
|
|
|
- p->indexList[ 3 ] = 4 + 16;
|
|
|
|
- p->indexList[ 4 ] = 5 + 16;
|
|
|
|
- p->indexList[ 5 ] = 1 + 16;
|
|
|
|
|
|
+ p->indexList[ 0 ] = 4;
|
|
|
|
+ p->indexList[ 1 ] = 6;
|
|
|
|
+ p->indexList[ 2 ] = 7;
|
|
|
|
+ p->indexList[ 3 ] = 4;
|
|
|
|
+ p->indexList[ 4 ] = 7;
|
|
|
|
+ p->indexList[ 5 ] = 5;
|
|
data->addPolygon( p );
|
|
data->addPolygon( p );
|
|
- // down side
|
|
|
|
|
|
+ data->calculateNormals();
|
|
|
|
+ // front side
|
|
p = new Polygon3D();
|
|
p = new Polygon3D();
|
|
p->indexAnz = 6;
|
|
p->indexAnz = 6;
|
|
p->indexList = new int[ p->indexAnz ];
|
|
p->indexList = new int[ p->indexAnz ];
|
|
- p->indexList[ 0 ] = 6 + 16;
|
|
|
|
- p->indexList[ 1 ] = 2 + 16;
|
|
|
|
- p->indexList[ 2 ] = 3 + 16;
|
|
|
|
- p->indexList[ 3 ] = 6 + 16;
|
|
|
|
- p->indexList[ 4 ] = 3 + 16;
|
|
|
|
- p->indexList[ 5 ] = 7 + 16;
|
|
|
|
|
|
+ p->indexList[ 0 ] = 0;
|
|
|
|
+ p->indexList[ 1 ] = 3;
|
|
|
|
+ p->indexList[ 2 ] = 2;
|
|
|
|
+ p->indexList[ 3 ] = 0;
|
|
|
|
+ p->indexList[ 4 ] = 1;
|
|
|
|
+ p->indexList[ 5 ] = 3;
|
|
data->addPolygon( p );
|
|
data->addPolygon( p );
|
|
- data->calculateNormals();
|
|
|
|
}
|
|
}
|
|
setModelDaten( data );
|
|
setModelDaten( data );
|
|
Bild* b = new Bild();
|
|
Bild* b = new Bild();
|
|
@@ -175,6 +175,11 @@ BasicBlock::BasicBlock( const BlockType* zType, const char* texture, ItemType* z
|
|
setModelTextur( textur );
|
|
setModelTextur( textur );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool BasicBlock::needRenderPolygon( int index )
|
|
|
|
+{
|
|
|
|
+ return CONST_BLOCK( zNeighbours[ index ], neighbourTypes[ index ] )->isTransparent();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
DirtBlockType::DirtBlockType()
|
|
DirtBlockType::DirtBlockType()
|
|
: BlockType( ID )
|
|
: BlockType( ID )
|