Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hinge Joints Alternative?
#1
Pregunta 
Does softbody have a type of fixed rotation similar to unity's hinge joints?


I can't use unity's hinge joints because it requires a Connected Body (a rigidbody) to follow the transform.
https://docs.unity3d.com/Manual/class-HingeJoint.html


Basically, I'm trying to create softbody doors that can open and swing from softbody vehicles while driving. 
My vehicles are controlled by adding forces to softbodies. 
I'm not using rigidbodies at all, since the 4.1 update.
Without a connected body, the hinge joint is connected to the world and doesn't follow the vehicle.

Any help on or direction on this is greatly appreciated. Thanks.
Reply
#2
(13-05-2019, 06:01 PM)StudioTatsu Wrote: Does softbody have a type of fixed rotation similar to unity's hinge joints?


I can't use unity's hinge joints because it requires a Connected Body (a rigidbody) to follow the transform.
https://docs.unity3d.com/Manual/class-HingeJoint.html


Basically, I'm trying to create softbody doors that can open and swing from softbody vehicles while driving. 
My vehicles are controlled by adding forces to softbodies. 
I'm not using rigidbodies at all, since the 4.1 update.
Without a connected body, the hinge joint is connected to the world and doesn't follow the vehicle.

Any help on or direction on this is greatly appreciated. Thanks.

Hi there,

Currently there are no built-in hinge joint alternatives for softbodies. However, being a position-based engine you could simply force the position of a couple particles to be the same. That would get you an accurate ball joint. Do this for two couples of particles, and you have a make-do hinge joint.

Let me know if you need help with the code required to achieve this.
Reply
#3
(18-05-2019, 02:15 PM)josemendez Wrote: Hi there,

Currently there are no built-in hinge joint alternatives for softbodies. However, being a position-based engine you could simply force the position of a couple particles to be the same. That would get you an accurate ball joint. Do this for two couples of particles, and you have a make-do hinge joint.

Let me know if you need help with the code required to achieve this.

hi @josemendez

im looking to do something along these lines.
please could you give some pointers how to code this?


thanks
Reply
#4
(08-07-2019, 09:45 PM)tegleg Wrote: hi @josemendez

im looking to do something along these lines.
please could you give some pointers how to code this?


thanks


I had issues with the soft bodies lagging behind the wheels and the doors lagging behind the vehicle. It seems the longer I drove, the farther away the connected particles drifted away. When I stop the connected particles would gradually move back to the connected position.

Also, I had issues with applying force to the softbodies. I needed AddForceAtPosition but currently, the ObiActor only have AddForce.
I may revisit using Obi softbodies with vehicles later, but for now, I'm using my own soft deformation solution. 

Obi Softbody is currently the best solution for softbodies in Unity, so if you can get it working without issues, it would definitely be worth it.
Reply
#5
(09-07-2019, 02:38 AM)StudioTatsu Wrote: I had issues with the soft bodies lagging behind the wheels and the doors lagging behind the vehicle. It seems the longer I drove, the farther away the connected particles drifted away. When I stop the connected particles would gradually move back to the connected position.

Also, I had issues with applying force to the softbodies. I needed AddForceAtPosition but currently, the ObiActor only have AddForce.
I may revisit using Obi softbodies with vehicles later, but for now, I'm using my own soft deformation solution. 

Obi Softbody is currently the best solution for softbodies in Unity, so if you can get it working without issues, it would definitely be worth it.

Hi!

Lag issues are generally caused by the order in which things happen during the frame. Most probably, your vehicle's physics are being updated after Obi, this results in Obi working with data that is 1-frame old. Also, interpolation introduces a 1-frame delay in the simulation, so if your ObiSolver uses it, make sure your rigid bodies do too so they're kept in sync.

AddForceAtPosition would be needed if the soft body was be a continuum material (like a rigid body), but it is made out of particles. So applying a force at a position is equivalent to changing the velocity of a particle Sonrisa.

We're currently working on a lot of improvements to Obi, we will announce it when things change for the better.
Reply
#6
(09-07-2019, 02:38 AM)StudioTatsu Wrote: I had issues with the soft bodies lagging behind the wheels and the doors lagging behind the vehicle. It seems the longer I drove, the farther away the connected particles drifted away. When I stop the connected particles would gradually move back to the connected position.

Also, I had issues with applying force to the softbodies. I needed AddForceAtPosition but currently, the ObiActor only have AddForce.
I may revisit using Obi softbodies with vehicles later, but for now, I'm using my own soft deformation solution. 

Obi Softbody is currently the best solution for softbodies in Unity, so if you can get it working without issues, it would definitely be worth it.

thanks for the reply @StudioTatsu i seem to be invisible to @josemendez

i moved from Truss Physics because thats abandoned, unstable, has performance issues and no source code.
this seemed a way forward, hope future updates solves the lag, includes a way to connect 2 softbodies by selected particles and adding a force to a particle could also be useful.

could i ask how you connected particles?

thanks again
Reply
#7
(09-07-2019, 10:48 PM)tegleg Wrote: thanks for the reply @StudioTatsu i seem to be invisible to @josemendez

i moved from Truss Physics because thats abandoned, unstable, has performance issues and no source code.
this seemed a way forward, hope future updates solves the lag, includes a way to connect 2 softbodies by selected particles and adding a force to a particle could also be useful.

could i ask how you connected particles?

thanks again

Hi there!

Currently there's no easy way to connect particles from different soft bodies manually, working on it for upcoming updates. Adding external forces to particles is quite easy though. Either set their velocity directly:
Code:
softbody.Solver.velocities[softbody.particleIndices[index]] = <your velocity>
(remember that f = ma, and a = dv/dt)

Or, use forces directly:
Code:
softbody.Solver.externalForces[softbody.particleIndices[index]] = <your force>
Reply
#8
(10-07-2019, 07:10 AM)josemendez Wrote: Hi there!

Currently there's no easy way to connect particles from different soft bodies manually, working on it for upcoming updates. Adding external forces to particles is quite easy though. Either set their velocity directly:
Code:
softbody.Solver.velocities[softbody.particleIndices[index]] = <your velocity>
(remember that f = ma, and a = dv/dt)

Or, use forces directly:
Code:
softbody.Solver.externalForces[softbody.particleIndices[index]] = <your force>

thanks @josemendez

some kind of joint with the ability to restrict certain axis would be wonderful.
imagine a robot arm made from softbodies joined with hinges. for example the elbow would only bend in the x axes, the wrist can only rotate in the z axis and so on.
this would also open up obi to vehicles and all sorts
Reply
#9
(10-07-2019, 07:10 AM)josemendez Wrote: Hi there!

Currently there's no easy way to connect particles from different soft bodies manually, working on it for upcoming updates. Adding external forces to particles is quite easy though. Either set their velocity directly:
Code:
softbody.Solver.velocities[softbody.particleIndices[index]] = <your velocity>
(remember that f = ma, and a = dv/dt)

Or, use forces directly:
Code:
softbody.Solver.externalForces[softbody.particleIndices[index]] = <your force>

Hi Jose,

You had mentioned you were working on ways to connect particles from different soft bodies manually - is this something now feasible or it still has to be done via code?

Thanks
Reply
#10
(10-11-2020, 02:28 AM)Pheebau Wrote: Hi Jose,

You had mentioned you were working on ways to connect particles from different soft bodies manually - is this something now feasible or it still has to be done via code?

Thanks
the stitcher seems the closest thing so far although my tests have been underwhelming to say the least. not a hinge but at least a way of joining 2 soft bodies.
lets hope the next update provides some kind of solution.
Reply