add mass, elasticity getters, setters to entity.rigidbody

This commit is contained in:
MihailRis 2026-03-14 21:02:02 +03:00
parent 1bba713502
commit bd7f588800
4 changed files with 42 additions and 2 deletions

View file

@ -316,9 +316,9 @@ void Entities::preparePhysics(float delta) {
continue;
}
rigidbody.hitbox.mass = eid.def.bodyType == BodyType::DYNAMIC
? eid.def.mass
? rigidbody.mass
: std::numeric_limits<float>::infinity();
rigidbody.hitbox.elasticity = eid.def.elasticity;
rigidbody.hitbox.elasticity = rigidbody.elasticity;
hitboxes.emplace_back(&rigidbody.hitbox);
if (!eid.def.solid) {
continue;