diff --git a/Cargo.toml b/Cargo.toml index 6e1b9597..06e3eb8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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", @@ -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", @@ -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", diff --git a/src/render/chunk.rs b/src/render/chunk.rs index d84ba2ab..a375ab96 100644 --- a/src/render/chunk.rs +++ b/src/render/chunk.rs @@ -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( diff --git a/src/render/extract.rs b/src/render/extract.rs index a65fe10d..e69d2014 100644 --- a/src/render/extract.rs +++ b/src/render/extract.rs @@ -1,3 +1,4 @@ +use bevy::math::Affine3A; use bevy::prelude::Res; use bevy::prelude::Time; use bevy::render::primitives::{Aabb, Frustum}; @@ -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) } }