Fixes
This commit is contained in:
@ -18,6 +18,7 @@
|
|||||||
#include <IAEngine/Nodes/Node2D.hpp>
|
#include <IAEngine/Nodes/Node2D.hpp>
|
||||||
|
|
||||||
#include <Renderer/Renderer.hpp>
|
#include <Renderer/Renderer.hpp>
|
||||||
|
#include <IAEngine/Engine.hpp>
|
||||||
|
|
||||||
namespace ia::iae
|
namespace ia::iae
|
||||||
{
|
{
|
||||||
@ -38,7 +39,7 @@ namespace ia::iae
|
|||||||
|
|
||||||
CONST Mat4 *CameraComponent::GetViewMatrix()
|
CONST Mat4 *CameraComponent::GetViewMatrix()
|
||||||
{
|
{
|
||||||
const auto pos = m_node->GetPosition() + m_positionOffset;
|
const auto pos = (m_node->GetPosition() + m_positionOffset) * Engine::GetRendererScalingFactor();
|
||||||
m_viewMatrix = glm::lookAtLH(glm::vec3{pos, -2.0f}, {pos, 0.0f}, {0.0f, 1.0f, 0.0f});
|
m_viewMatrix = glm::lookAtLH(glm::vec3{pos, -2.0f}, {pos, 0.0f}, {0.0f, 1.0f, 0.0f});
|
||||||
return &m_viewMatrix;
|
return &m_viewMatrix;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -326,6 +326,11 @@ namespace ia::iae
|
|||||||
return Renderer::s_state.ActiveCamera;
|
return Renderer::s_state.ActiveCamera;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vec2 Engine::GetRendererScalingFactor()
|
||||||
|
{
|
||||||
|
return Renderer::s_state.SceneScaleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
Handle Engine::CreateGeometry(IN CONST Vector<GeometryVertex> &vertices, IN CONST Vector<INT32> &indices)
|
Handle Engine::CreateGeometry(IN CONST Vector<GeometryVertex> &vertices, IN CONST Vector<INT32> &indices)
|
||||||
{
|
{
|
||||||
return (Handle) Renderer::CreateGeometry(vertices, indices);
|
return (Handle) Renderer::CreateGeometry(vertices, indices);
|
||||||
|
|||||||
@ -61,6 +61,7 @@ namespace ia::iae
|
|||||||
STATIC VOID SetRenderState_Texture(IN Handle image);
|
STATIC VOID SetRenderState_Texture(IN Handle image);
|
||||||
STATIC VOID SetRenderState_Transform(IN Vec2 position, IN Vec2 scale, IN FLOAT32 rotation, IN UINT8 layer,
|
STATIC VOID SetRenderState_Transform(IN Vec2 position, IN Vec2 scale, IN FLOAT32 rotation, IN UINT8 layer,
|
||||||
IN INT16 sortIndex);
|
IN INT16 sortIndex);
|
||||||
|
STATIC Vec2 GetRendererScalingFactor();
|
||||||
|
|
||||||
// Debug Draw Functions
|
// Debug Draw Functions
|
||||||
STATIC VOID DebugDraw_SetColor(IN Color color);
|
STATIC VOID DebugDraw_SetColor(IN Color color);
|
||||||
|
|||||||
Reference in New Issue
Block a user