49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
#include "voxels.h"
|
|
#include <deerith/world/voxels.h>
|
|
|
|
void sandbox::define_voxel_materials()
|
|
{
|
|
// air
|
|
{
|
|
deerith::voxel_material_t voxel_material;
|
|
voxel_material.id = "air";
|
|
voxel_material.material_type = deerith::voxel_material_type_t::AIR;
|
|
|
|
deerith::register_voxel_material(voxel_material);
|
|
}
|
|
|
|
// rock
|
|
{
|
|
deerith::voxel_material_t voxel_material;
|
|
voxel_material.id = "rock";
|
|
voxel_material.material_type = deerith::voxel_material_type_t::SOLID;
|
|
|
|
// textures...
|
|
|
|
deerith::register_voxel_material(voxel_material);
|
|
}
|
|
}
|
|
|
|
void sandbox::define_voxels_types()
|
|
{
|
|
// air
|
|
{
|
|
deerith::voxel_type_t voxel_type;
|
|
voxel_type.is_solid = false;
|
|
voxel_type.id = "air";
|
|
|
|
voxel_type.material_id = deerith::get_voxel_material_id("air");
|
|
deerith::register_voxel_type(voxel_type);
|
|
}
|
|
|
|
// rock
|
|
{
|
|
deerith::voxel_type_t voxel_type;
|
|
voxel_type.is_solid = true;
|
|
voxel_type.id = "rock";
|
|
|
|
voxel_type.material_id = deerith::get_voxel_material_id("rock");
|
|
deerith::register_voxel_type(voxel_type);
|
|
}
|
|
}
|