Add cone support.

This commit is contained in:
Crozet Sébastien
2020-10-20 14:16:01 +02:00
parent 865ce8a8e5
commit d513c22d33
15 changed files with 257 additions and 18 deletions

View File

@@ -10,6 +10,7 @@ use crate::objects::mesh::Mesh;
use kiss3d::window::Window;
use na::Point3;
use crate::objects::cone::Cone;
use crate::objects::cylinder::Cylinder;
use rapier::geometry::{ColliderHandle, ColliderSet};
use rapier::math::Isometry;
@@ -30,6 +31,7 @@ pub enum Node {
Mesh(Mesh),
Convex(Convex),
Cylinder(Cylinder),
Cone(Cone),
}
impl Node {
@@ -45,6 +47,7 @@ impl Node {
Node::Mesh(ref mut n) => n.select(),
Node::Convex(ref mut n) => n.select(),
Node::Cylinder(ref mut n) => n.select(),
Node::Cone(ref mut n) => n.select(),
}
}
@@ -60,6 +63,7 @@ impl Node {
Node::Mesh(ref mut n) => n.unselect(),
Node::Convex(ref mut n) => n.unselect(),
Node::Cylinder(ref mut n) => n.unselect(),
Node::Cone(ref mut n) => n.unselect(),
}
}
@@ -75,6 +79,7 @@ impl Node {
Node::Mesh(ref mut n) => n.update(colliders),
Node::Convex(ref mut n) => n.update(colliders),
Node::Cylinder(ref mut n) => n.update(colliders),
Node::Cone(ref mut n) => n.update(colliders),
}
}
@@ -103,6 +108,7 @@ impl Node {
Node::Mesh(ref n) => Some(n.scene_node()),
Node::Convex(ref n) => Some(n.scene_node()),
Node::Cylinder(ref n) => Some(n.scene_node()),
Node::Cone(ref n) => Some(n.scene_node()),
#[cfg(feature = "dim2")]
_ => None,
}
@@ -120,6 +126,7 @@ impl Node {
Node::Mesh(ref mut n) => Some(n.scene_node_mut()),
Node::Convex(ref mut n) => Some(n.scene_node_mut()),
Node::Cylinder(ref mut n) => Some(n.scene_node_mut()),
Node::Cone(ref mut n) => Some(n.scene_node_mut()),
#[cfg(feature = "dim2")]
_ => None,
}
@@ -137,6 +144,7 @@ impl Node {
Node::Mesh(ref n) => n.object(),
Node::Convex(ref n) => n.object(),
Node::Cylinder(ref n) => n.object(),
Node::Cone(ref n) => n.object(),
}
}
@@ -152,6 +160,7 @@ impl Node {
Node::Mesh(ref mut n) => n.set_color(color),
Node::Convex(ref mut n) => n.set_color(color),
Node::Cylinder(ref mut n) => n.set_color(color),
Node::Cone(ref mut n) => n.set_color(color),
}
}
}