pub struct ContactVisualizer {
pub contacts: Vec<ContactPoint>,
pub show_normals: bool,
pub show_impulses: bool,
pub show_penetration: bool,
pub normal_length: f32,
pub impulse_scale: f32,
pub contact_sphere_radius: f32,
pub color_by_depth: bool,
pub color_no_contact: Vec4,
pub color_shallow: Vec4,
pub color_deep: Vec4,
pub max_display_contacts: usize,
}Fields§
§contacts: Vec<ContactPoint>§show_normals: bool§show_impulses: bool§show_penetration: bool§normal_length: f32§impulse_scale: f32§contact_sphere_radius: f32§color_by_depth: bool§color_no_contact: Vec4§color_shallow: Vec4§color_deep: Vec4§max_display_contacts: usizeImplementations§
Source§impl ContactVisualizer
impl ContactVisualizer
pub fn new() -> Self
pub fn add_contact(&mut self, contact: ContactPoint)
pub fn update(&mut self, dt: f32)
pub fn clear(&mut self)
Sourcepub fn depth_color(&self, depth: f32, max_depth: f32) -> Vec4
pub fn depth_color(&self, depth: f32, max_depth: f32) -> Vec4
Compute color for a contact point based on penetration depth
Sourcepub fn generate_debug_lines(&self) -> Vec<(Vec3, Vec3, Vec4)>
pub fn generate_debug_lines(&self) -> Vec<(Vec3, Vec3, Vec4)>
Generate debug lines for all contacts
Sourcepub fn contact_sphere_positions(&self) -> Vec<(Vec3, Vec4, f32)>
pub fn contact_sphere_positions(&self) -> Vec<(Vec3, Vec4, f32)>
Generate sphere positions for contact point indicators
pub fn stats(&self) -> ContactStats
Trait Implementations§
Source§impl Clone for ContactVisualizer
impl Clone for ContactVisualizer
Auto Trait Implementations§
impl Freeze for ContactVisualizer
impl RefUnwindSafe for ContactVisualizer
impl Send for ContactVisualizer
impl Sync for ContactVisualizer
impl Unpin for ContactVisualizer
impl UnsafeUnpin for ContactVisualizer
impl UnwindSafe for ContactVisualizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.