CsabaConsulting / ARPhysics

Testing Physics engines with AR
MIT License
2 stars 0 forks source link

There seems to be sometimes a displacement between the visual position and the collision position of the cylinder #7

Open MrCsabaToth opened 4 years ago

MrCsabaToth commented 4 years ago

This is for the collision box experiment. Originally I placed the cylinder outside of the collision box, but then there was about half meter displacement between the visual AR Node cylinder and the Physics simulated collision shape of the cylinder. I placed the cylinder to the dead center (0, 0, 0), that kinda helped but there's still seems to be some displacement sometimes, sometimes at an equilibrium some planks dip into the cylinder. Maybe it's just the simulated cylinder is not that wide as the visual?

MrCsabaToth commented 4 years ago

Actually it seems that the moving around causes collisions, but then the physics engine somehow resets the collision shape back to dead center...

MrCsabaToth commented 3 years ago

Addition: when I'm doing the first drag action, the phantom cylinder doesn't appear in the center until I end the first drag-around operation. As soon as the first drag ends and I release it, that's when the phantom appears in the center and bursts the planks. I should debug what's happening at that point. Maybe I need to set the AR Node to the center too, but by UX the cylinder should stay where it is, which can be on the sideline. And after consecutive drag-around operations it seems that both the red visual cylinder is colliding and both the phantom is still there.

MrCsabaToth commented 3 years ago

It seems like that something whacky is going on in the TransformableNode's TranslationController's public void onEndTransformation(DragGesture gesture) {: https://github.com/google-ar/sceneform-android-sdk/blob/master/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/TranslationController.java#L162

Maybe it's something with the // Temporarily set the node to the final world rotation so that we can accurately // determine the initialForwardInLocal in the new coordinate space. or whatever but when the gesture ends it causes a bump in the location... that's where something is wrong!