07-05-2021, 01:42 PM
(This post was last modified: 07-05-2021, 01:44 PM by josemendez.)
Objects have both orientation and position, and softbody particles do as well.
If you only store the position, when a particle rotates around any spheres attached to it will not, and they will end up inside the softbody.
What you want is to build a transform matrix using both the position and the orientation (using GetParticleOrientation()), to find your sphere's position in the particle's local space. You need to know what vector spaces are, how to build a basis matrix and convert data between spaces, as this is a basic 3D skill.
You can use Unity's Matrix4x4.TRS() to build a matrix out of a position and orientation.
cheers!
If you only store the position, when a particle rotates around any spheres attached to it will not, and they will end up inside the softbody.
What you want is to build a transform matrix using both the position and the orientation (using GetParticleOrientation()), to find your sphere's position in the particle's local space. You need to know what vector spaces are, how to build a basis matrix and convert data between spaces, as this is a basic 3D skill.
You can use Unity's Matrix4x4.TRS() to build a matrix out of a position and orientation.
cheers!