--------------------------------- CameraComponent::PopulateCamera fill out a render camera from the component
| 41 | // fill out a render camera from the component |
| 42 | // |
| 43 | void CameraComponent::PopulateCamera(render::Camera& target, render::Viewport const& viewport, TransformComponent const& tfComp) const |
| 44 | { |
| 45 | target.SetTransformation(tfComp.GetPosition(), tfComp.GetForward(), tfComp.GetUp(), true); |
| 46 | |
| 47 | target.SetIsPerspective(true, true); // #todo: support ortho cameras |
| 48 | target.SetFieldOfView(m_FieldOfView, true); |
| 49 | target.SetSize(m_Size, true); |
| 50 | target.SetClippingPlanes(m_NearPlane, m_FarPlane, true); |
| 51 | target.SetViewport(&viewport, true); |
| 52 | |
| 53 | target.Recalculate(); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | //============================= |
no test coverage detected