Skip to content

Commit

Permalink
fix various issues in snap to road
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Jul 13, 2024
1 parent 2dbcfa4 commit edd1c0e
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 184 deletions.
16 changes: 13 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ yakui-wgpu = { git = "https://github.com/Uriopass/yakui", branch = "dev" }
yakui-winit = { git = "https://github.com/Uriopass/yakui", branch = "dev" }
yakui-core = { git = "https://github.com/Uriopass/yakui", branch = "dev" }
yakui-widgets = { git = "https://github.com/Uriopass/yakui", branch = "dev" }

itertools = { version = "0.13.0", default-features = false }
mlua = { version = "0.9.4", features = ["luau"] }

# Set the settings for build scripts and proc-macros.
Expand Down
2 changes: 1 addition & 1 deletion engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bytemuck = "1.7.2"
image = { version = "0.25.1", default-features = false, features = ["png"] }
log = "0.4.11"
gltf = { version = "1.2.0", default-features=false, features=["import", "utils", "names", "extensions", "extras"] }
itertools = { version = "0.12.0", default-features = false }
itertools = { workspace = true }
profiling = { version = "1.0.1", default-features = false }
rayon = "1.6"
beul = "1.0.0"
Expand Down
7 changes: 7 additions & 0 deletions geom/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ impl Line {
Self { src, dst }
}

pub fn new_dir(src: Vec2, dir: Vec2) -> Self {
Self {
src,
dst: src + dir,
}
}

pub fn intersection_point(&self, other: &Self) -> Option<Vec2> {
// see https://stackoverflow.com/a/565282
let r = self.vec();
Expand Down
2 changes: 2 additions & 0 deletions geom/src/polyline3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ impl PolyLine3 {
}

#[inline]
/// Gives the direction pointing inward the polyline at the first point
pub fn first_dir(&self) -> Option<Vec3> {
if self.points.len() >= 2 {
(self[1] - self[0]).try_normalize()
Expand All @@ -291,6 +292,7 @@ impl PolyLine3 {
}

#[inline]
/// Gives the direction pointing outward the polyline at the last point
pub fn last_dir(&self) -> Option<Vec3> {
let l = self.points.len();
if l >= 2 {
Expand Down
1 change: 1 addition & 0 deletions native_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ slotmapd = { version = "1.0", default-features = false }
rayon = "1.6"
profiling = { version = "1.0.8", default-features = false }
include_dir = "0.7.2"
itertools = { workspace = true }

[features]
default = []
Expand Down
Loading

0 comments on commit edd1c0e

Please sign in to comment.