mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 04:51:18 +00:00
Add test scene, update readme
This commit is contained in:
parent
6d49f022ec
commit
440e5d1fcc
6
README
6
README
@ -1,6 +0,0 @@
|
||||
a random game engine thing. Now finally with ECS!
|
||||
|
||||
Use the 'dev' branch for WIP.
|
||||
|
||||
Uses the google style guide:
|
||||
https://google.github.io/styleguide/cppguide.html
|
7
README.md
Normal file
7
README.md
Normal file
@ -0,0 +1,7 @@
|
||||
a random game engine thing. Now finally with ECS!
|
||||
|
||||
Use the 'dev' branch for WIP.
|
||||
|
||||
Uses the [Google Style Guide](https://google.github.io/styleguide/cppguide.html)
|
||||
|
||||
![A screenshot](screenshots/commit_6d49f02.jpg)
|
BIN
screenshots/commit_6d49f02.jpg
Normal file
BIN
screenshots/commit_6d49f02.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 183 KiB |
BIN
test/res/models/Map #4.002.tga
Normal file
BIN
test/res/models/Map #4.002.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 977 KiB |
BIN
test/res/models/piece2_basecolor.jpg
Normal file
BIN
test/res/models/piece2_basecolor.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
BIN
test/res/models/piece3_basecolor.jpg
Normal file
BIN
test/res/models/piece3_basecolor.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
BIN
test/res/models/test_scene.blend
Normal file
BIN
test/res/models/test_scene.blend
Normal file
Binary file not shown.
BIN
test/res/models/test_scene.blend1
Normal file
BIN
test/res/models/test_scene.blend1
Normal file
Binary file not shown.
BIN
test/res/models/test_scene.dae
(Stored with Git LFS)
Normal file
BIN
test/res/models/test_scene.dae
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -93,6 +93,7 @@ void PlayGame(GameSettings settings) {
|
||||
&app.render_data_, app.GetResourcePath("textures/space2.png"),
|
||||
engine::resources::Texture::Filtering::kAnisotropic);
|
||||
|
||||
#if 0
|
||||
/* cube */
|
||||
{
|
||||
uint32_t cube = my_scene->CreateEntity("cube");
|
||||
@ -111,27 +112,13 @@ void PlayGame(GameSettings settings) {
|
||||
cube_collider->aabb = {{0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, 1.0f}};
|
||||
}
|
||||
|
||||
/* floor */
|
||||
{
|
||||
uint32_t floor = my_scene->CreateEntity("floor");
|
||||
my_scene->GetComponent<engine::TransformComponent>(floor)->position =
|
||||
glm::vec3{-5000.0f, -1.0f, -5000.0f};
|
||||
auto floor_renderable =
|
||||
my_scene->AddComponent<engine::RenderableComponent>(floor);
|
||||
floor_renderable->material = std::make_shared<engine::resources::Material>(
|
||||
app.GetResource<engine::resources::Shader>("builtin.standard"));
|
||||
floor_renderable->material->texture_ = grass_texture;
|
||||
floor_renderable->mesh =
|
||||
GenCuboidMesh(app.gfxdev(), 10000.0f, 1.0f, 10000.0f, 5000.0f);
|
||||
floor_renderable->shown = true;
|
||||
auto floor_collider =
|
||||
my_scene->AddComponent<engine::ColliderComponent>(floor);
|
||||
floor_collider->is_static = true;
|
||||
floor_collider->aabb = {{0.0f, 0.0f, 0.0f}, {10000.0f, 1.0f, 10000.0f}};
|
||||
}
|
||||
engine::util::LoadMeshFromFile(
|
||||
my_scene, app.GetResourcePath("models/astronaut/astronaut.dae"));
|
||||
|
||||
// engine::util::LoadMeshFromFile(
|
||||
// my_scene, app.GetResourcePath("models/astronaut/astronaut.dae"));
|
||||
engine::util::LoadMeshFromFile(
|
||||
my_scene, app.GetResourcePath("models/plane/plane.dae"));
|
||||
|
||||
#endif
|
||||
|
||||
/* skybox */
|
||||
{
|
||||
@ -147,6 +134,28 @@ void PlayGame(GameSettings settings) {
|
||||
-5.0f, -5.0f, -5.0f};
|
||||
}
|
||||
|
||||
/* floor */
|
||||
{
|
||||
uint32_t floor = my_scene->CreateEntity("floor");
|
||||
my_scene->GetComponent<engine::TransformComponent>(floor)->position =
|
||||
glm::vec3{-50.0f, -0.1f, -50.0f};
|
||||
auto floor_renderable =
|
||||
my_scene->AddComponent<engine::RenderableComponent>(floor);
|
||||
floor_renderable->material = std::make_shared<engine::resources::Material>(
|
||||
app.GetResource<engine::resources::Shader>("builtin.standard"));
|
||||
floor_renderable->material->texture_ = grass_texture;
|
||||
floor_renderable->mesh =
|
||||
GenCuboidMesh(app.gfxdev(), 100.0f, 0.1f, 100.0f, 100.0f);
|
||||
floor_renderable->shown = true;
|
||||
auto floor_collider =
|
||||
my_scene->AddComponent<engine::ColliderComponent>(floor);
|
||||
floor_collider->is_static = true;
|
||||
floor_collider->aabb = {{0.0f, 0.0f, 0.0f}, {100.0f, 0.1f, 100.0f}};
|
||||
}
|
||||
|
||||
engine::util::LoadMeshFromFile(
|
||||
my_scene, app.GetResourcePath("models/test_scene.dae"));
|
||||
|
||||
/* some text */
|
||||
{
|
||||
int width, height;
|
||||
@ -167,6 +176,7 @@ void PlayGame(GameSettings settings) {
|
||||
textbox_renderable->mesh = GenSphereMesh(app.gfxdev(), 1.0f, 5);
|
||||
my_scene->GetComponent<engine::TransformComponent>(textbox)->scale.y =
|
||||
(float)height / (float)width;
|
||||
textbox_renderable->shown = false;
|
||||
|
||||
my_scene->AddComponent<engine::CustomComponent>(textbox)->onUpdate =
|
||||
[&](float ts) {
|
||||
|
Loading…
Reference in New Issue
Block a user