Repository navigation
Add the World:getStaticTags() method to retrieve only static tags - #1021
thewizardplusplus wants to merge 1 commit into
Conversation
|
I wonder if |
|
@bjornbytes, I agree that At the same time, I would therefore suggest adding both methods: one for a direct check and the other for retrieving the full configuration. However, if you prefer to keep the public API minimal, we could retain only your proposed |
|
There should probably only be one way to do it. Which one is best for your use case? I lean towards either |
tagsandstaticTagsare passed when creating aWorld. Thetagslist canbe retrieved using
World:getTags(), but there is no corresponding getter forstaticTags.Within a
World, static tags are stored asstaticTagMaskand used to selectthe motion type and broad phase. External ECS and physics libraries need this
information to choose the direction of transform ↔ collider synchronization and
validate their configuration. Keeping a separate copy of
staticTagsalongsidethe
Worldduplicates state and creates a risk of the two getting out of sync.Proposed API
The method returns a new table containing all world tags marked as static. It
complements the existing
World:getTags()method and mirrors the world creationoptions:
staticTagsis effectively a set: the order of its elements and any duplicatesin the input table do not matter.
getStaticTags()returns the correspondingtags in the same relative order in which they appear in
tags. Modifying thereturned table does not affect the
World.