Add fallback model

This commit is contained in:
2021-01-16 13:26:05 +01:00
parent 74a604de8b
commit ee22a4cc04
5 changed files with 6 additions and 65 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ build
.vscode
res/models
res/textures
.kdev4

View File

@@ -1,60 +0,0 @@
[Buildset]
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x14\x00F\x00a\x00l\x00l\x00-\x00F\x00e\x00v\x00e\x00r)
[CMake]
Build Directory Count=1
Current Build Directory Index-Host-System=0
[CMake][CMake Build Directory 0]
Build Directory Path=/home/derek/Projekte/CXX/OpenGL/Fall-Fever/build
Build Type=DEBUG
CMake Binary=/usr/bin/cmake
CMake Executable=/usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=/usr/local
Runtime=Host-System
[Launch]
Launch Configurations=Launch Configuration 0,Launch Configuration 1
[Launch][Launch Configuration 0]
Configured Launch Modes=execute
Configured Launchers=nativeAppLauncher
Name=Fall-Fever
Type=Native Application
[Launch][Launch Configuration 0][Data]
Arguments=
Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x03\x00\x00\x00\x14\x00F\x00a\x00l\x00l\x00-\x00F\x00e\x00v\x00e\x00r\x00\x00\x00\x06\x00s\x00r\x00c\x00\x00\x00\x14\x00F\x00a\x00l\x00l\x00-\x00F\x00e\x00v\x00e\x00r)
Dependency Action=Build
EnvironmentGroup=
Executable=file:///home/derek/Projekte/CXX/OpenGL/Fall-Fever
External Terminal=konsole --noclose --workdir %workdir -e %exe
Kill Before Executing Again=4194304
Project Target=Fall-Fever,src,Fall-Fever
Use External Terminal=false
Working Directory=file:///home/derek/Projekte/CXX/OpenGL/Fall-Fever
isExecutable=false
[Launch][Launch Configuration 1]
Configured Launch Modes=execute
Configured Launchers=nativeAppLauncher
Name=RenderDoc
Type=Native Application
[Launch][Launch Configuration 1][Data]
Arguments=
Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x03\x00\x00\x00\x14\x00F\x00a\x00l\x00l\x00-\x00F\x00e\x00v\x00e\x00r\x00\x00\x00\x06\x00s\x00r\x00c\x00\x00\x00\x14\x00F\x00a\x00l\x00l\x00-\x00F\x00e\x00v\x00e\x00r)
Dependency Action=Build
EnvironmentGroup=
Executable=file:///home/derek/Projekte/CXX/OpenGL/Fall-Fever
External Terminal=/home/derek/Tools/RenderDoc/bin/renderdoccmd capture %exe
Kill Before Executing Again=4194304
Project Target=Fall-Fever,src,Fall-Fever
Use External Terminal=true
Working Directory=file:///home/derek/Projekte/CXX/OpenGL/Fall-Fever
isExecutable=false
[Project]
VersionControlSupport=kdevgit

View File

@@ -20,7 +20,7 @@
"entities": [
{
"unique_name": "backpack",
"model": "backpack",
"model": "backpvack",
"shaderProgram": "defaultProgram",
"position": [0.0, 1.0, 0.0],
"rotation": [0.0, 0.0, 0.0],

View File

@@ -74,8 +74,11 @@ std::vector<Entity*> JsonParser::getEntities(std::vector<Model*> &models, std::v
current_model = *it;
}
}
if(!current_model)
if(!current_model) {
// Apply fallback model (first model in vector)
current_model = models[0];
std::cout << "[Warning] Model could not be found by unique name \"" << entity_model << "\"" << std::endl;
}
const Json::Value positionJson = entitiesJson[index]["position"];
const Json::Value rotationJson = entitiesJson[index]["rotation"];

View File

@@ -41,9 +41,6 @@ private:
// Lights
std::vector<Light*> lights;
//DirectionalLight directionalLight;
//std::vector<PointLight> pointLights;
//SpotLight spotLight;
// Shadows
const int SHADOW_RES = 4096 / 4;