| 602 | //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~// |
| 603 | |
| 604 | void afxModel::prepRenderImage(SceneRenderState* state) |
| 605 | { |
| 606 | if (!is_visible || !shape_inst) |
| 607 | return; |
| 608 | |
| 609 | // calculate distance to camera |
| 610 | Point3F cameraOffset; |
| 611 | getRenderTransform().getColumn(3, &cameraOffset); |
| 612 | cameraOffset -= state->getCameraPosition(); |
| 613 | F32 dist = cameraOffset.len(); |
| 614 | if (dist < 0.01f) |
| 615 | dist = 0.01f; |
| 616 | |
| 617 | F32 invScale = (1.0f/getMax(getMax(mObjScale.x,mObjScale.y),mObjScale.z)); |
| 618 | shape_inst->setDetailFromDistance(state, dist*invScale); |
| 619 | if ( shape_inst->getCurrentDetail() < 0 ) |
| 620 | return; |
| 621 | |
| 622 | renderObject(state); |
| 623 | } |
| 624 | |
| 625 | bool afxModel::castRay(const Point3F &start, const Point3F &end, RayInfo* info) |
| 626 | { |
nothing calls this directly
no test coverage detected