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

Rewrite physics API to privatize rapier3d/nalgebra dependencies #99

Merged
merged 5 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ renderdoc = "0.11"
# This is too slow in Debug
[profile.dev.package.texpresso]
opt-level = 3

[package.metadata.cargo_check_external_types]
#TODO: reconsider `egui`/`epaint` and `winit` here
allowed_external_types = ["egui::*", "epaint::*", "mint::*", "profiling::*", "serde::*", "winit::*"]
3 changes: 3 additions & 0 deletions blade-asset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ bytemuck = { workspace = true }
choir = { workspace = true }
log = { workspace = true }
profiling = { workspace = true }

[package.metadata.cargo_check_external_types]
allowed_external_types = ["choir::*"]
2 changes: 2 additions & 0 deletions blade-asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ enum InvalidDependency {
enum CookReason {
NoTarget,
BadHeader,
#[allow(dead_code)]
TooManyDependencies(usize),
#[allow(dead_code)]
Dependency(usize, InvalidDependency),
Outdated,
WrongDataOffset,
Expand Down
3 changes: 3 additions & 0 deletions blade-egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ blade-macros = { version = "0.2", path = "../blade-macros"}
bytemuck = { workspace = true }
egui = { workspace = true, features = ["bytemuck"] }
profiling = { workspace = true }

[package.metadata.cargo_check_external_types]
allowed_external_types = ["blade_graphics::*", "epaint::*"]
1 change: 1 addition & 0 deletions blade-egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct Locals {
r_texture: blade_graphics::TextureView,
}

#[derive(Debug, PartialEq)]
pub struct ScreenDescriptor {
pub physical_size: (u32, u32),
pub scale_factor: f32,
Expand Down
3 changes: 3 additions & 0 deletions blade-graphics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ libloading = { version = "0.8" }
wasm-bindgen = "0.2.83"
web-sys = { workspace = true, features = ["HtmlCanvasElement", "WebGl2RenderingContext"] }
js-sys = "0.3.60"

[package.metadata.cargo_check_external_types]
allowed_external_types = ["bitflags::*", "mint::*", "naga::*", "raw_window_handle::*"]
7 changes: 0 additions & 7 deletions blade-graphics/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,6 @@ impl Buffer {
unsafe impl Send for Buffer {}
unsafe impl Sync for Buffer {}

#[derive(Clone, Copy, Debug, PartialEq)]
struct BlockInfo {
bytes: u8,
width: u8,
height: u8,
}

#[derive(Clone, Copy, Debug, Hash, PartialEq)]
pub struct Texture {
raw: vk::Image,
Expand Down
3 changes: 3 additions & 0 deletions blade-render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ zune-jpeg = { version = "0.4", optional = true }
zune-png = { version = "0.4", optional = true }
zune-hdr = { version = "0.4", optional = true }
zune-imageprocs = { version = "0.4", optional = true }

[package.metadata.cargo_check_external_types]
allowed_external_types = ["bitflags::*", "blade_asset::*", "blade_graphics::*", "bytemuck::*", "choir::*", "epaint::*", "mint::*", "strum::*"]
16 changes: 0 additions & 16 deletions blade-render/src/render/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ pub struct DebugLine {
pub b: DebugPoint,
}

#[repr(C)]
#[derive(Clone, Copy, bytemuck::Zeroable, bytemuck::Pod)]
struct DebugLineParams {
target_offset: [f32; 2],
target_size: [f32; 2],
mip_level: f32,
unused: u32,
}

#[derive(blade_macros::ShaderData)]
struct DebugLinedata {
input: blade_graphics::TextureView,
output: blade_graphics::Sampler,
params: DebugBlitParams,
}

#[derive(blade_macros::ShaderData)]
struct DebugDrawData {
camera: super::CameraParams,
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Changelog for Blade

## blade-0.2 (TBD)
- high-level engine
- built-in physics via Rapier3D
- support object motion
- support clockwise mesh winding

Expand Down
Binary file added examples/vehicle/data/ground.bin
Binary file not shown.
Binary file removed examples/vehicle/data/ground.glb
Binary file not shown.
Loading
Loading