interface/mesh: namespace interface -> namespace interface::mesh
This commit is contained in:
parent
b24190810f
commit
1d8c7c8e3f
@ -532,7 +532,7 @@ struct Module: public interface::Module, public voxelworld::Interface
|
||||
return;
|
||||
}
|
||||
// Update collision shape
|
||||
interface::set_voxel_physics_boxes(n, context, *volume,
|
||||
interface::mesh::set_voxel_physics_boxes(n, context, *volume,
|
||||
m_voxel_reg.get());
|
||||
}
|
||||
m_nodes_needing_physics_update.clear();
|
||||
|
@ -146,7 +146,7 @@ struct Module: public interface::Module
|
||||
|
||||
// Load the same model in here and give it to the physics
|
||||
// subsystem so that it can be collided to
|
||||
SharedPtr<Model> model(interface::
|
||||
SharedPtr<Model> model(interface::mesh::
|
||||
create_8bit_voxel_physics_model(context, w, h, d, data,
|
||||
voxel_reg));
|
||||
|
||||
|
@ -36,6 +36,7 @@ using interface::VoxelInstance;
|
||||
using namespace Urho3D;
|
||||
|
||||
namespace interface {
|
||||
namespace mesh {
|
||||
|
||||
// Create a model from a string; eg. (2, 2, 2, "11101111")
|
||||
Model* create_simple_voxel_model(Context *context,
|
||||
@ -942,5 +943,6 @@ z_plane_does_not_fit:
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mesh
|
||||
} // namespace interface
|
||||
// vim: set noet ts=4 sw=4:
|
||||
|
@ -15,47 +15,50 @@ namespace Urho3D
|
||||
|
||||
namespace interface
|
||||
{
|
||||
using namespace Urho3D;
|
||||
namespace pv = PolyVox;
|
||||
namespace mesh
|
||||
{
|
||||
using namespace Urho3D;
|
||||
namespace pv = PolyVox;
|
||||
|
||||
// Create a model from a string; eg. (2, 2, 2, "11101111")
|
||||
Model* create_simple_voxel_model(Context *context, int w, int h, int d,
|
||||
const ss_ &source_data);
|
||||
// Create a model from a string; eg. (2, 2, 2, "11101111")
|
||||
Model* create_simple_voxel_model(Context *context, int w, int h, int d,
|
||||
const ss_ &source_data);
|
||||
|
||||
// Create a model from 8-bit voxel data, using a voxel registry, without
|
||||
// textures or normals, based on the physically_solid flag.
|
||||
// Returns nullptr if there is no geometry
|
||||
Model* create_8bit_voxel_physics_model(Context *context,
|
||||
int w, int h, int d, const ss_ &source_data,
|
||||
VoxelRegistry *voxel_reg);
|
||||
// Create a model from 8-bit voxel data, using a voxel registry, without
|
||||
// textures or normals, based on the physically_solid flag.
|
||||
// Returns nullptr if there is no geometry
|
||||
Model* create_8bit_voxel_physics_model(Context *context,
|
||||
int w, int h, int d, const ss_ &source_data,
|
||||
VoxelRegistry *voxel_reg);
|
||||
|
||||
// Set custom geometry from 8-bit voxel data, using a voxel registry
|
||||
void set_8bit_voxel_geometry(CustomGeometry *cg, Context *context,
|
||||
int w, int h, int d, const ss_ &source_data,
|
||||
VoxelRegistry *voxel_reg, TextureAtlasRegistry *atlas_reg);
|
||||
// Set custom geometry from 8-bit voxel data, using a voxel registry
|
||||
void set_8bit_voxel_geometry(CustomGeometry *cg, Context *context,
|
||||
int w, int h, int d, const ss_ &source_data,
|
||||
VoxelRegistry *voxel_reg, TextureAtlasRegistry *atlas_reg);
|
||||
|
||||
// Create a model from voxel volume, using a voxel registry, without
|
||||
// textures or normals, based on the physically_solid flag.
|
||||
// Returns nullptr if there is no geometry
|
||||
// Volume should be padded by one voxel on each edge
|
||||
// NOTE: volume is non-const due to PolyVox deficiency
|
||||
Model* create_voxel_physics_model(Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume,
|
||||
VoxelRegistry *voxel_reg);
|
||||
// Create a model from voxel volume, using a voxel registry, without
|
||||
// textures or normals, based on the physically_solid flag.
|
||||
// Returns nullptr if there is no geometry
|
||||
// Volume should be padded by one voxel on each edge
|
||||
// NOTE: volume is non-const due to PolyVox deficiency
|
||||
Model* create_voxel_physics_model(Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume,
|
||||
VoxelRegistry *voxel_reg);
|
||||
|
||||
// Set custom geometry from voxel volume, using a voxel registry
|
||||
// Volume should be padded by one voxel on each edge
|
||||
// NOTE: volume is non-const due to PolyVox deficiency
|
||||
void set_voxel_geometry(CustomGeometry *cg, Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume,
|
||||
VoxelRegistry *voxel_reg, TextureAtlasRegistry *atlas_reg);
|
||||
// lod=1 -> 1:1, lod=3 -> 1:3
|
||||
void set_voxel_lod_geometry(int lod, CustomGeometry *cg, Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume_orig,
|
||||
VoxelRegistry *voxel_reg, TextureAtlasRegistry *atlas_reg);
|
||||
// Set custom geometry from voxel volume, using a voxel registry
|
||||
// Volume should be padded by one voxel on each edge
|
||||
// NOTE: volume is non-const due to PolyVox deficiency
|
||||
void set_voxel_geometry(CustomGeometry *cg, Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume,
|
||||
VoxelRegistry *voxel_reg, TextureAtlasRegistry *atlas_reg);
|
||||
// lod=1 -> 1:1, lod=3 -> 1:3
|
||||
void set_voxel_lod_geometry(int lod, CustomGeometry *cg, Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume_orig,
|
||||
VoxelRegistry *voxel_reg, TextureAtlasRegistry *atlas_reg);
|
||||
|
||||
void set_voxel_physics_boxes(Node *node, Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume,
|
||||
VoxelRegistry *voxel_reg);
|
||||
void set_voxel_physics_boxes(Node *node, Context *context,
|
||||
pv::RawVolume<VoxelInstance> &volume,
|
||||
VoxelRegistry *voxel_reg);
|
||||
}
|
||||
}
|
||||
// vim: set noet ts=4 sw=4:
|
||||
|
@ -73,7 +73,7 @@ static int l_set_simple_voxel_model(lua_State *L)
|
||||
Context *context = buildat_app->get_scene()->GetContext();
|
||||
|
||||
SharedPtr<Model> fromScratchModel(
|
||||
interface::create_simple_voxel_model(context, w, h, d, data));
|
||||
interface::mesh::create_simple_voxel_model(context, w, h, d, data));
|
||||
|
||||
StaticModel *object = node->GetOrCreateComponent<StaticModel>();
|
||||
object->SetModel(fromScratchModel);
|
||||
@ -116,7 +116,7 @@ static int l_set_8bit_voxel_geometry(lua_State *L)
|
||||
|
||||
CustomGeometry *cg = node->GetOrCreateComponent<CustomGeometry>();
|
||||
|
||||
interface::set_8bit_voxel_geometry(cg, context, w, h, d, data,
|
||||
interface::mesh::set_8bit_voxel_geometry(cg, context, w, h, d, data,
|
||||
voxel_reg, atlas_reg);
|
||||
|
||||
// Maybe appropriate
|
||||
@ -156,7 +156,7 @@ static int l_set_voxel_geometry(lua_State *L)
|
||||
|
||||
up_<pv::RawVolume<VoxelInstance>> volume = interface::deserialize_volume(data);
|
||||
|
||||
interface::set_voxel_geometry(cg, context, *volume, voxel_reg, atlas_reg);
|
||||
interface::mesh::set_voxel_geometry(cg, context, *volume, voxel_reg, atlas_reg);
|
||||
|
||||
// Maybe appropriate
|
||||
cg->SetOccluder(true);
|
||||
@ -197,7 +197,7 @@ static int l_set_voxel_lod_geometry(lua_State *L)
|
||||
|
||||
up_<pv::RawVolume<VoxelInstance>> volume = interface::deserialize_volume(data);
|
||||
|
||||
interface::set_voxel_lod_geometry(lod, cg, context, *volume,
|
||||
interface::mesh::set_voxel_lod_geometry(lod, cg, context, *volume,
|
||||
voxel_reg, atlas_reg);
|
||||
|
||||
// Maybe appropriate
|
||||
@ -255,7 +255,7 @@ static int l_set_voxel_physics_boxes(lua_State *L)
|
||||
up_<pv::RawVolume<VoxelInstance>> volume = interface::deserialize_volume(data);
|
||||
|
||||
node->GetOrCreateComponent<RigidBody>(LOCAL);
|
||||
interface::set_voxel_physics_boxes(node, context, *volume, voxel_reg);
|
||||
interface::mesh::set_voxel_physics_boxes(node, context, *volume, voxel_reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user