#CustomPhysicsBodyTags and CollisionFilter

1 messages · Page 1 of 1 (latest)

gilded ruin
#

Sorry im too dumb to get the releation if there is any at all.
Does the CollisionFilter consider the "CustomPhysicsBodyTags" set in the character controller or is "CollidesWith" a other property?
I would like to calculate the distance from one entitiy to another with a specific Tag but I dont get it to work.

novel sundial
#

CustomPhysicsBodyTags are really just extra data you can attach to physics objects to avoid lookups

#

the actual collision filter code is shown here

#
public static bool IsCollisionEnabled(CollisionFilter filterA, CollisionFilter filterB)
{
    if (filterA.GroupIndex > 0 && filterA.GroupIndex == filterB.GroupIndex)
    {
        return true;
    }
    if (filterA.GroupIndex < 0 && filterA.GroupIndex == filterB.GroupIndex)
    {
        return false;
    }
    return
        (filterA.BelongsTo & filterB.CollidesWith) != 0 &&
        (filterB.BelongsTo & filterA.CollidesWith) != 0;
}```
gilded ruin
#

Hi thanks for reply. Okay so just like it says: a tag 😄