Skip to content

Commit

Permalink
add a Debug impl for SharedShape
Browse files Browse the repository at this point in the history
  • Loading branch information
whatf0xx authored and sebcrozet committed Mar 24, 2024
1 parent 49d2d07 commit 1be67e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/shape/shared_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ use crate::shape::ConvexPolygon;
use crate::shape::DeserializableTypedShape;
use crate::shape::{
Ball, Capsule, Compound, Cuboid, HalfSpace, HeightField, Polyline, RoundShape, Segment, Shape,
TriMesh, TriMeshFlags, Triangle,
TriMesh, TriMeshFlags, Triangle, ShapeType
};
#[cfg(feature = "dim3")]
use crate::shape::{Cone, ConvexPolyhedron, Cylinder};
use crate::transformation::vhacd::{VHACDParameters, VHACD};
use na::Unit;
use std::ops::Deref;
use std::sync::Arc;
use std::fmt;

/// The shape of a collider.
#[derive(Clone)]
Expand All @@ -31,6 +32,13 @@ impl AsRef<dyn Shape> for SharedShape {
}
}

impl fmt::Debug for SharedShape {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let shape_type: ShapeType = (*self.0).shape_type();
write!(f, "SharedShape ( Arc<{:?}> )", shape_type)
}
}

impl SharedShape {
/// Wraps the given shape as a shared shape.
pub fn new(shape: impl Shape) -> Self {
Expand Down

0 comments on commit 1be67e5

Please sign in to comment.