|
| 1 | +/* |
| 2 | + * The MIT License (MIT) |
| 3 | + * |
| 4 | + * Copyright (c) 2025 Valdemar Lindberg |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in |
| 14 | + * all copies or substantial portions of the Software. |
| 15 | + */ |
1 | 16 | #pragma once |
2 | 17 | #include "Math3D/LinAlg.h" |
3 | 18 | #include "RenderDesc.h" |
4 | | -#include "SampleHelper.h" |
5 | | -#include "Scene/CameraController.h" |
| 19 | +#include "Scene/Camera.h" |
6 | 20 | #include "Scene/RenderQueue.h" |
7 | 21 | #include <glm/fwd.hpp> |
8 | 22 | #include <glm/matrix.hpp> |
@@ -46,13 +60,13 @@ namespace glsample { |
46 | 60 | using GraphicShaderSettings = struct graphic_shader_settings_t { // Property Maybe ? |
47 | 61 | fragcore::BlendEqu blend_equ = fragcore::BlendEqu::NoEqu; /* */ |
48 | 62 | fragcore::BlendFunc blend_color_func = fragcore::BlendFunc::One; /* */ |
49 | | - CullingMode cullingMode = CullingMode::Back; |
50 | | - DepthFunc DepthFunc = DepthFunc::Less; |
| 63 | + fragcore::CullingMode cullingMode = fragcore::CullingMode::Back; |
| 64 | + fragcore::DepthFunc DepthFunc = fragcore::DepthFunc::Less; |
51 | 65 | bool DepthWrite{}; |
52 | 66 | RenderQueue queue; |
53 | | - Primitive primitiveMode; |
| 67 | + fragcore::Primitive primitiveMode; |
54 | 68 |
|
55 | | - FillMode fillMode; |
| 69 | + fragcore::FillMode fillMode; |
56 | 70 |
|
57 | 71 | float clipping = 1; |
58 | 72 | }; |
@@ -133,28 +147,6 @@ namespace glsample { |
133 | 147 | return *this; |
134 | 148 | } |
135 | 149 |
|
136 | | - camera_instance_data_t &operator=(CameraController &camera) { |
137 | | - //*this = camera.as<Camera<float>>(); |
138 | | - |
139 | | - // TODO: reuse function above |
140 | | - this->near = camera.getNear(); |
141 | | - this->far = camera.getFar(); |
142 | | - this->proj = camera.getProjectionMatrix(); |
143 | | - this->view = camera.getViewMatrix(); |
144 | | - |
145 | | - this->inverseProj = glm::inverse(this->proj); |
146 | | - this->position = glm::vec4(camera.getPosition(), 0); |
147 | | - |
148 | | - this->viewDir = glm::vec4(camera.getLookDirection(), 0); |
149 | | - |
150 | | - this->viewInv = glm::inverse(this->view); |
151 | | - |
152 | | - this->viewRot = camera.getRotationMatrix(); |
153 | | - this->viewProj = this->proj * this->view; |
154 | | - this->viewProjInv = glm::inverse(this->viewProj); |
155 | | - return *this; |
156 | | - } |
157 | | - |
158 | 150 | /* */ |
159 | 151 | float near = 0.15; |
160 | 152 | float far = 1000; |
|
0 commit comments