Skip to content

Commit

Permalink
better fov values
Browse files Browse the repository at this point in the history
  • Loading branch information
SArpnt committed Feb 17, 2021
1 parent 86b5265 commit 4cab9d0
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions engine/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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: <PUT THIS IN THE RENDER ENGINE>
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: </PUT THIS IN THE RENDER ENGINE>

/* Render */
renderingEngine->registerCommand({transform,material,mesh,mesh->GetIndexCount()});
renderingEngine->registerCommand({transform, material, mesh, mesh->GetIndexCount()});

renderingEngine->render();

window->swapBuffers();
Expand Down

1 comment on commit 4cab9d0

@SArpnt
Copy link
Contributor Author

@SArpnt SArpnt commented on 4cab9d0 Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of this commit is wrong, it's just formatting

Please sign in to comment.