How to get distance to the deformable body?

Hi @Yuya_t - The error message you’re seeing is due to a mismatch in the argument types for the Gf.Quatf function. This function is used to create a quaternion, which represents a rotation in 3D space. The error message indicates that the function expects either a single float (for a quaternion representing no rotation), four floats (representing the real part and the i, j, k imaginary parts of the quaternion), or a GfVec3f object (representing the imaginary part of the quaternion).

In your code, you’re passing in three floats to Gf.Quatf, which is not a valid set of arguments for this function. If you’re trying to create a quaternion from Euler angles, you can use the Gf.Rotation class instead:

rotation = Gf.Rotation(Gf.Vec3d(1.0, 0.0, 0.0), angle)
quat = rotation.GetQuat()

Here, angle is the angle of rotation in degrees.

As for getting the distance to a deformable body, you can use the ray_cast function in the same way as you would for a rigid body. The function should return the distance to the closest point on the deformable body that the ray intersects. If the ray does not intersect the deformable body, the function will return a large value (e.g., inf).

If you’re not getting the expected results, make sure that the deformable body is correctly set up and that the ray is being cast in the right direction. You might also want to check if the deformable body is included in the collision group that the ray_cast function is checking against.