Raycastcommand with float 3 instead of vector3?

I’m using the math library and burst compiler for some simulation logic and raycasting is part of my algorithm so Im using raycastcommand.

As far as I understand, the burst compiler offers better performance to jobs that uses float3 instead of vector3. Because of this, all of my math logic is using float3. But when I get to the point where I need to use raycast commands, I need to cast my positions and directions, then run the commands, then get the results back and cast those hit points back to float3.

It seems like such a waste and I was hoping there would be an extensions or overload that would provide this. I’d write it myself but I don’t know where to find the source code for raycast command it’s not in the c# reference github as far as I can tell.

Doesnt Unity allow for an implicit conversion between float3 and vector3? Just use float3 everywhere and Unity will sort it out.

It doesn’t make much sense for RaycastCommand to use float3 as it deals with regular RigidBody/Transforms which would return Vector3.

The new physics package, CollisionWorld.CastRay, uses float3 as you’d expect.