| 306 | } |
| 307 | |
| 308 | bool GroundPlane::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& ) |
| 309 | { |
| 310 | polyList->setObject( this ); |
| 311 | polyList->setTransform( &MatrixF::Identity, Point3F( 1.0f, 1.0f, 1.0f ) ); |
| 312 | |
| 313 | if(context == PLC_Navigation) |
| 314 | { |
| 315 | F32 z = getPosition().z; |
| 316 | Point3F |
| 317 | p0(box.minExtents.x, box.maxExtents.y, z), |
| 318 | p1(box.maxExtents.x, box.maxExtents.y, z), |
| 319 | p2(box.maxExtents.x, box.minExtents.y, z), |
| 320 | p3(box.minExtents.x, box.minExtents.y, z); |
| 321 | |
| 322 | // Add vertices to poly list. |
| 323 | U32 v0 = polyList->addPoint(p0); |
| 324 | polyList->addPoint(p1); |
| 325 | polyList->addPoint(p2); |
| 326 | polyList->addPoint(p3); |
| 327 | |
| 328 | // Add plane between first three vertices. |
| 329 | polyList->begin(0, 0); |
| 330 | polyList->vertex(v0); |
| 331 | polyList->vertex(v0+1); |
| 332 | polyList->vertex(v0+2); |
| 333 | polyList->plane(v0, v0+1, v0+2); |
| 334 | polyList->end(); |
| 335 | |
| 336 | // Add plane between last three vertices. |
| 337 | polyList->begin(0, 1); |
| 338 | polyList->vertex(v0+2); |
| 339 | polyList->vertex(v0+3); |
| 340 | polyList->vertex(v0); |
| 341 | polyList->plane(v0+2, v0+3, v0); |
| 342 | polyList->end(); |
| 343 | |
| 344 | return true; |
| 345 | } |
| 346 | |
| 347 | Box3F planeBox = getPlaneBox(); |
| 348 | polyList->addBox( planeBox, mMaterialInst ); |
| 349 | |
| 350 | return true; |
| 351 | } |
| 352 | |
| 353 | void GroundPlane::prepRenderImage( SceneRenderState* state ) |
| 354 | { |
nothing calls this directly
no test coverage detected