summaryrefslogtreecommitdiffstats
path: root/src/game/shared/world/voxel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/shared/world/voxel.cc')
-rw-r--r--src/game/shared/world/voxel.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/game/shared/world/voxel.cc b/src/game/shared/world/voxel.cc
index 21fe62c..4f47c2d 100644
--- a/src/game/shared/world/voxel.cc
+++ b/src/game/shared/world/voxel.cc
@@ -6,33 +6,33 @@
#include "shared/world/dimension.hh"
-world::Voxel::Voxel(const Voxel& source, voxel_id id) noexcept : Voxel(source)
+Voxel::Voxel(const Voxel& source, voxel_id id) noexcept : Voxel(source)
{
m_id = id;
}
-void world::Voxel::on_place(Dimension* dimension, const voxel_pos& vpos) const
+void Voxel::on_place(Dimension* dimension, const voxel_pos& vpos) const
{
if(m_on_place) {
m_on_place(dimension, vpos);
}
}
-void world::Voxel::on_remove(Dimension* dimension, const voxel_pos& vpos) const
+void Voxel::on_remove(Dimension* dimension, const voxel_pos& vpos) const
{
if(m_on_remove) {
m_on_remove(dimension, vpos);
}
}
-void world::Voxel::on_tick(Dimension* dimension, const voxel_pos& vpos) const
+void Voxel::on_tick(Dimension* dimension, const voxel_pos& vpos) const
{
if(m_on_tick) {
m_on_tick(dimension, vpos);
}
}
-std::size_t world::Voxel::get_random_texture_index(VoxelFace face, const voxel_pos& vpos) const
+std::size_t Voxel::get_random_texture_index(VoxelFace face, const voxel_pos& vpos) const
{
const auto& textures = get_face_textures(face);
@@ -46,7 +46,7 @@ std::size_t world::Voxel::get_random_texture_index(VoxelFace face, const voxel_p
return static_cast<std::size_t>(hash % textures.size());
}
-void world::Voxel::set_face_cache(VoxelFace face, std::size_t offset, std::size_t plane)
+void Voxel::set_face_cache(VoxelFace face, std::size_t offset, std::size_t plane)
{
assert(face < m_cached_face_offsets.size());
assert(face < m_cached_face_planes.size());
@@ -55,7 +55,7 @@ void world::Voxel::set_face_cache(VoxelFace face, std::size_t offset, std::size_
m_cached_face_planes[face] = plane;
}
-std::uint64_t world::Voxel::get_checksum(std::uint64_t combine) const
+std::uint64_t Voxel::get_checksum(std::uint64_t combine) const
{
combine = math::crc64(m_name.data(), m_name.size(), combine);
combine += static_cast<std::uint64_t>(m_shape);
@@ -63,76 +63,76 @@ std::uint64_t world::Voxel::get_checksum(std::uint64_t combine) const
return combine;
}
-world::VoxelBuilder::VoxelBuilder(std::string_view name)
+VoxelBuilder::VoxelBuilder(std::string_view name)
{
set_name(name);
}
-void world::VoxelBuilder::set_on_place(VoxelOnPlaceFunc func) noexcept
+void VoxelBuilder::set_on_place(VoxelOnPlaceFunc func) noexcept
{
m_on_place = std::move(func);
}
-void world::VoxelBuilder::set_on_remove(VoxelOnRemoveFunc func) noexcept
+void VoxelBuilder::set_on_remove(VoxelOnRemoveFunc func) noexcept
{
m_on_remove = std::move(func);
}
-void world::VoxelBuilder::set_on_tick(VoxelOnTickFunc func) noexcept
+void VoxelBuilder::set_on_tick(VoxelOnTickFunc func) noexcept
{
m_on_tick = std::move(func);
}
-void world::VoxelBuilder::set_name(std::string_view name) noexcept
+void VoxelBuilder::set_name(std::string_view name) noexcept
{
assert(name.size());
m_name = name;
}
-void world::VoxelBuilder::set_render_mode(VoxelRender mode) noexcept
+void VoxelBuilder::set_render_mode(VoxelRender mode) noexcept
{
m_render_mode = mode;
}
-void world::VoxelBuilder::set_shape(VoxelShape shape) noexcept
+void VoxelBuilder::set_shape(VoxelShape shape) noexcept
{
m_shape = shape;
}
-void world::VoxelBuilder::set_animated(bool animated) noexcept
+void VoxelBuilder::set_animated(bool animated) noexcept
{
m_animated = animated;
}
-void world::VoxelBuilder::set_touch_type(VoxelTouch type) noexcept
+void VoxelBuilder::set_touch_type(VoxelTouch type) noexcept
{
m_touch_type = type;
}
-void world::VoxelBuilder::set_touch_values(const glm::fvec3& values) noexcept
+void VoxelBuilder::set_touch_values(const glm::fvec3& values) noexcept
{
m_touch_values = values;
}
-void world::VoxelBuilder::set_surface_material(VoxelMaterial material) noexcept
+void VoxelBuilder::set_surface_material(VoxelMaterial material) noexcept
{
m_surface_material = material;
}
-void world::VoxelBuilder::set_collision(const math::AABBf& box) noexcept
+void VoxelBuilder::set_collision(const math::AABBf& box) noexcept
{
m_collision = box;
}
-void world::VoxelBuilder::add_default_texture(std::string_view path)
+void VoxelBuilder::add_default_texture(std::string_view path)
{
assert(path.size());
m_default_textures.emplace_back(path);
}
-void world::VoxelBuilder::add_face_texture(VoxelFace face, std::string_view path)
+void VoxelBuilder::add_face_texture(VoxelFace face, std::string_view path)
{
assert(face < m_face_textures.size());
assert(path.size());
@@ -140,7 +140,7 @@ void world::VoxelBuilder::add_face_texture(VoxelFace face, std::string_view path
m_face_textures[face].emplace_back(path);
}
-std::unique_ptr<world::Voxel> world::VoxelBuilder::build(voxel_id id) const
+std::unique_ptr<Voxel> VoxelBuilder::build(voxel_id id) const
{
assert(m_name.size());
assert(id);