Macro pix_engine::shape::sphere

source ·
macro_rules! sphere {
    ($p:expr, $r:expr$(,)?) => { ... };
    ($x:expr, $y:expr, $z:expr, $r:expr$(,)?) => { ... };
}
Expand description

Constructs a Sphere at position (x, y, z) with radius.

let p = point!(10, 20, 10);
let s = sphere!(p, 100);
assert_eq!(s.x(), 10);
assert_eq!(s.y(), 20);
assert_eq!(s.z(), 10);
assert_eq!(s.radius(), 100);

let s = sphere!(10, 20, 10, 100);
assert_eq!(s.x(), 10);
assert_eq!(s.y(), 20);
assert_eq!(s.z(), 10);
assert_eq!(s.radius(), 100);