AABB add works on self
@@ -31,10 +31,8 @@ impl AxisAllignedBoundingBox {
aabb
}
- pub fn add(&self, other: &AxisAllignedBoundingBox) -> AxisAllignedBoundingBox {
- return AxisAllignedBoundingBox {
- min: vec3(f32::min(self.min.x, other.min.x), f32::min(self.min.y, other.min.y), f32::min(self.min.z, other.min.z)),
- max: vec3(f32::max(self.max.x, other.max.x), f32::max(self.max.y, other.max.y), f32::max(self.max.z, other.max.z))
- }
+ pub fn add(&mut self, other: &AxisAllignedBoundingBox) {
+ self.min = vec3(f32::min(self.min.x, other.min.x), f32::min(self.min.y, other.min.y), f32::min(self.min.z, other.min.z));
+ self.max = vec3(f32::max(self.max.x, other.max.x), f32::max(self.max.y, other.max.y), f32::max(self.max.z, other.max.z));
}
}
\ No newline at end of file
