Compare commits
3 Commits
3c2db2dc2c
...
1989ff4cc2
Author | SHA1 | Date | |
---|---|---|---|
1989ff4cc2 | |||
08646911ba | |||
a3233d90c7 |
13
README.md
13
README.md
@ -4,7 +4,18 @@
|
|||||||
|
|
||||||
C++ ECS OpenGL game demo.
|
C++ ECS OpenGL game demo.
|
||||||
|
|
||||||
Building requires OpenGL 3.2+, GLFW, GLM and GLAD.
|
## Movement
|
||||||
|
- Moving and panning: WASD and mouse
|
||||||
|
- Switching between free-look and path-mode: P
|
||||||
|
- Adding a path point: R
|
||||||
|
- Changing speed in path-mode: W/S
|
||||||
|
- Toggle anti-aliasing: Q
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
Building requires OpenGL 3.2+, GLFW, GLM and GLAD. CMake is used for compiling.
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
Some code adapted from Joey de Vries' (https://twitter.com/JoeyDeVriez) tutorials at https://learnopengl.com/About licensed under https://creativecommons.org/licenses/by-nc/4.0/.
|
Some code adapted from Joey de Vries' (https://twitter.com/JoeyDeVriez) tutorials at https://learnopengl.com/About licensed under https://creativecommons.org/licenses/by-nc/4.0/.
|
||||||
|
|
||||||
|
@ -127,6 +127,8 @@ class KDTree {
|
|||||||
nearest = current_distance;
|
nearest = current_distance;
|
||||||
nearest_triangle = triangle;
|
nearest_triangle = triangle;
|
||||||
result = current_result;
|
result = current_result;
|
||||||
|
} else {
|
||||||
|
delete[] current_result.c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
main.cpp
14
main.cpp
@ -205,6 +205,20 @@ int main(int argc, char **argv) {
|
|||||||
ring->assign<Material>(0.1, 0.9);
|
ring->assign<Material>(0.1, 0.9);
|
||||||
ring->get<Transform>()->set_origin(glm::vec3(-5.0f, 2.0f, 0.0f));
|
ring->get<Transform>()->set_origin(glm::vec3(-5.0f, 2.0f, 0.0f));
|
||||||
|
|
||||||
|
/* for (int i = 0; i < 20; i++) {
|
||||||
|
Entity *ring = world->create();
|
||||||
|
ring->assign<Transform>();
|
||||||
|
ring->assign<ObjMesh>(ObjMesh("Resources/ring.obj", ObjMesh::Settings()));
|
||||||
|
ring->assign<Texture>("Resources/Metal007_2K_Color.jpg", Texture::Settings(true),
|
||||||
|
false); ring->get<Texture>()->addNormalmap("Resources/Metal007_2K_Normal.jpg",
|
||||||
|
Texture::Settings(true));
|
||||||
|
ring->assign<Material>(0.1, 0.9);
|
||||||
|
ring->get<Transform>()->set_origin(
|
||||||
|
glm::vec3(((float)(rand() - RAND_MAX / 2) / (float)RAND_MAX) * 50.0,
|
||||||
|
((float)(rand() - RAND_MAX / 2) / (float)RAND_MAX) * 50.0,
|
||||||
|
((float)(rand() - RAND_MAX / 2) / (float)RAND_MAX) * 50.0));
|
||||||
|
} */
|
||||||
|
|
||||||
Entity *sun = world->create();
|
Entity *sun = world->create();
|
||||||
sun->assign<DirectionalLight>(glm::normalize(glm::vec3(1.0, 1.0, 1.0)));
|
sun->assign<DirectionalLight>(glm::normalize(glm::vec3(1.0, 1.0, 1.0)));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user