Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] physics #23

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
satisfy clippy
  • Loading branch information
meyerzinn committed May 2, 2023
commit 982b94caf7bcb8f063914ba7791fca5fc9fe3e7f
10 changes: 5 additions & 5 deletions src/voxel/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
///! Storage primitives for storing voxel data
/// Storage primitives for storing voxel data
pub mod storage;

///! Utils for managing a voxel world.
/// Utils for managing a voxel world.
mod world;
pub use world::*;

///! Terrain generator.
/// Terrain generator.
pub mod terraingen;

///! Systems and utilities for rendering voxels.
/// Systems and utilities for rendering voxels.
pub mod render;

///! Systems for defining voxel materials with physical properties.
/// Systems for defining voxel materials with physical properties.
pub mod material;

/// rust ports of signed distance field functions for use in world generation.
3 changes: 1 addition & 2 deletions src/voxel/world/physics.rs
Original file line number Diff line number Diff line change
@@ -159,8 +159,7 @@ fn step(

if let Some(collision) = interesting_voxels
.into_iter()
.map(|voxel| swept_voxel_collision(aabb, displacement, voxel_aabb(*voxel)))
.flatten()
.flat_map(|voxel| swept_voxel_collision(aabb, displacement, voxel_aabb(*voxel)))
.min_by(|a, b| {
if a.time < b.time {
Ordering::Less