Obi Official Forum
AddTorque? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: AddTorque? (/thread-3956.html)



AddTorque? - Renman3000 - 31-07-2023

If I have a softbody sphere, that I wanted to move by having it roll itself around, how would you code this?

I am currently using a rigidbody and obiRigidbody on the ball (in the example BallPool), and applying AddTorque() but there is no response. 

?


RE: AddTorque? - josemendez - 31-07-2023

(31-07-2023, 05:24 PM)Renman3000 Wrote: If I have a softbody sphere, that I wanted to move by having it roll itself around, how would you code this?

I am currently using a rigidbody and obiRigidbody on the ball (in the example BallPool), and applying AddTorque() but there is no response. 

?

An object can’t be both a rigidbody and a softbody at the same time, that makes no sense whatsoever. The ObiRigidbody component only exists to let Obi know that an existing Unity rigidbody must be considered part of the simulation, it is automatically added to rigidbodies interacting with Obi actors so you should never add this component manually to an object.

Simply take your ObiSoftbody component and call AddTorque on it.

kind regards,


RE: AddTorque? - Renman3000 - 31-07-2023

(31-07-2023, 06:39 PM)josemendez Wrote: An object can’t be both a rigidbody and a softbody at the same time, that makes no sense whatsoever. The ObiRigidbody component only exists to let Obi know that an existing Unity rigidbody must be considered part of the simulation, it is automatically added to rigidbodies interacting with Obi actors so you should never add this component manually to an object.

Simply take your ObiSoftbody component and call AddTorque on it.

kind regards,
Oh, I see. 
My bad. 

Yes, it is working. Great!
Thank you!


RE: AddTorque? - Renman3000 - 31-07-2023

(31-07-2023, 06:39 PM)josemendez Wrote: An object can’t be both a rigidbody and a softbody at the same time, that makes no sense whatsoever. The ObiRigidbody component only exists to let Obi know that an existing Unity rigidbody must be considered part of the simulation, it is automatically added to rigidbodies interacting with Obi actors so you should never add this component manually to an object.

Simply take your ObiSoftbody component and call AddTorque on it.

kind regards,


Sorry, one other question, what about drag and other Rigidbody properties? Can you link me to a page with all of the component variables?
Thank you


RE: AddTorque? - josemendez - 01-08-2023

(31-07-2023, 08:47 PM)Renman3000 Wrote: Sorry, one other question, what about drag and other Rigidbody properties? Can you link me to a page with all of the component variables?
Thank you

The Rigidbody component is not part of Obi, it's a built-in Unity component. You'll find the documentation here:
https://docs.unity3d.com/Manual/class-Rigidbody.html

If you were referring to Rigidbody-like properties in ObiSoftbody, they have different properties/variables (because a soft and a rigid body are fundamentally different). You can find a complete list of all component variables in Obi in the API docs.

kind regards,


RE: AddTorque? - Renman3000 - 01-08-2023

(01-08-2023, 06:47 AM)josemendez Wrote: The Rigidbody component is not part of Obi, it's a built-in Unity component. You'll find the documentation here:
https://docs.unity3d.com/Manual/class-Rigidbody.html

If you were referring to Rigidbody-like properties in ObiSoftbody, they have different properties/variables (because a soft and a rigid body are fundamentally different). You can find a complete list of all component variables in Obi in the API docs.

kind regards,


Hi, Of course, I mean in relation to Obi technologies. That said, 1000 apologies if I was unclear. What I would like is the ability to scan how I can access similar functions in Obi, that relate to Unity Physics. 


for example, Velocity or Drag..... Is there a page dedicated to this?
Thank you


RE: AddTorque? - josemendez - 02-08-2023

(01-08-2023, 04:57 PM)Renman3000 Wrote: Hi, Of course, I mean in relation to Obi technologies. That said, 1000 apologies if I was unclear. What I would like is the ability to scan how I can access similar functions in Obi, that relate to Unity Physics. 


for example, Velocity or Drag..... Is there a page dedicated to this?
Thank you

Hi!

In general, softbodies have no equivalent rigidbody properties because they're fundamentally very different things.

A rigidbody has uniform density, with a single mass value concentrated on a single point (its center of mass), and single linear/angular velocity values (these of its center of mass). As a result, rigidbodies can't deform.

Softbodies however are composed of multiple independent bits. This is called discretizing a softbody and in Obi's case, this discretization is carried out using particles. Each particle in a softbody has its own mass, its own velocity, etc. allowing softbodies to have varying properties across their volume and deform as a result. For this reason, there's no single linear velocity/angular velocity/inertia tensor/mass value in a softbody.

Softbody particle properties are accessed in a very different way to a rigidbody's properties, you can see a complete list of all per-particle properties and how to access them here.

kind regards,