Hello !
I encountered a very strange error in one of my burst compiled functions : Burst error BC1055: Unable to resolve the definition of the method VoxelMesh.get_Radius(). I don't understand why that specific property can't be accessed, could this be a bug ?
Here are my functions, the error comes from float meshRadius = mesh.Radius; (but the other properties (float3 center = mesh.Center; and float3 size = mesh.Size; work fine) :
private static bool MainCameraFrustrumCulling(in VoxelMesh mesh, in float3 position, in NativeArray<Plane> cameraPlanes)
{
float3 center = mesh.Center;
float3 size = mesh.Size;
float3 normal = NormalVectors.vectors[(int)mesh.normal];
// Ignore meshes that are invisible because of their normal
if (math.dot(center - normal * size - position, normal) > 0) return false;
// Ignore meshes outside of camera view
foreach (Plane plane in cameraPlanes)
{
float3 normalSign = math.sign(plane.normal);
float3 closestPoint = center + (size * normalSign);
if (math.dot(closestPoint, plane.normal) + plane.distance < 0) return false;
}
return true;
}
private static bool MinimapCameraFrustrumCulling(in VoxelMesh mesh, in float2 position, float radius)
{
// Ignore meshes that are invisible because of their normal
if (mesh.normal != CubeNormal.yPositive) return false;
// Ignore meshes outside of camera view
float2 relativePos = mesh.Center.xz - position;
float meshRadius = mesh.Radius;
return math.dot(relativePos, relativePos) < (radius + meshRadius) * (radius + meshRadius);
}
And here are the properties of VoxelMesh :
public float3 Center => (position + new float3(minX + maxX, minY + maxY, minZ + maxZ) / 2) * WorldManager.blockSize;
public float3 Size => (new float3(maxX - minX, maxY - minY, maxZ - minZ) / 2) * WorldManager.blockSize;
public float Radius => math.length(Size);
Would anyone have an idea how I could fix this ?
