theopenspaceprogramarchive / urho-osp Goto Github PK
View Code? Open in Web Editor NEWOpen Space Program in Urho3D
Open Space Program in Urho3D
Self explanatory.
Bless their souls.
@Causeless pointed out a few examples on Discord:
[12:28] Causeless: magic numbers no good 🙁
[12:29] Causeless: 5? 0.2?
[12:30] Causeless: seems that the culling for back-facing tris is too aggressive too
[12:30] Causeless: I guess 5 here is the max subdivision depth
Hi
I am trying to compile OSP on a debian system.
Building and installing Urho3d was succesfull.
Then during the build of urho-osp I get a number of errors. First type is with constexpr, and this can be removed by removing constexpr from the header files.
Any ideas what would be the correct solution here?
In file included from /home/flindt/OSP/urho-osp/src/Machines/../OspUniverse.h:10, from /home/flindt/OSP/urho-osp/src/Machines/MachineRocket.h:16, from /home/flindt/OSP/urho-osp/src/OspUniverse.cpp:16: /home/flindt/OSP/urho-osp/src/Machines/../Terrain/PlanetWrenderer.h:388:16: error: redeclaration ‘constexpr bool osp::PlanetWrenderer::is_ready() const’ differs in ‘constexpr’ from previous declaration constexpr bool PlanetWrenderer::is_ready() const ^~~~~~~~~~~~~~~ /home/flindt/OSP/urho-osp/src/Machines/../Terrain/PlanetWrenderer.h:279:20: note: previous declaration ‘bool osp::PlanetWrenderer::is_ready() const’ constexpr bool is_ready() const; ^~~~~~~~
Then if I continue the build with a few edited files, removing "constexpr", I get another error.
[ 5%] Building CXX object src/CMakeFiles/OSP.dir/main.cpp.o /home/flindt/OSP/urho-osp/src/main.cpp: In member function ‘virtual void osp::OSPApplication::Start()’: /home/flindt/OSP/urho-osp/src/main.cpp:161:9: error: ‘RegisterObject’ was not declared in this scope RegisterObject<OspUniverse>(scriptEngine, "OspUniverse"); ^~~~~~~~~~~~~~ /home/flindt/OSP/urho-osp/src/main.cpp:161:9: note: suggested alternative: ‘register_t’ RegisterObject<OspUniverse>(scriptEngine, "OspUniverse"); ^~~~~~~~~~~~~~ register_t
I am using gcc version 8.3.0.
Malformed triangles, resulting in edges going through the centre of the sphere:
SubTriangle* children = get_triangle(tri->m_children);
set_neighbors(children[0], tri->m_children + 3, tri->m_neighbors[1], tri->m_neighbors[2]);
set_neighbors(children[1], tri->m_neighbors[0], tri->m_children + 3, tri->m_neighbors[2]);
set_neighbors(children[2], tri->m_neighbors[0], tri->m_neighbors[1], tri->m_children + 3);
set_neighbors(children[3], tri->m_children + 0, tri->m_children + 1, tri->m_children + 2);
This code uses children[1] - [3] without checking that they exist, meaning it writes beyond the end of the triangles array. tri->m_children + 3
is inconsistent: why are m_neighbors using array indexing and m_children using pointer arithmetic? It'd make more sense if these all use [], i.e tri->m_children[3]
.
inline uint8_t PlanetWrenderer::neighboor_index(SubTriangle& tri, trindex lookingFor)
{
if (tri.m_neighbors[0] == lookingFor)
return 0;
else if (tri.m_neighbors[1] == lookingFor)
return 1;
else if (tri.m_neighbors[2] == lookingFor)
return 2;
// this means there's an error
//printf("Errrrorr \n");
return 255;
}
A loop would be a little cleaner here (and should be unrolled by the compiler anyways), but that aside, why return 255? This should be an assert.
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.