Skip to content

Instantly share code, notes, and snippets.

@MichaelShaw
Created July 19, 2017 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelShaw/4057fa515aff0c3277788753cd0bf729 to your computer and use it in GitHub Desktop.
Save MichaelShaw/4057fa515aff0c3277788753cd0bf729 to your computer and use it in GitHub Desktop.
ncollide: Cuboid Cylinder inconsistent case
use nalgebra as na;
use ncollide as nc;
use nalgebra::{Isometry3, Vector3};
use ncollide::shape::{Cuboid, Cylinder};
let cyl = Cylinder::new(0.925, 0.5);
let cyl_at = Isometry3::new(Vector3::new(10.97, 0.925, 61.02), na::zero());
let cuboid = Cuboid::new(Vector3::new(0.05, 0.75, 0.5));
let cuboid_at = Isometry3::new(Vector3::new(11.52, 0.75, 60.5), na::zero());
let distance = nc::query::distance(&cyl_at, &cyl,
&cuboid_at, &cuboid);
let proximity = nc::query::proximity(&cyl_at, &cyl,
&cuboid_at, &cuboid,
0.1);
let contact = nc::query::contact(&cyl_at, &cyl,
&cuboid_at, &cuboid,
10.0);
println!("distance -> {:?}", distance);
println!("proximity -> {:?}", proximity);
println!("contact -> {:?}", contact);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment