fix mouse picking
This commit is contained in:
@@ -9,6 +9,15 @@
|
||||
namespace td {
|
||||
namespace render {
|
||||
|
||||
struct Camera {
|
||||
Mat4f viewMatrix;
|
||||
Mat4f projectionMatrix;
|
||||
Mat4f InvViewMatrix;
|
||||
Mat4f InvProjectionMatrix;
|
||||
|
||||
Vec3f CamPos;
|
||||
};
|
||||
|
||||
class Renderer {
|
||||
public:
|
||||
static constexpr float m_AnimationSpeed = 2.0f;
|
||||
@@ -24,9 +33,7 @@ private:
|
||||
|
||||
Vec3f m_BackgroundColor;
|
||||
|
||||
bool m_IsometricView = true;
|
||||
float m_IsometricShade = m_IsometricView;
|
||||
Vec2f m_CamPos{};
|
||||
Camera m_Camera {};
|
||||
public:
|
||||
Renderer();
|
||||
~Renderer();
|
||||
@@ -41,15 +48,12 @@ public:
|
||||
|
||||
void SetZoom(float zoom);
|
||||
void SetCamMovement(const Vec2f& mov);
|
||||
void SetCamPos(const Vec2f& newPos);
|
||||
void SetIsometricView(bool isometric); // false = 2D true = Isometric
|
||||
void SetCamPos(const Vec3f& newPos);
|
||||
|
||||
void SetBackgroundColor(const Vec3f& color) { m_BackgroundColor = color; }
|
||||
|
||||
Vec2f GetCursorWorldPos(const Vec2f& cursorPos, float aspectRatio, float zoom, float windowWidth, float windowHeight);
|
||||
Vec2f GetCursorWorldPos(const Vec2f& cursorPos, float windowWidth, float windowHeight);
|
||||
private:
|
||||
void UpdateIsometricView();
|
||||
void UpdateIsometricFade();
|
||||
void InitShaders();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user