Posts: 5
Threads: 1
Joined: Feb 2023
Reputation:
0
Hi,
We created the container using Voxel Mesh, In editor while moving the liquid sustains good where in Quest 2 device by hand interaction the liquid gets through the bottom of the container as the container sticks to the hand pose. We even tried the same interactions with the Whiskey bottle even then its pass through the bottle. Kindly assist on further settings to hold the liquid inside the container though using interaction with the container.
Thanks,
Harish
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(28-02-2023, 11:35 AM)Harish Wrote: Hi,
We created the container using Voxel Mesh, In editor while moving the liquid sustains good where in Quest 2 device by hand interaction the liquid gets through the bottom of the container as the container sticks to the hand pose. We even tried the same interactions with the Whiskey bottle even then its pass through the bottle. Kindly assist on further settings to hold the liquid inside the container though using interaction with the container.
Thanks,
Harish
Hi Harish,
You can't move a rigidbody by directly setting its transform position, as this will cause tunneling, specially when colliding against small/thin objects such as fluid particles.
Make sure your colliders have rigidbodies, and are being moved either via setting their velocity, using forces, or using rigidbody.MovePosition().
kind regards,
Posts: 5
Threads: 1
Joined: Feb 2023
Reputation:
0
(28-02-2023, 11:42 AM)josemendez Wrote: Hi Harish,
You can't move a rigidbody by directly setting its transform position, as this will cause tunneling, specially when colliding against small/thin objects such as fluid particles.
Make sure your colliders have rigidbodies, and are being moved either via setting their velocity, using forces, or using rigidbody.MovePosition().
kind regards,
My colliders have rigidbodies and I'm using Grabbable (Oculus SDK) for the interaction of the container. Can you assist further?
Posts: 5
Threads: 1
Joined: Feb 2023
Reputation:
0
(28-02-2023, 11:42 AM)josemendez Wrote: Hi Harish,
You can't move a rigidbody by directly setting its transform position, as this will cause tunneling, specially when colliding against small/thin objects such as fluid particles.
Make sure your colliders have rigidbodies, and are being moved either via setting their velocity, using forces, or using rigidbody.MovePosition().
kind regards, Hi josemendez ,
I tried with the rigidbody.MovePosition() with grababble script but it is not working as expected. Kindly update me on this.
Thanks,
Harish
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(01-03-2023, 08:09 AM)Harish Wrote: Hi josemendez,
I tried with the rigidbody.MovePosition() with grababble script but it is not working as expected. Kindly update me on this.
Thanks,
Harish
Hi Harish,
The included FaucetAndBucket sample scene uses a kinematic rigidbody that allows the user to interact with a fluid container, without any tunneling/missing collisions. The WhiskeyBottle sample scene also showcases a kinematic rigidbody, you can try increasing the rotation speed in the Rotator component quite a lot without any issues (roughly up to 360 degrees/second).
Both are moved by setting its transform position -which yields worse results than MovePosition()-, but as long as the rigidbody has some velocity collisions shouldn't be missed. This can be achieved by either making the rigidbody kinematic, by using MovePosition(), or by driving a non-kinematic rigidbody using forces/impulses/velocity deltas.
Note though that MeshColliders are very brittle when it comes to collision detection against small objects, because their surface is infinitely thin. If you find MeshColliders too brittle, Obi includes an alternative collision primitive called distance fields. These are both cheaper and more robust than MeshColliders.
let me know if I can be of further help,
kind regards
Posts: 5
Threads: 1
Joined: Feb 2023
Reputation:
0
(01-03-2023, 08:26 AM)josemendez Wrote: Hi Harish,
The included FaucetAndBucket sample scene uses a kinematic rigidbody that allows the user to interact with a fluid container, without any tunneling/missing collisions. The WhiskeyBottle sample scene also showcases a kinematic rigidbody, you can try increasing the rotation speed in the Rotator component quite a lot without any issues (roughly up to 360 degrees/second).
Both are moved by setting its transform position -which yields worse results than MovePosition()-, but as long as the rigidbody has some velocity collisions shouldn't be missed. This can be achieved by either making the rigidbody kinematic, by using MovePosition(), or by driving a non-kinematic rigidbody using forces/impulses/velocity deltas.
Note though that MeshColliders are very brittle when it comes to collision detection against small objects, because their surface is infinitely thin. If you find MeshColliders too brittle, Obi includes an alternative collision primitive called distance fields. These are both cheaper and more robust than MeshColliders.
let me know if I can be of further help,
kind regards
Hi Josemendez,
Here I have attached the sample scene "FaucetAndBucket" where the water pass through. Even it happens in the bottle. I also tried the distance field which even not working.
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(01-03-2023, 10:58 AM)Harish Wrote: Hi Josemendez,
Here I have attached the sample scene "FaucetAndBucket" where the water pass through. Even it happens in the bottle. I also tried the distance field which even not working.
Hi,
This is a common issue in all physics engines called tunneling: the faster the position of an object changes between consecutive frames, and the thinner/smaller objects are in relation to how fast they move, the more prone to tunneling are.
We have a video on tunneling here:
https://www.youtube.com/watch?v=ms0Z35GY6pk
You can reproduce the exact same effect using regular Unity objects. Try placing a small cube rigidbody on top of a plane, then move the plane upwards fast: the cube will simply pass trough it.
Simulation performance in the video you shared is really quite bad, not sure of the culprit. The change in position of the bucket from one frame to the next is quite large, so you're quite literally pulling the rug from under the fluid's feet. So one way to improve results would be to fix the performance issue: I assume you've installed the required dependencies for Burst, as per the installation steps?
Another option is using forces to move rigidbodies around. This allows the engine to "predict" where objects are going to move next. This is what's called CCD (continuous collision detection). However, for this to be of any use objects need to have a velocity vector, which they won't if you just do transform.position = whatever.
In the case of kinematic rigidbodies, Obi will calculate a velocity vector with a 1-frame delay (since it uses the difference in position since the last frame) which improves robustness in some situations, but can't do much when an object starts moving from a stationary state: there's no way to predict where it's going to move next.
The only way to do that is to move the object by applying forces to it. This way, the object is moved during the simulation (as opposed to after it) as a result of forces modifying its velocity, and CCD can kick in.
hope this helps,
kind regards
Posts: 5
Threads: 1
Joined: Feb 2023
Reputation:
0
(01-03-2023, 11:30 AM)josemendez Wrote: Hi,
This is a common issue in all physics engines called tunneling: the faster the position of an object changes between consecutive frames, and the thinner/smaller objects are in relation to how fast they move, the more prone to tunneling are.
We have a video on tunneling here:
https://www.youtube.com/watch?v=ms0Z35GY6pk
You can reproduce the exact same effect using regular Unity objects. Try placing a small cube rigidbody on top of a plane, then move the plane upwards fast: the cube will simply pass trough it.
Simulation performance in the video you shared is really quite bad, not sure of the culprit. The change in position of the bucket from one frame to the next is quite large, so you're quite literally pulling the rug from under the fluid's feet. So one way to improve results would be to fix the performance issue: I assume you've installed the required dependencies for Burst, as per the installation steps?
Another option is using forces to move rigidbodies around. This allows the engine to "predict" where objects are going to move next. This is what's called CCD (continuous collision detection). However, for this to be of any use objects need to have a velocity vector, which they won't if you just do transform.position = whatever.
In the case of kinematic rigidbodies, Obi will calculate a velocity vector with a 1-frame delay (since it uses the difference in position since the last frame) which improves robustness in some situations, but can't do much when an object starts moving from a stationary state: there's no way to predict where it's going to move next.
The only way to do that is to move the object by applying forces to it. This way, the object is moved during the simulation (as opposed to after it) as a result of forces modifying its velocity, and CCD can kick in.
hope this helps,
kind regards
Hi Josemendez,
It would be better if you make your "Whiskey bottle" sample project works with the force and give us. We would look into it further.
Thanks,
Harish
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(01-03-2023, 01:20 PM)Harish Wrote: Hi Josemendez,
It would be better if you make your "Whiskey bottle" sample project works with the force and give us. We would look into it further.
Thanks,
Harish
Hi Harish,
You just need to call AddForce() on a non-kinematic rigidbody, that's all.
cheers,
|