1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00
azalea/azalea-entity/src/dimensions.rs
mat 0d16f01571
Fluid physics (#199)
* start implementing fluid physics

* Initial implementation of fluid pushing

* different travel function in water

* bubble columns

* jumping in water

* cleanup

* change ultrawarm to be required

* fix for clippy
2025-01-10 16:45:27 -06:00

18 lines
502 B
Rust
Executable file

use azalea_core::{aabb::AABB, position::Vec3};
#[derive(Debug, Default, Clone)]
pub struct EntityDimensions {
pub width: f32,
pub height: f32,
}
impl EntityDimensions {
pub fn make_bounding_box(&self, pos: &Vec3) -> AABB {
let radius = (self.width / 2.0) as f64;
let height = self.height as f64;
AABB {
min: Vec3::new(pos.x - radius, pos.y, pos.z - radius),
max: Vec3::new(pos.x + radius, pos.y + height, pos.z + radius),
}
}
}