Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change size of spheres using Softbody
#1
Pregunta 
I'm trying to make a simulation of many sphere-shaped cells that swim around and squish into each other, with each sphere being a Softbody actor in a single Solver. Ideally I'd like to be able to change the size of a single cell during runtime, for instance if one eats a food particle it will bump up in size slightly. The bigger cell would push other cells out of the way as it takes up more space.

I did see one other post on the forum saying that scaling the actors is not possible, but I'm wondering if there's any potential workarounds? I figured that spheres are a lot simpler than a detailed mesh, so it could be possible to achieve the same effect somehow through a force, constraint value, modifying blueprint, etc., but I'm not familiar enough with the plugin yet to know what to try.

Does anyone know how to achieve something like this, or have any ideas for things to try out? Or is this not possible? Thanks!
Reply
#2
Yea can't have scaling in Obi Actor is a very big limitation for this plugin imho.
For example I want to make one Cape ObiCloth only, and scale that cape for different character size, and pin the attachment transforms to the character's shoulders dynamically via script when the game start. That will be great if the Cloth can be scaled.
But currently Actor does not support scale, so that for each cape size we have to make new cape mesh and setup new ObiCloth.
Reply
#3
(16-05-2024, 07:54 AM)spikebor Wrote: Yea can't have scaling in Obi Actor is a very big limitation for this plugin imho.
For example I want to make one Cape ObiCloth only, and scale that cape for different character size, and pin the attachment transforms to the character's shoulders dynamically via script when the game start. That will be great if the Cloth can be scaled.
But currently Actor does not support scale, so that for each cape size we have to make new cape mesh and setup new ObiCloth.

Deformable objects cannot be scaled. This is a mathematical limitation that stems from the fact that scaling is not a rigid transformation: it does not preserve euclidean distance between points, unlike translation and rotation: when you scale an object the distance between points on its surface changes. 

As result, scaling a deformable object would require altering a lot of data about its shape at rest, data that is precomputed during blueprint creation: distances between particles, shape matching matrices, angles - if applying non uniform scale, etc. This is not doable in realtime.

You can however scale the space in which the simulation is performed (since you can't bend space, at least not under everyday circumstances far away from a black hole Guiño ). This is done by scaling the ObiSolver component, note this involves all actors managed by the solver. Here's an example of the RubberDragon scene in ObiSoftbody, I've copied the ObiSolver 3 times and scaled it differently, all 3 share the same setup and blueprint:

[Image: HUlCZ3Z.png]

------

As a side note, this limitation applies not just to deformable bodies but to rigid bodies to some extent too: scaling a rigid object forces Unity to adjust the collider's size internally. Take a SphereCollider for example: you can't apply non-uniform scaling on a SphereCollider, one would expect it to result in an ellipsoid but it doesn't due to the fact that the sphere can only adjust its radius.

Another example with a BoxCollider: if you apply scale *only* you will get good results (as it only involves changing 3 values: width, height and depth of the box). This only works however if scaling is not compounded with rotation, as it gives rise to shear: parent a BoxCollider under a transform, then rotate the box and scale the parent transform: the box won't be able to match the sheared shape.
Reply
#4
(15-05-2024, 06:52 PM)charlieatron1 Wrote: I did see one other post on the forum saying that scaling the actors is not possible, but I'm wondering if there's any potential workarounds? I figured that spheres are a lot simpler than a detailed mesh, so it could be possible to achieve the same effect somehow through a force, constraint value, modifying blueprint, etc., but I'm not familiar enough with the plugin yet to know what to try.

Does anyone know how to achieve something like this, or have any ideas for things to try out? Or is this not possible? Thanks!

Softbodies - and deformable objects in general, see my previous post - cannot be scaled in realtime.

However due to the specific circumstances of your use case (uniform scaling of a radially symmetric object), you might obtain good results using cloth simulation instead, and rely on scaling the distance constraints between vertices or using volume constraints.

Will prepare a small example of this for you, so you can decide whether to switch to ObiCloth (we would reimburse the prince difference with ObiSoftbody) or not.
Reply
#5
(16-05-2024, 09:03 AM)josemendez Wrote: Will prepare a small example of this for you, so you can decide whether to switch to ObiCloth (we would reimburse the prince difference with ObiSoftbody) or not.


That would be awesome, thanks!

I'm checking with our IT person now to get our Asset Store purchase ID for Obi Softbody to verify that for you, but let me know if you need anything else from me.
Reply