add core:mob component & move player movement to scripting

This commit is contained in:
MihailRis 2025-08-10 22:55:34 +03:00
parent 67ef84d6b0
commit dfb83f6835
10 changed files with 132 additions and 100 deletions

View file

@ -297,7 +297,9 @@ void Entities::updatePhysics(float delta) {
int substeps = static_cast<int>(delta * vel * 20);
substeps = std::min(100, std::max(2, substeps));
physics->step(*level.chunks, hitbox, delta, substeps, eid.uid);
hitbox.linearDamping = hitbox.grounded * 24;
hitbox.friction = glm::abs(hitbox.gravityScale <= 1e-7f)
? 8.0f
: (!grounded ? 2.0f : 10.0f);
transform.setPos(hitbox.position);
if (hitbox.grounded && !grounded) {
scripting::on_entity_grounded(