Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ef1a1f

Browse files
committed
fix(rapier): debug geometry works with webgpu
1 parent 417cff9 commit 9ef1a1f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/rapier/src/lib/debug.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ export class NgtrDebug {
3939
if (!lineSegments) return;
4040

4141
const buffers = worldSingleton.proxy.debugRender();
42-
lineSegments.geometry.setAttribute('position', new THREE.BufferAttribute(buffers.vertices, 3));
43-
lineSegments.geometry.setAttribute('color', new THREE.BufferAttribute(buffers.colors, 4));
42+
const geometry = new THREE.BufferGeometry();
43+
geometry.setAttribute('position', new THREE.BufferAttribute(buffers.vertices, 3));
44+
geometry.setAttribute('color', new THREE.BufferAttribute(buffers.colors, 4));
45+
46+
lineSegments.geometry.dispose();
47+
lineSegments.geometry = geometry;
4448
});
4549
}
4650
}

0 commit comments

Comments
 (0)