Hey, when I was using the PhysicsViewer to debug constraint, I found the angular cylinder which created in the utility layer scene was attached to the original scene node as its child. Sometimes this would cause some serialize issues since they are not in the same scene. So I wanna ask if it’s a need to optimize this implementation?
let me add @Cedric to help when he ll be back from his break
Hi @RichardFly
Are you refering to this code ? Babylon.js/packages/dev/core/src/Debug/physicsViewer.ts at 5b48f659e3bc4055d6ac2b9b1ff7188534668d8b · BabylonJS/Babylon.js · GitHub
Cylinder is created in utilityLayerScene. I guess I’m missing something.
It’s created in the utilityScene, but parented in the child body scene.
Can you point me to that code?
Anyways, it’s not optimization, for sure. I don’t think physicsViewer should be serialized at all actually.
You can see the line 904, mesh.parent=parent and the parent is the child body transformNode which is created in the origin scene.
Now I get it! Parenting simplifies rendering. Removing that parenting would need a different frame update the update cylinder matrix. It’s possible to remove that by updating _updateDebugMeshesV2() for the cylinder world matrix.
Indeed. Another question, about the scailing of the angularConstraintMesh. Sometimes it would appear quite large than the body transformNode. A PG is needed? Or you can check the code starts at line 906 first?
Yes, PG please ![]()
It seems a little bit big indeed
I’ll take a look asap
