Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Collision events for sensor always firing, PhysicsLayer issue or incorrect setup?? #316

Open
Hellzbellz123 opened this issue Oct 6, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Hellzbellz123
Copy link

i have 4 physics layers in my app, the entitys that can collide have collision layers like below, the player, and the enemys have collision shapes on child entitys, im not sure if its because i have the physics layers organized wrong or if i have some other thing shooting me in the foot, but ive tried quite a few different combos of groups/masks/layers to no real effect. i also noticed that no matter what i do my players/enemys always collide, even when both have CollisionLayers::none() or i mask them out

i took the collision detection event system from the examples to test the sensor and i noticed that my player and skeleton entitys have an obscenely large amount of groups/masks

heres the output from an event reader for collisionevent

Collision started between CollisionData { rigid_body_entity: 2729v0, collision_shape_entity: 2729v0, collision_layers: CollisionLayers { groups: 8, masks: 2 }, normals: [] } and CollisionData { rigid_body_entity: 2812v0, collision_shape_entity: 2813v0, collision_layers: CollisionLayers { groups: 4294967295, masks: 4294967295 }, normals: [] }
Collision stopped between CollisionData { rigid_body_entity: 2729v0, collision_shape_entity: 2729v0, collision_layers: CollisionLayers { groups: 8, masks: 2 }, normals: [] } and CollisionData { rigid_body_entity: 2812v0, collision_shape_entity: 2813v0, collision_layers: CollisionLayers { groups: 4294967295, masks: 4294967295 }, normals: [] }

im marking my Sensor entity with :

collision_layers: CollisionLayers::none()
					.with_group(PhysicsLayers::Sensor)
					.with_mask(PhysicsLayers::Player)

im marking my walls with:

collision_layers: CollisionLayers::none()
                    .with_group(PhysicsLayers::World)
                    .with_masks(&[PhysicsLayers::Player, PhysicsLayers::Enemies])

im spawning my player with:

collisionlayers: CollisionLayers::none()
                    .with_group(PhysicsLayers::Player)

and im marking my enemies with

collisionlayers: CollisionLayers::none()
                                .with_group(PhysicsLayers::Enemies)

physicslayers is my enum for things that can collide

#[derive(PhysicsLayer)]
pub enum PhysicsLayers {
	Sensor,
    World,
    Player,
    Enemies,
}
@Hellzbellz123
Copy link
Author

Hellzbellz123 commented Oct 6, 2022

the actual repo is located here: https://github.com/Hellzbellz123/VanillaCoffee, if any more information would be helpful let me know, im pretty stumped atm, gonna attack it after some sleep

@jcornaz
Copy link
Owner

jcornaz commented Oct 10, 2022

Thanks for the report. It does look like a bug to me.

Sadly, today I decided to discontinue the project. Therefore, I won't investigate this issue myself. But I'll gladly accept a fix, if someone were to provide one.

By the way, this is one of those difficult times i mention in my discontinuation announcement, where it is not clear which is the culprit, heron or rapier? I have a quite good test suite for the layer interactions, so that bug is quite a surprise.

@jcornaz jcornaz added the bug Something isn't working label Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants