(&self)
| 23 | } |
| 24 | |
| 25 | pub fn radius(&self) -> f32 { |
| 26 | let c = self.center(); |
| 27 | let dx = self.aabb_max[0] - c[0]; |
| 28 | let dy = self.aabb_max[1] - c[1]; |
| 29 | let dz = self.aabb_max[2] - c[2]; |
| 30 | (dx * dx + dy * dy + dz * dz).sqrt() |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | pub fn load_glb<P: AsRef<Path>>(path: P) -> Result<MeshData, String> { |