Skip to content

Commit

Permalink
fix lib doc
Browse files Browse the repository at this point in the history
  • Loading branch information
flomonster committed Jan 18, 2023
1 parent 409e3aa commit 1b1bfb7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
//! use kdtree_ray::{AABB, Bounded, KDTree};
//! struct Triangle(Vector3<f32>, Vector3<f32>, Vector3<f32>);
//!
//! // To use the KDtree on an object you need first to implement the BoundingBox trait.
//! impl BoundingBox for Triangle {
//! fn bounding_box(&self) -> AABB {
//! // To use the KDTree on an object you need first to implement the BoundingBox trait.
//! impl Bounded for Triangle {
//! fn bound(&self) -> AABB {
//! let min = Vector3::new(
//! self.0.x.min(self.1.x).min(self.2.x),
//! self.0.y.min(self.1.y).min(self.2.y),
Expand All @@ -42,13 +42,14 @@
//! self.0.y.max(self.1.y).max(self.2.y),
//! self.0.z.max(self.1.z).max(self.2.z),
//! );
//! [min, max]
//! AABB::new(min, max)
//! }
//! }
//!
//! // Kdtree creation
//! let triangles: Vec<Triangle> = vec![/* ... */];
//! let kdtree = KDtree::new(triangles);
//! let triangle = Triangle(Vector3::zero(), Vector3::zero(), Vector3::zero());
//! let triangles: Vec<Triangle> = vec![triangle, /* ... */];
//! let kdtree = KDTree::build(&triangles);
//!
//! // Get a reduced list of triangles that a ray could intersect
//! let ray_origin = Vector3::zero();
Expand Down

0 comments on commit 1b1bfb7

Please sign in to comment.