From 6bb3d9c92d07274bc12154bebaba791e6877184f Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Sat, 29 Dec 2018 15:16:24 -0500 Subject: [PATCH] Implemented inline voxel get --- src/inc/world.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/inc/world.hpp b/src/inc/world.hpp index 6d59e1b..ce2c781 100644 --- a/src/inc/world.hpp +++ b/src/inc/world.hpp @@ -9,4 +9,11 @@ struct world unsigned int x_res; unsigned int y_res; unsigned int z_res; + + // Get the voxel at the specified coordinates. + + inline voxel get(unsigned int x, unsigned int y, unsigned int z) + { + return voxels[x + x_res * (y + y_res * z)]; + } }; \ No newline at end of file