================ idRenderModelStatic::MakeDefaultModel ================ */
| 230 | ================ |
| 231 | */ |
| 232 | void idRenderModelStatic::MakeDefaultModel() { |
| 233 | |
| 234 | defaulted = true; |
| 235 | |
| 236 | // throw out any surfaces we already have |
| 237 | PurgeModel(); |
| 238 | |
| 239 | // create one new surface |
| 240 | modelSurface_t surf; |
| 241 | |
| 242 | srfTriangles_t *tri = R_AllocStaticTriSurf(); |
| 243 | |
| 244 | surf.shader = tr.defaultMaterial; |
| 245 | surf.geometry = tri; |
| 246 | |
| 247 | R_AllocStaticTriSurfVerts( tri, 24 ); |
| 248 | R_AllocStaticTriSurfIndexes( tri, 36 ); |
| 249 | |
| 250 | AddCubeFace( tri, idVec3(-1, 1, 1), idVec3(1, 1, 1), idVec3(1, -1, 1), idVec3(-1, -1, 1) ); |
| 251 | AddCubeFace( tri, idVec3(-1, 1, -1), idVec3(-1, -1, -1), idVec3(1, -1, -1), idVec3(1, 1, -1) ); |
| 252 | |
| 253 | AddCubeFace( tri, idVec3(1, -1, 1), idVec3(1, 1, 1), idVec3(1, 1, -1), idVec3(1, -1, -1) ); |
| 254 | AddCubeFace( tri, idVec3(-1, -1, 1), idVec3(-1, -1, -1), idVec3(-1, 1, -1), idVec3(-1, 1, 1) ); |
| 255 | |
| 256 | AddCubeFace( tri, idVec3(-1, -1, 1), idVec3(1, -1, 1), idVec3(1, -1, -1), idVec3(-1, -1, -1) ); |
| 257 | AddCubeFace( tri, idVec3(-1, 1, 1), idVec3(-1, 1, -1), idVec3(1, 1, -1), idVec3(1, 1, 1) ); |
| 258 | |
| 259 | tri->generateNormals = true; |
| 260 | |
| 261 | AddSurface( surf ); |
| 262 | FinishSurfaces(); |
| 263 | } |
| 264 | |
| 265 | /* |
| 266 | ================ |
no test coverage detected