mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix Entities::preparePhysics
This commit is contained in:
parent
3ea3836f84
commit
436601a5b0
1 changed files with 4 additions and 3 deletions
|
|
@ -315,13 +315,14 @@ void Entities::preparePhysics(float delta) {
|
|||
if (eid.destroyFlag || !rigidbody.enabled) {
|
||||
continue;
|
||||
}
|
||||
rigidbody.hitbox.mass = eid.def.bodyType == BodyType::DYNAMIC
|
||||
? eid.def.mass
|
||||
: std::numeric_limits<float>::infinity();
|
||||
rigidbody.hitbox.elasticity = eid.def.elasticity;
|
||||
hitboxes.emplace_back(&rigidbody.hitbox);
|
||||
if (!eid.def.solid) {
|
||||
continue;
|
||||
}
|
||||
rigidbody.hitbox.mass = eid.def.bodyType == BodyType::DYNAMIC
|
||||
? eid.def.mass
|
||||
: std::numeric_limits<float>::infinity();
|
||||
solidHitboxes.emplace_back(&rigidbody.hitbox);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue