| 251 | } |
| 252 | |
| 253 | void SkyBox::_initRender() |
| 254 | { |
| 255 | GFXVertexPNT *tmpVerts = NULL; |
| 256 | |
| 257 | U32 vertCount = 36; |
| 258 | |
| 259 | if ( !mDrawBottom ) |
| 260 | vertCount = 30; |
| 261 | |
| 262 | mPrimCount = vertCount / 3; |
| 263 | |
| 264 | // Create temp vertex pointer |
| 265 | // so we can read from it |
| 266 | // for generating the normals below. |
| 267 | tmpVerts = new GFXVertexPNT[vertCount]; |
| 268 | |
| 269 | // We don't bother sharing |
| 270 | // vertices here, in order to |
| 271 | // avoid using a primitive buffer. |
| 272 | tmpVerts[0].point.set( -1, -1, 1 ); |
| 273 | tmpVerts[1].point.set( 1, -1, 1 ); |
| 274 | tmpVerts[2].point.set( 1, -1, -1 ); |
| 275 | |
| 276 | tmpVerts[0].texCoord.set( 0, 0 ); |
| 277 | tmpVerts[1].texCoord.set( 1.0f, 0 ); |
| 278 | tmpVerts[2].texCoord.set( 1.0f, 1.0f ); |
| 279 | |
| 280 | tmpVerts[3].point.set( -1, -1, 1 ); |
| 281 | tmpVerts[4].point.set( 1, -1, -1 ); |
| 282 | tmpVerts[5].point.set( -1, -1, -1 ); |
| 283 | |
| 284 | tmpVerts[3].texCoord.set( 0, 0 ); |
| 285 | tmpVerts[4].texCoord.set( 1.0f, 1.0f ); |
| 286 | tmpVerts[5].texCoord.set( 0, 1.0f ); |
| 287 | |
| 288 | tmpVerts[6].point.set( 1, -1, 1 ); |
| 289 | tmpVerts[7].point.set( 1, 1, 1 ); |
| 290 | tmpVerts[8].point.set( 1, 1, -1 ); |
| 291 | |
| 292 | tmpVerts[6].texCoord.set( 0, 0 ); |
| 293 | tmpVerts[7].texCoord.set( 1.0f, 0 ); |
| 294 | tmpVerts[8].texCoord.set( 1.0f, 1.0f ); |
| 295 | |
| 296 | tmpVerts[9].point.set( 1, -1, 1 ); |
| 297 | tmpVerts[10].point.set( 1, 1, -1 ); |
| 298 | tmpVerts[11].point.set( 1, -1, -1 ); |
| 299 | |
| 300 | tmpVerts[9].texCoord.set( 0, 0 ); |
| 301 | tmpVerts[10].texCoord.set( 1.0f, 1.0f ); |
| 302 | tmpVerts[11].texCoord.set( 0, 1.0f ); |
| 303 | |
| 304 | tmpVerts[12].point.set( -1, 1, 1 ); |
| 305 | tmpVerts[13].point.set( -1, -1, 1 ); |
| 306 | tmpVerts[14].point.set( -1, -1, -1 ); |
| 307 | |
| 308 | tmpVerts[12].texCoord.set( 0, 0 ); |
| 309 | tmpVerts[13].texCoord.set( 1.0f, 0 ); |
| 310 | tmpVerts[14].texCoord.set( 1.0f, 1.0f ); |
nothing calls this directly
no test coverage detected