mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add core:mob component & move player movement to scripting
This commit is contained in:
parent
67ef84d6b0
commit
dfb83f6835
10 changed files with 132 additions and 100 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue