Posts: 19
Threads: 3
Joined: Mar 2018
Reputation:
1
What if an object has more than one collider. Say it has 50... it seems that adding an Obicollider is not enough. Does one Obi collider really only support one Unity collider? Any ways around this?
I am trying to make it possible to grab one of the buckets in the faucet example, but it gives some issues since the mesh collider is set to kinematic.
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
24-03-2018, 11:10 AM
(This post was last modified: 24-03-2018, 11:11 AM by josemendez.)
(24-03-2018, 01:11 AM)Caldor Wrote: What if an object has more than one collider. Say it has 50... it seems that adding an Obicollider is not enough. Does one Obi collider really only support one Unity collider? Any ways around this?
I am trying to make it possible to grab one of the buckets in the faucet example, but it gives some issues since the mesh collider is set to kinematic.
Obi does not support multiple colliders in the same object for now. If you need that, you can make a compound collider the pre-Unity 5.0 way (hierarchy of objects).
Unity does not support non-kinematic (moving) concave colliders, but Obi does. Simply make your MeshCollider convex (as Unity will complain otherwise), Obi will use the actual object geometry for collisions.
Posts: 19
Threads: 3
Joined: Mar 2018
Reputation:
1
24-03-2018, 11:18 AM
(This post was last modified: 24-03-2018, 11:38 AM by Caldor.)
(24-03-2018, 11:10 AM)josemendez Wrote: Obi does not support multiple colliders in the same object for now. If you need that, you can make a compound collider the pre-Unity 5.0 way (hierarchy of objects).
Unity does not support non-kinematic (moving) concave colliders, but Obi does. Simply make your MeshCollider convex (as Unity will complain otherwise), Obi will use the actual object geometry for collisions.
Ahh, so it will be convex for all the Unity physics but not for Obi fluids? Interesting. Yeah, I was trying to use a script that makes a mesh collider into a whole bunch of simple colliders.
Oh right, I already tried this, its the faucet example and Unity cannot enable the convex collider for the bucket meshes, because they are too complex.
I guess I will just find some other mesh to use.
Posts: 19
Threads: 3
Joined: Mar 2018
Reputation:
1
Well, the colliders / meshes in the Faucet example is too complex to be made convex... but I guess I will just find some other model that will work for this.
I tried making a simple bucket made out of 5 boxes though, but even though they overlapped it seemed to lose water... but then it is VR, so it is moving around a lot. Might be a problem even with a solid mesh.
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(28-03-2018, 06:56 AM)Caldor Wrote: Well, the colliders / meshes in the Faucet example is too complex to be made convex... but I guess I will just find some other model that will work for this.
I tried making a simple bucket made out of 5 boxes though, but even though they overlapped it seemed to lose water... but then it is VR, so it is moving around a lot. Might be a problem even with a solid mesh.
You might be running into tunneling issues. Moving an object using its transform is equivalent to teleporting it around between frames, so if you "teleport" fast enough that particles are left completely outside of the container, they will fail to detect any collision. This happens to all physics engines.
Obi uses continuous collision detection by default to prevent this, but CCD only works if the moving colliders have a velocity (because using the velocity, you can predict where the container is going to move next). So the container either needs to be a non-kinematic rigidbody and be moved around using forces/impulses, or if you can't afford to do this, you need to calculate your own velocity based on position deltas between frames.
There's the ObiKinematicVelocities component, that will calculate linear and angular velocities for kinematic rigidbodies, or if you desire to calculate them any other way, you can use it as a starting point to build your own.
Posts: 19
Threads: 3
Joined: Mar 2018
Reputation:
1
(28-03-2018, 12:06 PM)josemendez Wrote: You might be running into tunneling issues. Moving an object using its transform is equivalent to teleporting it around between frames, so if you "teleport" fast enough that particles are left completely outside of the container, they will fail to detect any collision. This happens to all physics engines.
Obi uses continuous collision detection by default to prevent this, but CCD only works if the moving colliders have a velocity (because using the velocity, you can predict where the container is going to move next). So the container either needs to be a non-kinematic rigidbody and be moved around using forces/impulses, or if you can't afford to do this, you need to calculate your own velocity based on position deltas between frames.
There's the ObiKinematicVelocities component, that will calculate linear and angular velocities for kinematic rigidbodies, or if you desire to calculate them any other way, you can use it as a starting point to build your own.
Very interesting. Yes I do know about the problems with moving a containing around, that has something in it. I made a snow globe simulations a few months ago.
https://www.youtube.com/watch?v=mslLL5J0nps
and I had to deal with similar problems. I just made the snow go back into the snow globe if they hit the floor I think my solution was, but also changing how the collisions were updated. I had also messed with their gravity to make them float, and it sometimes caused the whole snowglobe to begin flying upwards
I will try to experiment a bit and see if I can make a container that might somehow have a velocity or something. That script you made will probably help.
|