Skip to content

Commit

Permalink
feat: adding ignoreTags property to PhysicalEntity (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtome authored Nov 24, 2024
1 parent 3df41be commit 0d98a00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ class CollisionDetectionBehavior extends PhysicalBehavior
final physicals = leapWorld.physicals.where(
(p) =>
p != parent &&
p.tags.intersection(parent.ignoreTags).isEmpty &&
p.statuses
.where((s) => s is IgnoredByWorld || s is IgnoredByCollisions)
.isEmpty,
Expand Down
3 changes: 3 additions & 0 deletions packages/leap/lib/src/entities/physical_entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ abstract class PhysicalEntity extends PositionedEntity {
/// normal physics engine / collision detection calculations.
final Set<String> solidTags = {};

/// Which other entities to ignore during collision detection.
final Set<String> ignoreTags = {};

/// When this is considered solid, phase through from above
bool isSolidFromTop = true;

Expand Down

0 comments on commit 0d98a00

Please sign in to comment.