mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
move sensors clearing to the top
This commit is contained in:
parent
bbd9e7065c
commit
cae5a4cdf6
1 changed files with 2 additions and 3 deletions
|
|
@ -295,15 +295,14 @@ void Entities::preparePhysics(float delta) {
|
||||||
auto& physics = *level.physics;
|
auto& physics = *level.physics;
|
||||||
auto& hitboxes = physics.getHitboxesWriteable();
|
auto& hitboxes = physics.getHitboxesWriteable();
|
||||||
auto& solidHitboxes = physics.getSolidHitboxesWriteable();
|
auto& solidHitboxes = physics.getSolidHitboxesWriteable();
|
||||||
|
auto& sensors = physics.getSensorsWriteable();
|
||||||
|
sensors.clear();
|
||||||
|
|
||||||
if (int parts = sensorsTickClock.update(delta)) {
|
if (int parts = sensorsTickClock.update(delta)) {
|
||||||
for (int i = 0; i < parts; i++) {
|
for (int i = 0; i < parts; i++) {
|
||||||
auto part = sensorsTickClock.convertPart(i);
|
auto part = sensorsTickClock.convertPart(i);
|
||||||
auto allParts = sensorsTickClock.getParts();
|
auto allParts = sensorsTickClock.getParts();
|
||||||
|
|
||||||
auto& sensors = physics.getSensorsWriteable();
|
|
||||||
sensors.clear();
|
|
||||||
|
|
||||||
auto view = registry->view<EntityId, Transform, Rigidbody>();
|
auto view = registry->view<EntityId, Transform, Rigidbody>();
|
||||||
for (auto [entity, eid, transform, rigidbody] : view.each()) {
|
for (auto [entity, eid, transform, rigidbody] : view.each()) {
|
||||||
if (!rigidbody.enabled) {
|
if (!rigidbody.enabled) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue