Skip to content

Commit

Permalink
WIP: e8b3892
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Nov 6, 2023
1 parent ac22adb commit 1cc2077
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ atlas = []
render = []

[dependencies]
bevy = { version = "0.11", default-features = false, features = [
bevy = { git = "https://github.com/bevyengine/bevy", rev = "e8b3892", default-features = false, features = [
"bevy_core_pipeline",
"bevy_render",
"bevy_asset",
Expand All @@ -34,7 +34,8 @@ serde_json = { version = "1.0" }
tiled = { version = "0.11.0", default-features = false }

[dev-dependencies.bevy]
version = "0.11"
git = "https://github.com/bevyengine/bevy"
rev = "e8b3892"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -50,7 +51,8 @@ features = [
]

[target.'cfg(unix)'.dev-dependencies.bevy]
version = "0.11"
git = "https://github.com/bevyengine/bevy"
rev = "e8b3892"
default-features = false
features = [
"bevy_core_pipeline",
Expand Down
2 changes: 1 addition & 1 deletion src/render/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl RenderChunk2d {
}

pub fn intersects_frustum(&self, frustum: &ExtractedFrustum) -> bool {
frustum.intersects_obb(&self.aabb, &self.transform_matrix)
frustum.intersects_obb(&self.aabb, &self.global_transform.compute_affine())
}

pub fn update_geometry(
Expand Down
5 changes: 3 additions & 2 deletions src/render/extract.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bevy::math::Affine3A;
use bevy::prelude::Res;
use bevy::prelude::Time;
use bevy::render::primitives::{Aabb, Frustum};
Expand Down Expand Up @@ -174,9 +175,9 @@ pub struct ExtractedFrustum {
}

impl ExtractedFrustum {
pub fn intersects_obb(&self, aabb: &Aabb, transform_matrix: &Mat4) -> bool {
pub fn intersects_obb(&self, aabb: &Aabb, local_to_world: &Affine3A) -> bool {
self.frustum
.intersects_obb(aabb, transform_matrix, true, false)
.intersects_obb(aabb, local_to_world, true, false)
}
}

Expand Down

0 comments on commit 1cc2077

Please sign in to comment.