| 289 | } |
| 290 | |
| 291 | bool GroundPlane::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& ) |
| 292 | { |
| 293 | polyList->setObject( this ); |
| 294 | polyList->setTransform( &MatrixF::Identity, Point3F( 1.0f, 1.0f, 1.0f ) ); |
| 295 | |
| 296 | if(context == PLC_Navigation) |
| 297 | { |
| 298 | F32 z = getPosition().z; |
| 299 | Point3F |
| 300 | p0(box.minExtents.x, box.maxExtents.y, z), |
| 301 | p1(box.maxExtents.x, box.maxExtents.y, z), |
| 302 | p2(box.maxExtents.x, box.minExtents.y, z), |
| 303 | p3(box.minExtents.x, box.minExtents.y, z); |
| 304 | |
| 305 | // Add vertices to poly list. |
| 306 | U32 v0 = polyList->addPoint(p0); |
| 307 | polyList->addPoint(p1); |
| 308 | polyList->addPoint(p2); |
| 309 | polyList->addPoint(p3); |
| 310 | |
| 311 | // Add plane between first three vertices. |
| 312 | polyList->begin(0, 0); |
| 313 | polyList->vertex(v0); |
| 314 | polyList->vertex(v0+1); |
| 315 | polyList->vertex(v0+2); |
| 316 | polyList->plane(v0, v0+1, v0+2); |
| 317 | polyList->end(); |
| 318 | |
| 319 | // Add plane between last three vertices. |
| 320 | polyList->begin(0, 1); |
| 321 | polyList->vertex(v0+2); |
| 322 | polyList->vertex(v0+3); |
| 323 | polyList->vertex(v0); |
| 324 | polyList->plane(v0+2, v0+3, v0); |
| 325 | polyList->end(); |
| 326 | |
| 327 | return true; |
| 328 | } |
| 329 | |
| 330 | Box3F planeBox = getPlaneBox(); |
| 331 | polyList->addBox( planeBox, mMaterial ); |
| 332 | |
| 333 | return true; |
| 334 | } |
| 335 | |
| 336 | void GroundPlane::prepRenderImage( SceneRenderState* state ) |
| 337 | { |