Skip to content

Commit 82104c5

Browse files
committed
Merge branch 'master' into visiting-visitors
2 parents ecfd11c + 3d02cfc commit 82104c5

File tree

336 files changed

+7616
-8416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+7616
-8416
lines changed

.circleci/config.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
version: 2.1
2+
3+
executors:
4+
rust-nightly-executor:
5+
docker:
6+
- image: rustlang/rust:nightly
7+
rust-executor:
8+
docker:
9+
- image: rust:latest
10+
11+
12+
jobs:
13+
check-fmt:
14+
executor: rust-executor
15+
steps:
16+
- checkout
17+
- run:
18+
name: install rustfmt
19+
command: rustup component add rustfmt
20+
- run:
21+
name: check formatting
22+
command: cargo fmt -- --check
23+
build-native:
24+
executor: rust-executor
25+
steps:
26+
- checkout
27+
- run:
28+
name: build ncollide2d
29+
command: cargo build --verbose -p ncollide2d;
30+
- run:
31+
name: build ncollide3d
32+
command: cargo build --verbose -p ncollide3d;
33+
- run:
34+
name: test ncollide2d
35+
command: cargo test --verbose -p ncollide2d;
36+
- run:
37+
name: test ncollide3d
38+
command: cargo test --verbose -p ncollide3d;
39+
build-wasm:
40+
executor: rust-executor
41+
steps:
42+
- checkout
43+
- run:
44+
name: install cargo-web
45+
command: cargo install -f cargo-web;
46+
- run:
47+
name: build ncollide2d
48+
command: cd build/ncollide2d && cargo web build --verbose --target wasm32-unknown-unknown;
49+
- run:
50+
name: build ncollide3d
51+
command: cd build/ncollide3d && cargo web build --verbose --target wasm32-unknown-unknown;
52+
bench-native:
53+
executor: rust-nightly-executor
54+
steps:
55+
- checkout
56+
- run:
57+
name: bench ncollide2d
58+
command: cargo bench
59+
60+
61+
workflows:
62+
version: 2
63+
build:
64+
jobs:
65+
- check-fmt
66+
- build-native:
67+
requires:
68+
- check-fmt
69+
- build-wasm:
70+
requires:
71+
- check-fmt
72+
- bench-native:
73+
requires:
74+
- build-native

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [ "sebcrozet" ] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: sebcrozet # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.travis.payload/CSFML-2.1-CMAKE.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis.payload/install-dependencies.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = [ "build/ncollide2d", "build/ncollide3d" ] #, "ncollide_testbed2d", "ncollide_testbed3d" ]
2+
members = [ "build/ncollide2d", "build/ncollide3d" ]
33

44
[patch.crates-io]
55
ncollide2d = { path = "./build/ncollide2d" }

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Simply add one the following (or both) to your `Cargo.toml` file:
3232

3333
```
3434
[dependencies]
35-
ncollide2d = "0.19" # For 2D collision detection.
36-
ncollide3d = "0.19" # For 3D collision detection.
35+
ncollide2d = "0.22" # For 2D collision detection.
36+
ncollide3d = "0.22" # For 3D collision detection.
3737
```
3838

3939

build/ncollide2d/Cargo.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ncollide2d"
3-
version = "0.19.2"
3+
version = "0.22.0"
44
authors = [ "Sébastien Crozet <[email protected]>" ]
55

66
description = "2 and 3-dimensional collision detection library in Rust."
@@ -23,15 +23,18 @@ path = "../../src/lib.rs"
2323
required-features = [ "dim2" ]
2424

2525
[dependencies]
26-
either = "1.0"
27-
bitflags = "1.0"
28-
downcast-rs = "1.0"
26+
either = "1"
27+
bitflags = "1"
28+
downcast-rs = "1"
2929
num-traits = { version = "0.2", default-features = false }
30-
smallvec = "0.6"
30+
smallvec = "1"
3131
slab = "0.4"
32-
petgraph = "0.4"
32+
slotmap = "0.4"
33+
petgraph = "0.5"
3334
alga = "0.9"
34-
nalgebra = "0.18"
35+
nalgebra = "0.20"
3536
approx = { version = "0.3", default-features = false }
36-
rand = { version = "0.6", default-features = false }
37-
serde = { version = "1.0", optional = true, features = ["derive"]}
37+
serde = { version = "1.0", optional = true, features = ["derive"]}
38+
39+
[dev-dependencies]
40+
rand = { version = "0.7", default-features = false }
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
extern crate nalgebra as na;
2-
extern crate ncollide2d;
3-
4-
use ncollide2d::broad_phase::BroadPhasePairFilter;
5-
use ncollide2d::shape::{Ball, ShapeHandle};
6-
use ncollide2d::world::{CollisionGroups, CollisionObject, CollisionWorld, GeometricQueryType};
7-
8-
struct ParityFilter;
9-
10-
impl BroadPhasePairFilter<f32, ()> for ParityFilter {
11-
fn is_pair_valid(&self, b1: &CollisionObject<f32, ()>, b2: &CollisionObject<f32, ()>) -> bool {
12-
b1.handle().uid() % 2 == b2.handle().uid() % 2
13-
}
14-
}
1+
//extern crate nalgebra as na;
2+
//extern crate ncollide2d;
3+
//
4+
//use ncollide2d::broad_phase::BroadPhasePairFilter;
5+
//use ncollide2d::shape::{Ball, ShapeHandle};
6+
//use ncollide2d::world::{CollisionGroups, CollisionObject, CollisionWorld, GeometricQueryType};
7+
//
8+
//struct ParityFilter;
9+
//
10+
//impl BroadPhasePairFilter<f32, ()> for ParityFilter {
11+
// fn is_pair_valid(&self, b1: &CollisionObject<f32, ()>, b2: &CollisionObject<f32, ()>) -> bool {
12+
// b1.handle().uid() % 2 == b2.handle().uid() % 2
13+
// }
14+
//}
1515

1616
fn main() {
17-
let shape = ShapeHandle::new(Ball::new(0.5f32));
18-
let groups = CollisionGroups::new();
19-
let query = GeometricQueryType::Contacts(0.0, 0.0);
20-
21-
let mut world = CollisionWorld::new(0.02);
22-
23-
world.register_broad_phase_pair_filter("Parity filter", ParityFilter);
24-
25-
world.add(na::one(), shape.clone(), groups, query, ());
26-
world.add(na::one(), shape.clone(), groups, query, ());
27-
world.add(na::one(), shape.clone(), groups, query, ());
28-
world.add(na::one(), shape.clone(), groups, query, ());
29-
30-
world.update();
31-
32-
// There will be only 2 contact pairs instead of 6.
33-
assert!(world.contact_pairs(true).count() == 2);
17+
// let shape = ShapeHandle::new(Ball::new(0.5f32));
18+
// let groups = CollisionGroups::new();
19+
// let query = GeometricQueryType::Contacts(0.0, 0.0);
20+
//
21+
// let mut world = CollisionWorld::new(0.02);
22+
//
23+
// world.register_broad_phase_pair_filter("Parity filter", ParityFilter);
24+
//
25+
// world.add(na::one(), shape.clone(), groups, query, ());
26+
// world.add(na::one(), shape.clone(), groups, query, ());
27+
// world.add(na::one(), shape.clone(), groups, query, ());
28+
// world.add(na::one(), shape.clone(), groups, query, ());
29+
//
30+
// world.update();
31+
//
32+
// // There will be only 2 contact pairs instead of 6.
33+
// assert!(world.contact_pairs(true).count() == 2);
3434
}

build/ncollide2d/examples/dbvt_broad_phase2d.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ extern crate nalgebra as na;
22
extern crate ncollide2d;
33

44
use na::{Isometry2, Vector2};
5-
use ncollide2d::shape::Ball;
65
use ncollide2d::bounding_volume;
76
use ncollide2d::broad_phase::{BroadPhase, BroadPhaseInterferenceHandler, DBVTBroadPhase};
7+
use ncollide2d::shape::Ball;
88

99
struct InterferenceHandler;
1010

@@ -14,11 +14,9 @@ impl BroadPhaseInterferenceHandler<i32> for InterferenceHandler {
1414
*a != *b
1515
}
1616

17-
fn interference_started(&mut self, _: &i32, _: &i32) {
18-
}
17+
fn interference_started(&mut self, _: &i32, _: &i32) {}
1918

20-
fn interference_stopped(&mut self, _: &i32, _: &i32) {
21-
}
19+
fn interference_stopped(&mut self, _: &i32, _: &i32) {}
2220
}
2321

2422
fn main() {

0 commit comments

Comments
 (0)