Skip to content

Commit

Permalink
Add kenney racing kit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjaltesorgenfrei committed Feb 9, 2024
1 parent a21fdeb commit b8fc0f8
Show file tree
Hide file tree
Showing 230 changed files with 87,645 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Based upon [Vulkan Tutorial](https://vulkan-tutorial.com), inspiration drawn fro
and [Brendan Galea's YouTube series](https://www.youtube.com/c/BrendanGalea).
Some ideas were also taken from [Zeux's blog](https://zeux.io/2020/02/27/writing-an-efficient-vulkan-renderer/).
["Low poly race track"](https://skfb.ly/ooYNR) by Quarks Studios is licensed under [Creative Commons Attribution](http://creativecommons.org/licenses/by/4.0/).
Models in [./src/resources/kenney/](./src/resources/kenney/) by [Kenney](https://www.kenney.nl) is licensed under [Creative Commons Zero](http://creativecommons.org/publicdomain/zero/1.0/).

## Read More

Expand Down
16 changes: 16 additions & 0 deletions src/client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,22 @@ void App::setupWorld() {
meshes["car"] = objects[3]->mesh;
noMaterial = objects[1]->material;
carMaterial = objects[3]->material;

// Get all files in "resources/kenney/racing" and load them
std::vector<std::string> files;
for (const auto& entry : std::filesystem::directory_iterator("resources/kenney/racing")) {
if (entry.path().extension() == ".obj") {
files.push_back(entry.path().string());
}
}
for (const auto& file : files) {
auto mesh = std::make_shared<RenderObject>(Mesh::LoadFromObj(file.c_str()));
renderer->uploadMeshes({mesh});
auto name = file.substr(file.find_last_of("/\\") + 1); // Get the name of the file
name = name.substr(0, name.find_last_of(".")); // Remove extension
meshes[name] = mesh->mesh;
}

createSpawnPoints(10);

auto keyboardPlayer = addPlayer(KeyboardInput{});
Expand Down
23 changes: 23 additions & 0 deletions src/resources/kenney/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@


Racing Kit (2.0)

Created/distributed by Kenney (www.kenney.nl)
Creation date: 07-11-2018 00:26

------------------------------

License: (Creative Commons Zero, CC0)
http://creativecommons.org/publicdomain/zero/1.0/

This content is free to use in personal, educational and commercial projects.
Support us by crediting Kenney or www.kenney.nl (this is not mandatory)

------------------------------

Donate: http://support.kenney.nl
Request: http://request.kenney.nl
Patreon: http://patreon.com/kenney/

Follow on Twitter for updates:
http://twitter.com/KenneyNL
Expand Down
Binary file added src/resources/kenney/racing/Textures/checkers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/resources/kenney/racing/Textures/net.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/resources/kenney/racing/Textures/tankco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/resources/kenney/racing/bannerTowerGreen.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Created by Kenney (www.kenney.nl)

newmtl _defaultMat
Ka 0.000000 0.000000 0.000000
Kd 1 1 1
Ks 0.330000 0.330000 0.330000

newmtl grey
Ka 0.000000 0.000000 0.000000
Kd 0.945098 0.9490196 0.9647059
Ks 0.330000 0.330000 0.330000

newmtl grass
Ka 0.000000 0.000000 0.000000
Kd 0.3019608 0.5607843 0.4313726
Ks 0.330000 0.330000 0.330000

Loading

0 comments on commit b8fc0f8

Please sign in to comment.