rename lookat function
This commit is contained in:
@@ -73,7 +73,7 @@ typedef Mat4<int> Mat4i;
|
|||||||
typedef Mat4<double> Mat4d;
|
typedef Mat4<double> Mat4d;
|
||||||
|
|
||||||
Mat4f Perspective(float fovY, float aspectRatio, float zNear, float zFar);
|
Mat4f Perspective(float fovY, float aspectRatio, float zNear, float zFar);
|
||||||
Mat4f LookAt(const Vec3f& eye, const Vec3f& center, const Vec3f& up);
|
Mat4f Look(const Vec3f& eye, const Vec3f& center, const Vec3f& up);
|
||||||
|
|
||||||
Mat4f Dot(const Mat4f& mat, const Mat4f& other);
|
Mat4f Dot(const Mat4f& mat, const Mat4f& other);
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ Mat4f Perspective(float fovY, float aspectRatio, float zNear, float zFar) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat4f LookAt(const Vec3f& eye, const Vec3f& center, const Vec3f& up) {
|
Mat4f Look(const Vec3f& eye, const Vec3f& front, const Vec3f& up) {
|
||||||
const Vec3f f = Normalize(center - eye);
|
const Vec3f f = Normalize(front);
|
||||||
const Vec3f s = Normalize(Cross(f, up));
|
const Vec3f s = Normalize(Cross(f, up));
|
||||||
const Vec3f u = Cross(s, f);
|
const Vec3f u = Cross(s, f);
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ void Renderer::SetCamMovement(const Vec2f& mov) {
|
|||||||
|
|
||||||
void Renderer::SetCamPos(const Vec2f& newPos) {
|
void Renderer::SetCamPos(const Vec2f& newPos) {
|
||||||
m_CamPos = newPos;
|
m_CamPos = newPos;
|
||||||
maths::Mat4f viewMatrix = maths::LookAt({m_CamPos.x, 50, m_CamPos.y}, {m_CamPos.x, -1, m_CamPos.y}, {0, 1, 0});
|
maths::Mat4f viewMatrix = maths::Look({m_CamPos.x, 50, m_CamPos.y}, {0, -1, -0.0001}, {0, 1, 0});
|
||||||
m_WorldShader->Start();
|
m_WorldShader->Start();
|
||||||
m_WorldShader->SetViewMatrix(viewMatrix);
|
m_WorldShader->SetViewMatrix(viewMatrix);
|
||||||
m_EntityShader->Start();
|
m_EntityShader->Start();
|
||||||
|
|||||||
Reference in New Issue
Block a user