Skip to content

Commit 8f8c19b

Browse files
committed
Include orientation in CFrame formatting
CFrames now display both position and rotation components to properly show changes when objects are rotated, not just translated. Format: (X, Y, Z), (rotX°, rotY°, rotZ°)
1 parent 29113c4 commit 8f8c19b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugin/src/App/Components/PatchVisualizer/DisplayValue.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ local function DisplayValue(props)
2929
text = string.format("{%s, %s}, {%s, %s}", fmtNum(x.Scale), fmtNum(x.Offset), fmtNum(y.Scale), fmtNum(y.Offset))
3030
elseif t == "CFrame" then
3131
local p = props.value.Position
32-
text = string.format("(%s, %s, %s)", fmtNum(p.X), fmtNum(p.Y), fmtNum(p.Z))
32+
local rx, ry, rz = props.value:ToOrientation()
33+
text = string.format("(%s, %s, %s), (%s°, %s°, %s°)",
34+
fmtNum(p.X), fmtNum(p.Y), fmtNum(p.Z),
35+
fmtNum(math.deg(rx)), fmtNum(math.deg(ry)), fmtNum(math.deg(rz)))
3336
elseif t == "NumberRange" then
3437
text = string.format("[%s, %s]", fmtNum(props.value.Min), fmtNum(props.value.Max))
3538
end

0 commit comments

Comments
 (0)