14-05-2021, 08:12 AM
(This post was last modified: 14-05-2021, 08:19 AM by josemendez.)
(14-05-2021, 02:17 AM)ReaperQc Wrote: I am unsure where to access the softbody's velocity.
You can't, because a softbody (like any deformable body) doesn't have a single velocity. Different parts of it can move in different directions and with different velocities.
This is also true of rotating rigidbodies, however in a rigidbody you can estimate the velocity at any point using the center of mass' angular velocity (Unity's GetPointVelocity() method). However this doesn't work in a softbody, because it doesn't have a single angular velocity either.
Quote:i was able to find the solver's velocities but it return an unusable vector4 that is only usable with obi element.
That's the only way to get velocities out of a deformable body: query the velocity of its individual particles. However that's far from unusable, you can a lot of things with this. I think you're interested in finding the linear velocity of the softbody's center of mass. This is done by calculating a mass-weighted average of all particles' velocities.
There's code for this in the manual that you can copypaste (http://obi.virtualmethodstudio.com/tutor...icles.html) you just have to swap positions with velocities.
Let me know if you need help with it.
cheers!