| 1617 | } |
| 1618 | |
| 1619 | void ModelViewerWidget::ComposeProjectionMatrix() { |
| 1620 | projection_matrix_.setToIdentity(); |
| 1621 | if (options_->render->projection_type == |
| 1622 | RenderOptions::ProjectionType::PERSPECTIVE) { |
| 1623 | projection_matrix_.perspective( |
| 1624 | kFieldOfView, AspectRatio(), near_plane_, kFarPlane); |
| 1625 | } else if (options_->render->projection_type == |
| 1626 | RenderOptions::ProjectionType::ORTHOGRAPHIC) { |
| 1627 | const float extent = OrthographicWindowExtent(); |
| 1628 | projection_matrix_.ortho(-AspectRatio() * extent, |
| 1629 | AspectRatio() * extent, |
| 1630 | -extent, |
| 1631 | extent, |
| 1632 | near_plane_, |
| 1633 | kFarPlane); |
| 1634 | } |
| 1635 | } |
| 1636 | |
| 1637 | float ModelViewerWidget::ZoomScale() const { |
| 1638 | // "Constant" scale factor w.r.t. zoom-level. |
nothing calls this directly
no outgoing calls
no test coverage detected