Closed OmegaRogue closed 6 months ago
If I understand you correctly, I think you can already do this:
// For this example, assume the token is above an overhead tile and the tile is set to elevation 20.
pt = _token.center;
pt.z = CONFIG.GeometryLib.utils.gridUnitsToPixels(30); // Set the point to elevation 30, using grid units consistent with x,y.
canvas.elevation.CoordinateElevationCalculator.groundElevationAt(pt); // Should return 20, which is the nearest floor: the tile at 20.
// If you wanted the terrain elevation:
canvas.elevation.CoordinateElevationCalculator.terrainElevationAt(pt); // 0 unless you set the terrain elevation to something else.
canvas.elevation.CoordinateElevationCalculator.groundElevationAt
should account for multiple overhead tiles as well as the terrain elevation. Given a point in space, it will return the highest elevation of the objects below that point.
I want to make maps with 3d terrain on multiple layers, which currently isnt possible with elevated vision and levels. It would be very useful if elevated vision allowed setting a function that is called with xyz coordinates as the parameter that returns the elevation of the nearest floor at that point: