refactor: make cylinders go on the XZ plane by default

This commit is contained in:
Nova
2025-03-19 23:13:49 -07:00
parent 3f4002881c
commit 9bfbade9a2

View File

@@ -184,7 +184,7 @@ impl FieldTrait for Field {
v.length() + q.x.max(q.y.max(q.z)).min(0_f32) v.length() + q.x.max(q.y.max(q.z)).min(0_f32)
} }
Shape::Cylinder(CylinderShape { length, radius }) => { Shape::Cylinder(CylinderShape { length, radius }) => {
let d = vec2(p.xy().length().abs() - radius, p.z.abs() - (length * 0.5)); let d = vec2(p.xz().length().abs() - radius, p.y.abs() - (length * 0.5));
d.x.max(d.y).min(0.0) + d.max(vec2(0.0, 0.0)).length() d.x.max(d.y).min(0.0) + d.max(vec2(0.0, 0.0)).length()
} }
Shape::Sphere(radius) => p.length() - radius, Shape::Sphere(radius) => p.length() - radius,