debug_draw.DrawBox() uses erroneous Extent

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

The debug_draw.DrawBox() method creates a box with twice the expected Extent

Steps to Reproduce

  1. Compile this verse code
  2. Place the creative device in the level
  3. Create a box made in modelling mode, of size (512,512,512), with its location at (0,0,0).
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

my_debug_draw := class(debug_draw_channel) {}

debug_draw_demo_device := class(creative_device):

    @editable
    Extent : vector3 = vector3{X := 512.0, Y := 512.0, Z := 512.0}

    OnBegin<override>()<suspends>:void=
        DebugDraw : debug_draw = debug_draw{Channel := my_debug_draw}
        DebugDraw.DrawBox(vector3{X := 0.0, Y := 0.0, Z := 256.0}, rotation{}, ?Extent := Extent)

Expected Result

The debug_draw box should coincide with the static mesh as they have the same size.

Observed Result

The debug_draw box will have a side length of 1024, when the Extent on each dimension is 512.

Platform(s)

Windows 11, UEFN 29.40

Additional Notes

Changing the Extent editable in the example to half the static mesh’s side length makes them coincide, so this is of course an easy workaround. However, if this is the intended behavior, the documentation should be updated (according to Debug Your Game With Debug Draw | Unreal Editor For Fortnite Documentation | Epic Developer Community , ?Extent:vector3 Sets the length, width, and depth of the box)

IIRC, UE treats boxes as spheres. So think of your dimensions as radii of an ellipsoid perpendicular to the primary axes.
Basically: divide your dimensions by 2.0

I agree, I think the wording is incorrect, I imagine what they actually mean is “Half Extent”, meaning the distance from the Center point to the outer bounds which is literally just Extent divided by 2. So they either need to update the parameter name and docs to reflect this or change the draw function to actually use Extent. Either way, just dividing by 2 will fix this for now.