mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Merge branch 'main' into animation
This commit is contained in:
commit
ab3c1e1b0c
14 changed files with 56 additions and 15 deletions
|
|
@ -181,9 +181,10 @@ std::optional<Entities::RaycastResult> Entities::rayCast(
|
|||
glm::ivec3 foundNormal;
|
||||
|
||||
for (auto [entity, eid, transform, body] : view.each()) {
|
||||
const auto& hitbox = body.hitbox;
|
||||
if (eid.uid == settings.ignoredUid || !body.enabled ||
|
||||
(settings.solidEntitiesOnly && !eid.def.solid) ||
|
||||
(!eid.def.selectable && !settings.includeNonSelectable)) {
|
||||
(!hitbox.selectable && !settings.includeNonSelectable)) {
|
||||
continue;
|
||||
}
|
||||
if (settings.entitiesFilter) {
|
||||
|
|
@ -193,7 +194,6 @@ std::optional<Entities::RaycastResult> Entities::rayCast(
|
|||
continue;
|
||||
}
|
||||
}
|
||||
const auto& hitbox = body.hitbox;
|
||||
glm::ivec3 normal;
|
||||
double distance;
|
||||
if (ray.intersectAABB(
|
||||
|
|
@ -336,6 +336,7 @@ void Entities::preparePhysics(float delta) {
|
|||
? rigidbody.mass
|
||||
: std::numeric_limits<float>::infinity();
|
||||
rigidbody.hitbox.elasticity = rigidbody.elasticity;
|
||||
rigidbody.hitbox.selectable = rigidbody.selectable;
|
||||
hitboxes.emplace_back(&rigidbody.hitbox);
|
||||
if (!eid.def.solid) {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue