14 _node = std::unique_ptr<GraphNode>(value);
19 if (_projection != value) {
27 if (_aspectRatio != value) {
35 if (_aspectRatioMode != value) {
36 _aspectRatioMode = value;
41 void Camera::evaluateProjectionMatrix()
46 _projMatSkybox = _projMat;
48 const auto y = _orthoHeight;
54 _projMatDirty =
false;
59 const int renderVersion)
61 if (_shaderMatricesVersion == renderVersion) {
65 _shaderMatricesVersion = renderVersion;
66 _viewProjPrevious = _hasViewProjCurrent ? _viewProjCurrent : viewProjection;
67 _viewProjCurrent = viewProjection;
68 _hasViewProjCurrent =
true;
69 _viewProjInverse = viewProjection.
inverse();
71 _jitters[2] = _jitters[0];
72 _jitters[3] = _jitters[1];
73 _jitters[0] = jitterX;
74 _jitters[1] = jitterY;
80 if (!_renderPassColorGrab) {
81 _renderPassColorGrab = std::make_shared<RenderPassColorGrab>(device);
84 _renderPassColorGrab.reset();
91 if (!_renderPassDepthGrab) {
92 _renderPassDepthGrab = std::make_shared<RenderPassDepthGrab>(device,
this);
95 _renderPassDepthGrab.reset();
float aspectRatio() const
void setProjection(ProjectionType value)
void _enableRenderPassColorGrab(const std::shared_ptr< GraphicsDevice > &device, bool enable)
void _enableRenderPassDepthGrab(const std::shared_ptr< GraphicsDevice > &device, bool enable)
void setAspectRatio(float value)
void setNode(GraphNode *value)
bool horizontalFov() const
void setAspectRatioMode(AspectRatioMode value)
void storeShaderMatrices(const Matrix4 &viewProjection, float jitterX, float jitterY, int renderVersion)
Hierarchical scene graph node with local/world transforms and parent-child relationships.
4x4 column-major transformation matrix with SIMD acceleration.
static Matrix4 ortho(float left, float right, float bottom, float top, float near, float far)
static Matrix4 perspective(float fov, float aspect, float zNear, float zFar, bool fovIsHorizontal=false)