28-03-2018, 12:06 PM
(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.