From 4cab9d0f72c069a4b957a0626dc68c3eda14c205 Mon Sep 17 00:00:00 2001 From: SArpnt <36542932+SArpnt@users.noreply.github.com> Date: Wed, 17 Feb 2021 08:24:12 -0500 Subject: [PATCH] better fov values --- engine/main.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/engine/main.cpp b/engine/main.cpp index f62cafe0..42125365 100644 --- a/engine/main.cpp +++ b/engine/main.cpp @@ -73,13 +73,12 @@ int main(int argc, char* argv[]) { LOG_INFO("Hello World"); ce::Time* time = new ce::Time(); - + ce::Window* window = new ce::Window("Cinnabar"); ce::RenderingEngine* renderingEngine = new ce::RenderingEngine(); renderingEngine->setFOV(75.0f); renderingEngine->setSize(window->getWindowSize()); - ce::Transform* transform = new ce::Transform(); ce::Mesh* mesh = new ce::Mesh(vertices, vertexCount, indices, indexCount); ce::Material* material = new ce::Material(new ce::Shader("basic")); @@ -168,29 +167,29 @@ int main(int argc, char* argv[]) { transform->roll(25.0f * time->getDeltaTime()); transform->yaw(50.0f * time->getDeltaTime()); transform->pitch(100.0f * time->getDeltaTime()); - + // TODO: material->update(); - // Camera glm::vec3 cameraFront = camera->getTransform()->getForward(), cameraRight = camera->getRight(), cameraUp = ce::Transform::GetGlobalUp(); - camera->getTransform()->translate((cameraFront * cameraVelocity.z)+(cameraRight * cameraVelocity.x)+(cameraUp * cameraVelocity.y)); - - + camera->getTransform()->translate( + (cameraFront * cameraVelocity.z) + + (cameraRight * cameraVelocity.x) + + (cameraUp * cameraVelocity.y)); + transform->sendToShader(material->getShader()); - material->getShader()->setMat4("transform.proj",proj); + material->getShader()->setMat4("transform.proj", proj); camera->sendToShader(material->getShader()); - - + // TODO: - + /* Render */ - renderingEngine->registerCommand({transform,material,mesh,mesh->GetIndexCount()}); - + renderingEngine->registerCommand({transform, material, mesh, mesh->GetIndexCount()}); + renderingEngine->render(); window->swapBuffers();