From fe03f9c66487c0066d666663faf1d1d5c09e9648 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Fri, 10 May 2024 10:18:52 +0200 Subject: [PATCH] Add lost trigger collision group --- src/inflators/rigid-body.ts | 3 +++ src/systems/floaty-object-system.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/inflators/rigid-body.ts b/src/inflators/rigid-body.ts index d68f2d664c..fee7717ffe 100644 --- a/src/inflators/rigid-body.ts +++ b/src/inflators/rigid-body.ts @@ -13,6 +13,7 @@ export enum Type { export enum CollisionGroup { OBJECTS = "objects", ENVIRONMENT = "environment", + TRIGGERS = "triggers", AVATARS = "avatars" } @@ -256,6 +257,7 @@ export enum GLTFRigidBodyType { export enum GLTFRigidBodyCollisionGroup { OBJECTS = "objects", ENVIRONMENT = "environment", + TRIGGERS = "triggers", AVATARS = "avatars", MEDIA_FRAMES = "media-frames" } @@ -270,6 +272,7 @@ const GLTF_DEFAULTS = { const gltfGroupToLayer = { [GLTFRigidBodyCollisionGroup.OBJECTS]: COLLISION_LAYERS.INTERACTABLES, [GLTFRigidBodyCollisionGroup.ENVIRONMENT]: COLLISION_LAYERS.ENVIRONMENT, + [GLTFRigidBodyCollisionGroup.TRIGGERS]: COLLISION_LAYERS.TRIGGERS, [GLTFRigidBodyCollisionGroup.AVATARS]: COLLISION_LAYERS.AVATAR, [GLTFRigidBodyCollisionGroup.MEDIA_FRAMES]: COLLISION_LAYERS.MEDIA_FRAMES } as const; diff --git a/src/systems/floaty-object-system.js b/src/systems/floaty-object-system.js index 24fd720ae5..82db35efc8 100644 --- a/src/systems/floaty-object-system.js +++ b/src/systems/floaty-object-system.js @@ -83,7 +83,7 @@ export const floatyObjectSystem = world => { physicsSystem.updateRigidBody(eid, { gravity: { x: 0, y: 0, z: 0 }, type: "dynamic", - collisionFilterMask: COLLISION_LAYERS.HANDS | COLLISION_LAYERS.MEDIA_FRAMES + collisionFilterMask: COLLISION_LAYERS.HANDS | COLLISION_LAYERS.MEDIA_FRAMES | COLLISION_LAYERS.TRIGGERS }); }); @@ -101,7 +101,7 @@ export const floatyObjectSystem = world => { linearDamping: 0.95, linearSleepingThreshold: 0.1, angularSleepingThreshold: 0.1, - collisionFilterMask: COLLISION_LAYERS.HANDS | COLLISION_LAYERS.MEDIA_FRAMES + collisionFilterMask: COLLISION_LAYERS.HANDS | COLLISION_LAYERS.MEDIA_FRAMES | COLLISION_LAYERS.TRIGGERS }); addComponent(world, MakeStaticWhenAtRest, eid); } else {