Skip to content

Commit 07ecec0

Browse files
committed
fix(rapier): auto colliders should still work if physicsColliders is false BUT colliders is set
1 parent 10a9a20 commit 07ecec0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libs/rapier/src/lib/instanced-rigid-bodies.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ export class NgtrInstancedRigidBodies {
153153
if (colliders === false) return [];
154154

155155
const physicsColliders = this.physics.colliders();
156-
// if physics colliders is false explicitly, disable auto colliders for this object entirely.
157-
if (physicsColliders === false) return [];
156+
// if physics colliders is false explicitly AND colliders is not set, disable auto colliders for this object entirely.
157+
if (physicsColliders === false && colliders === undefined) return [];
158158

159159
const options = this.options();
160160
// if colliders on object is not set, use physics colliders

libs/rapier/src/lib/rigid-body.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ export class NgtrRigidBody {
470470
if (colliders === false) return [];
471471

472472
const physicsColliders = this.physics.colliders();
473-
// if physics colliders is false explicitly, disable auto colliders for this object entirely.
474-
if (physicsColliders === false) return [];
473+
// if physics colliders is false explicitly AND colliders is not set, disable auto colliders for this object entirely.
474+
if (physicsColliders === false && colliders === undefined) return [];
475475

476476
const options = this.options();
477477
// if colliders on object is not set, use physics colliders

0 commit comments

Comments
 (0)