mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'mass' and 'elasticity' entity properties
This commit is contained in:
parent
f945719d7a
commit
ad32d7b6db
5 changed files with 20 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include <glm/ext/matrix_transform.hpp>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
|
||||
static debug::Logger logger("entities");
|
||||
|
|
@ -318,6 +319,9 @@ void Entities::preparePhysics(float delta) {
|
|||
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