citm-upc / kingdom Goto Github PK
View Code? Open in Web Editor NEWA 3D Game Engine made in C, C++ and some libraries.
Home Page: https://citm-upc.github.io/Kingdom/
License: MIT License
A 3D Game Engine made in C, C++ and some libraries.
Home Page: https://citm-upc.github.io/Kingdom/
License: MIT License
While we were changing our project, to be used with smart pointers, we found out that the meshes stopped drawing.
Current changes are located in branch components-structure-rework.
Some of the notable changes we have done so far:
We've added in the copy constructor of the Mesh some safety checks in order to prevent OpenGL errors. Also removed const in the function arguments.
Lines 109 to 128 in 6d5c424
We've created MeshInfo for the custom file format purposes.
Lines 5 to 32 in 6d5c424
With the MeshInfo class created, we modified the loadMeshFromFile(...) function so that it returns a MeshInfo vector.
Kingdom/GameEngine/MeshLoader.h
Lines 17 to 82 in 6d5c424
And with this MeshInfo vector, where we add GameObjects we use the MeshInfo vector in order to create the Mesh components and add them to the GameObject list in Engine_ModuleRenderer3D
Kingdom/GameEngine/Engine_ModuleRenderer3D.cpp
Lines 269 to 313 in 6d5c424
We also have a Template function to add the Component to the list of components in GameObject.
Kingdom/GameEngine/GameObject.h
Lines 54 to 58 in 6d5c424
With these changes, we built the project and it does not draw correctly the meshes. The thing is, that while we were debugging, here are the values that the index_buffer_id and the vertex_buffer id have. (We are loading BakerHouse.fbx, which has 2 meshes)
This is for the Chimney.
And this is for the House.
At this point we are desperate to know what is going on. We haven't done anything regarding the 2nd assignment that its due to this 13th of December. I know that you said that these days you were going to be busy, but I hope you can read this ASAP.
I have a question about deserializing the custom format file from a .bin type of file.
I've modified and adapted the serialize function we have done in class to our MeshInfo.
Lines 40 to 60 in 979e4c2
So for the question, I have the vertex_data and the index_data as const both.
Lines 29 to 30 in 979e4c2
Another question that I have, is since I have a void* in:
Line 29 in 979e4c2
Line 30 in 979e4c2
This is the function we have done in class.
Lines 62 to 73 in 979e4c2
When trying to add a GameObject to the gameObjectsList (currently in Engine_ModuleRenderer.h), a compilation error happens with code C2280 'std::unique_ptr<Component,std::default_delete<Component>>::unique_ptr(const std::unique_ptr<Component,std::default_delete<Component>> &)': attempting to reference a deleted function
.
The error is believed to be emerging due to GameObject having a vector of unique_ptr, which keeps exculsive ownerships and when trying to push_back into the gameObjectsList this exclusive ownership prevents it from doing so.
The push_back is located in
The vector of unique_ptr is located in
Kingdom/GameEngine/GameObject.h
Line 21 in 23a6e58
Hi @Ethanm-0371 @xGauss05 @PauFusco
It seems the MeshLoader that creates a MeshInfo has some errors.
You are passing temporary data to the MeshInfo (vertex_data and index_data are local variables)
Kingdom/GameEngine/MeshLoader.h
Lines 47 to 76 in 58cbf34
Doing the transform rework to glm, when trying to add the forward vector multiplied by the offset to the position vector, the result ends up being (0,0,0) or a number of order ^-15.
This error is located here:
Line 13 in 75a9558
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.