Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A project now holds up to 32 named collision layers and a symmetric matrix deciding which ones collide. Every physical object carries a layer, applied as the Bullet broadphase group and mask, so nothing filters collisions today beyond making a body a trigger or disabling it. Layers are edited in Project Settings, picked in the inspector, and both the layer and the matrix are readable and writable from Lua.
Related Issue(s)
Fixes #856
Review Guidance
collision_layer, so renaming is free. A freed slot is reused by the next created layer, and objects left on it join it.PreUpdate, never synchronously. The contact callback reaches Lua insidestepSimulation, so removing a body from the world there would free the collision algorithm in use. Re-entering the world is also what drops the cached broadphase pair, whose manifold would otherwise keep pushing filtered bodies apart.AllFilter, so they keep hitting every layer.StaticFilterexclusion, so static pairs now reach the broadphase and are rejected byneedsCollision, both bodies being inactive. More pairs, same behaviour.collision_layer_<n>andcollision_mask_<n>, left out ofIsProjectSettingsIntegrityVerifiedon purpose : that check wipes every setting when a key is missing. Existing projects keep their settings and start with theDefaultlayer alone, and scenes withoutcollision_layerload on it.Physics.Raycast.Screenshots/GIFs
N/A
AI Usage Disclosure
Refactored code
Checklist