From eeec59adabb8c084c8b6b847a31130eb7c37d2ee Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 12 Oct 2023 22:39:29 -0500 Subject: KnockbackEvent and rename Physics::delta to velocity --- azalea-entity/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'azalea-entity/src') diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index 9b673945..bf3dfc82 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -35,7 +35,7 @@ pub fn move_relative( acceleration: &Vec3, ) { let input_vector = input_vector(direction, speed, acceleration); - physics.delta += input_vector; + physics.velocity += input_vector; } pub fn input_vector(direction: &LookDirection, speed: f32, acceleration: &Vec3) -> Vec3 { @@ -208,7 +208,8 @@ pub struct LookDirection { /// bounding box. #[derive(Debug, Component, Clone)] pub struct Physics { - pub delta: Vec3, + /// How fast the entity is moving. + pub velocity: Vec3, /// X acceleration. pub xxa: f32, @@ -232,7 +233,7 @@ pub struct Physics { impl Physics { pub fn new(dimensions: EntityDimensions, pos: &Vec3) -> Self { Self { - delta: Vec3::default(), + velocity: Vec3::default(), xxa: 0., yya: 0., -- cgit v1.2.3