Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.
This repository was 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

@Hellzbellz123

Description

@Hellzbellz123

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,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions