From: Daniel Karbach Date: Thu, 3 Dec 2015 16:19:06 +0000 (+0100) Subject: the odd tweak and fix X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=103ddf2272310a538752342aa97d321567a30239;p=blank.git the odd tweak and fix --- diff --git a/assets b/assets index 902590b..02d4da5 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 902590ba6536e722414073bc9979b418e1f5a26f +Subproject commit 02d4da52e9a926bfed40ebed9b5f64c1da1ddf2f diff --git a/doc/todo b/doc/todo index 2de96bd..f2f557e 100644 --- a/doc/todo +++ b/doc/todo @@ -83,6 +83,15 @@ gravity maybe players should be given the option to switch between walk and fly mode + I had a NaN position while experimenting with (directional) gravity + blocks recently. I checked the gravity code and it seems solid, so + might be something I overlooked or, what more probable, it triggered + some NaN condition in the collision code. Needs investigating + + This may be related to the HUD locking on an entity. If the entity is + teleported to a NaN position, the ray intersection test could give a + false positive. + block attributes when blocks are not just a solid rock of color, attributes may @@ -105,6 +114,10 @@ world generator that is not boring there's a little more diversity between them chunk generation takes too long, it's incredibly annoying should look into speeding it up and executing on a different thread + compute shaders might be another approach, though that would require + opengl 4.3, block the gpu, and generally doesn't lend itself well to + threading (cpu wise). It also requires servers to load GL. maybe not + such a great idea after all spawning diff --git a/src/world/block.cpp b/src/world/block.cpp index 9372918..e99c5be 100644 --- a/src/world/block.cpp +++ b/src/world/block.cpp @@ -148,9 +148,11 @@ void BlockType::Read( if (name == "visible") { visible = in.GetBool(); } else if (name == "texture") { + textures.clear(); in.ReadString(name); textures.push_back(tex_index.GetID(name)); } else if (name == "textures") { + textures.clear(); in.Skip(Token::BRACKET_OPEN); while (in.Peek().type != Token::BRACKET_CLOSE) { in.ReadString(name); diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 60ece9a..d124eb7 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -368,7 +368,7 @@ float Chunk::GetVertexLight(const RoughLocation::Fine &pos, const BlockMesh::Pos glm::vec3 Chunk::GravityAt(const ExactLocation &coords) const noexcept { - glm::vec3 grav; + glm::vec3 grav(0.0f); for (int index : gravity) { RoughLocation::Fine block_pos(ToPos(index)); ExactLocation block_coords(position, ToCoords(block_pos));