refactor: decouple sim from framework, remove voxel geometry
This commit is contained in:
parent
c538641ec8
commit
5a565844dd
41 changed files with 477 additions and 2407 deletions
|
|
@ -402,23 +402,10 @@ u32 pxl8_net_chunk_id(const pxl8_net* net) {
|
|||
}
|
||||
|
||||
u8 pxl8_net_chunk_type(const pxl8_net* net) {
|
||||
if (!net) return PXL8_CHUNK_TYPE_VXL;
|
||||
if (!net) return PXL8_CHUNK_TYPE_BSP;
|
||||
return net->chunk_type;
|
||||
}
|
||||
|
||||
pxl8_result pxl8_net_send_chunk_settings(pxl8_net* net, i32 render_distance, i32 sim_distance) {
|
||||
if (!net) return PXL8_ERROR_NULL_POINTER;
|
||||
if (!net->connected) return PXL8_ERROR_NOT_CONNECTED;
|
||||
|
||||
pxl8_command_msg cmd = {0};
|
||||
cmd.cmd_type = PXL8_CMD_SET_CHUNK_SETTINGS;
|
||||
pxl8_pack_i32_be(cmd.payload, 0, render_distance);
|
||||
pxl8_pack_i32_be(cmd.payload, 4, sim_distance);
|
||||
cmd.payload_size = 8;
|
||||
|
||||
return pxl8_net_send_command(net, &cmd);
|
||||
}
|
||||
|
||||
pxl8_result pxl8_net_spawn(pxl8_net* net, f32 x, f32 y, f32 z, f32 yaw, f32 pitch) {
|
||||
if (!net) return PXL8_ERROR_NULL_POINTER;
|
||||
if (!net->connected) return PXL8_ERROR_NOT_CONNECTED;
|
||||
|
|
@ -435,28 +422,18 @@ pxl8_result pxl8_net_spawn(pxl8_net* net, f32 x, f32 y, f32 z, f32 yaw, f32 pitc
|
|||
return pxl8_net_send_command(net, &cmd);
|
||||
}
|
||||
|
||||
pxl8_result pxl8_net_exit_chunk(pxl8_net* net, f32 x, f32 y, f32 z) {
|
||||
pxl8_result pxl8_net_enter_scene(pxl8_net* net, u8 chunk_type, u32 chunk_id, f32 x, f32 y, f32 z) {
|
||||
if (!net) return PXL8_ERROR_NULL_POINTER;
|
||||
if (!net->connected) return PXL8_ERROR_NOT_CONNECTED;
|
||||
|
||||
pxl8_command_msg cmd = {0};
|
||||
cmd.cmd_type = PXL8_CMD_EXIT_CHUNK;
|
||||
pxl8_pack_f32_be(cmd.payload, 0, x);
|
||||
pxl8_pack_f32_be(cmd.payload, 4, y);
|
||||
pxl8_pack_f32_be(cmd.payload, 8, z);
|
||||
cmd.payload_size = 12;
|
||||
|
||||
return pxl8_net_send_command(net, &cmd);
|
||||
}
|
||||
|
||||
pxl8_result pxl8_net_enter_chunk(pxl8_net* net, u32 chunk_id) {
|
||||
if (!net) return PXL8_ERROR_NULL_POINTER;
|
||||
if (!net->connected) return PXL8_ERROR_NOT_CONNECTED;
|
||||
|
||||
pxl8_command_msg cmd = {0};
|
||||
cmd.cmd_type = PXL8_CMD_ENTER_CHUNK;
|
||||
cmd.cmd_type = PXL8_CMD_ENTER_SCENE;
|
||||
pxl8_pack_u32_be(cmd.payload, 0, chunk_id);
|
||||
cmd.payload_size = 4;
|
||||
cmd.payload[4] = chunk_type;
|
||||
pxl8_pack_f32_be(cmd.payload, 8, x);
|
||||
pxl8_pack_f32_be(cmd.payload, 12, y);
|
||||
pxl8_pack_f32_be(cmd.payload, 16, z);
|
||||
cmd.payload_size = 20;
|
||||
|
||||
return pxl8_net_send_command(net, &cmd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue