It’s a simple OBJLoader that I use, like it :
loader = new OBJLoader();
loadObj (url) {
return new Promise((resolve) => {
function onLoad(geo) {
// geo.computeVertexNormals();
// return the obj when it's loaded
resolve(geo.children[0]);
}
this.loader.load(url, onLoad, onProgressCallback, onError);
});
function onProgressCallback() {}
function onError() {
console.log("cannot load obj files");
}
};```
*by user 224464722878005248*
by user 224464722878005248
Same problem with a random .obj url
by user 224464722878005248
Here the code if you wanna try :
by user 224464722878005248
by user 224464722878005248
kipash
(kipash)
September 14, 2023, 12:00am
86
Thank you, i can reproduce it on my end.
kipash
(kipash)
September 14, 2023, 12:00am
87
In the mean time, can you simplify it on your end and use the Box colliders for example?
Not really, the teeth can generate collision from anywhere by any movement and box or capsule could not repoduce that
by user 224464722878005248
kipash
(kipash)
September 14, 2023, 12:00am
91
Hazaaa
So, the issue is that the OBJ file and the OBJ Loader always load the mesh in an unindexed state. Rapier requires that the mesh has verticies and indices .
Our implementation doesn’t check if the mesh has that apparently will create an issue for that. Probably it is not common when working with GTLF and FBX and so on.
A quick fix, is to generate the indices manually.
Oooh
by user 224464722878005248
Okay it seems to work but it destroy my performances ^^’
by user 224464722878005248
kipash
(kipash)
September 15, 2023, 12:00am
94
Like, on start? Or overall low fps?
low fps
by user 224464722878005248
kipash
(kipash)
September 15, 2023, 12:00am
96
Hm
You can simplify the shape by enabling the convex bool.
collider.convex = true;
Better
by user 224464722878005248
kipash
(kipash)
September 15, 2023, 12:00am
98
That creates a simpler shape to compute, you will loose a bit of the shape, but in the case of the teeth, it could work.
kipash
(kipash)
September 15, 2023, 12:00am
99
What is your target platform? PC, Mobile, VR?
Pc
by user 224464722878005248