-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25dd7ad
commit 67c78c0
Showing
24 changed files
with
258 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ authors = ["Duncan <[email protected]>"] | |
edition = "2018" | ||
|
||
[profile.release] | ||
lto = true | ||
lto = "thin" | ||
|
||
[profile.dev] | ||
opt-level = 2 | ||
|
@@ -32,8 +32,9 @@ thread_profiler = { version = "0.3", optional = true } | |
[dependencies.building-blocks] | ||
# version = "0.2" | ||
git = "https://github.com/bonsairobo/building-blocks" | ||
branch = "main" | ||
features = ["mesh", "mint", "ncollide", "partition", "search"] | ||
rev = "bb9634c" | ||
# branch = "main" | ||
features = ["mesh", "mint", "ncollide", "search"] | ||
|
||
[features] | ||
profiler = ["thread_profiler", "thread_profiler/thread_profiler"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cargo run --release --features="amethyst/vulkan,amethyst/no-slow-safety-checks" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
use crate::voxel::{Voxel, VoxelMap}; | ||
use crate::voxel::{LocalVoxelCache, VoxelMap}; | ||
|
||
pub mod floor_translation; | ||
|
||
use building_blocks::{ | ||
partition::{Octree, OctreeDBVT}, | ||
prelude::*, | ||
}; | ||
use building_blocks::{prelude::*, search::OctreeDbvt, storage::OctreeSet}; | ||
|
||
pub type VoxelBVT = OctreeDBVT<Point3i>; | ||
pub type VoxelBVT = OctreeDbvt<Point3i>; | ||
|
||
pub fn insert_all_chunk_bvts( | ||
bvt: &mut VoxelBVT, | ||
voxel_map: &VoxelMap, | ||
chunk_cache: &LocalChunkCache3<Voxel>, | ||
chunk_cache: &LocalVoxelCache, | ||
) { | ||
for chunk_key in voxel_map.voxels.chunk_keys() { | ||
let chunk = voxel_map.voxels.get_chunk(*chunk_key, chunk_cache).unwrap(); | ||
let chunk_infos = TransformMap::new(&chunk.array, voxel_map.voxel_info_transform()); | ||
let octree = Octree::from_array3(&chunk_infos, *chunk_infos.extent()); | ||
let reader = voxel_map.voxels.reader(chunk_cache); | ||
for &chunk_key in voxel_map.voxels.storage().chunk_keys() { | ||
let chunk = reader.get_chunk(chunk_key).unwrap(); | ||
let chunk_infos = TransformMap::new(chunk, voxel_map.voxel_info_transform()); | ||
let octree = OctreeSet::from_array3(&chunk_infos, *chunk_infos.extent()); | ||
if octree.is_empty() { | ||
bvt.remove(chunk_key); | ||
bvt.remove(&chunk_key.minimum); | ||
} else { | ||
bvt.insert(*chunk_key, octree); | ||
bvt.insert(chunk_key.minimum, octree); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.