Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Softbody positioned far from the world origin move toward the origin unexpectedly
#1
Hi,
I faced unexpected behavior of a softbody positioned far from the world origin.

Repro:
1. open BallPool sample scene.
2. create new GameObject with its name is 'Parent', its position is (0, 0, 0).
3. move existing GameObjects of 'Main Camera', 'TestEnvironment', 'ActorSpawner' and 'Ball' to under 'Parent' (to be Parent's children).
4. change Parent's position.x = 10000 (here, dare large)
changed like this
   
5. play the scene

Result:

The ball falls down and also moves rightward as like horizontal force was added.
It should fall down only along Y axis.
Might think the ball goes back to the world origin.

Do I missing setup something?
Thanks
Reply
#2
(31-05-2019, 05:20 AM)kenjis Wrote: Hi,
I faced unexpected behavior of a softbody positioned far from the world origin.

Repro:
1. open BallPool sample scene.
2. create new GameObject with its name is 'Parent', its position is (0, 0, 0).
3. move existing GameObjects of 'Main Camera', 'TestEnvironment', 'ActorSpawner' and 'Ball' to under 'Parent' (to be Parent's children).
4. change Parent's position.x = 10000 (here, dare large)
changed like this

5. play the scene

Result:

The ball falls down and also moves rightward as like horizontal force was added.
It should fall down only along Y axis.
Might think the ball goes back to the world origin.

Do I missing setup something?
Thanks

Well, you're facing floating point precision problems. Shape matching constraints are specially sensitive to it. This is not at all unexpected, and one of the reasons why local space simulation exists. See:

http://obi.virtualmethodstudio.com/tutor...space.html

Quote from local space sim advantages:
Quote:The simulation can be very far away from the world's origin and still retain excellent floating point precision, as all quantities are expressed with respect to the solver's transform.

So the solution in this case would be to switch from world space sim to local space sim.

cheers,
Reply
#3
(31-05-2019, 07:12 AM)josemendez Wrote: Well, you're facing floating point precision problems. Shape matching constraints are specially sensitive to it. This is not at all unexpected, and one of the reasons why local space simulation exists. See:

http://obi.virtualmethodstudio.com/tutor...space.html

Quote from local space sim advantages:

So the solution in this case would be to switch from world space sim to local space sim.

cheers,

Hi,
Than you for quick response!

Yes, exactly it became not caused in local space simulation.

But I came to another problem in case of local space simulation, it is that visual of the ball (in faraway) and its transform (in wold's origin) get apart.
I'm thinking of attaching unity collider to ObiSoftbody to interact in unity standard ways such as collision, Physics.raycast, and so on...

Is there any way to keep visual and transform of softbody at the same position in local space simulation?
Thanks
Reply