Skip to main content

oxiphysics_geometry/implicit_geometry/
sdfboundedproxy_traits.rs

1//! # SdfBoundedProxy - Trait Implementations
2//!
3//! This module contains trait implementations for `SdfBoundedProxy`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Sdf`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11#[allow(unused_imports)]
12use super::functions::*;
13#[allow(unused_imports)]
14use super::functions::*;
15use super::types::SdfBoundedProxy;
16
17impl<S: Sdf> Sdf for SdfBoundedProxy<S> {
18    fn dist(&self, p: [f64; 3]) -> f64 {
19        let bs_dist = len(sub(p, self.bsphere_center)) - self.bsphere_radius;
20        if bs_dist > 0.0 {
21            return bs_dist;
22        }
23        self.inner.dist(p)
24    }
25}