the cannon-es.js has memory leak, i hope the cannon will be updated and address the bugs:
- memory leak
- trimesh and polyhedron bugs
- raycast vehicle postStep should be removed when vehicle is removed from world
the cannon-es.js has memory leak, i hope the cannon will be updated and address the bugs:
The cause of the browser crash “out of memory” was not because of threejs or cannon-es, the crash occurred because the function mesh-to-trimesh ( mesh )
is returning undefined.
function mesh-to-trimesh ( mesh ) {
...
for ( i = 0 ; i < mesh.lenght ; i ++ ) {
...
}
return shape
}
shape = mesh-to-trimesh ( mesh )
I fixed the bug by making the function mesh-to-trimesh ( mesh )
an async
function and adding await
to the call
async function mesh-to-trimesh ( mesh ) {
...
for ( i = 0 ; i < mesh.lenght ; i ++ ) {
...
}
return shape
}
shape = await mesh-to-trimesh ( mesh )