aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-10-12 22:39:29 -0500
committermat <git@matdoes.dev>2023-10-12 22:39:29 -0500
commiteeec59adabb8c084c8b6b847a31130eb7c37d2ee (patch)
tree6ffa8e6d83ba5d6095062abf06406edf7f10d276 /azalea-entity/src
parent79ad1e93bf6ce2b7c2da6925a7c85b33bb76f154 (diff)
downloadazalea-drasl-eeec59adabb8c084c8b6b847a31130eb7c37d2ee.tar.xz
KnockbackEvent and rename Physics::delta to velocity
Diffstat (limited to 'azalea-entity/src')
-rw-r--r--azalea-entity/src/lib.rs7
1 files changed, 4 insertions, 3 deletions
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.,