mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
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°)
This commit is contained in:
parent
29113c4f74
commit
8f8c19b845
1 changed files with 4 additions and 1 deletions
|
|
@ -29,7 +29,10 @@ local function DisplayValue(props)
|
|||
text = string.format("{%s, %s}, {%s, %s}", fmtNum(x.Scale), fmtNum(x.Offset), fmtNum(y.Scale), fmtNum(y.Offset))
|
||||
elseif t == "CFrame" then
|
||||
local p = props.value.Position
|
||||
text = string.format("(%s, %s, %s)", fmtNum(p.X), fmtNum(p.Y), fmtNum(p.Z))
|
||||
local rx, ry, rz = props.value:ToOrientation()
|
||||
text = string.format("(%s, %s, %s), (%s°, %s°, %s°)",
|
||||
fmtNum(p.X), fmtNum(p.Y), fmtNum(p.Z),
|
||||
fmtNum(math.deg(rx)), fmtNum(math.deg(ry)), fmtNum(math.deg(rz)))
|
||||
elseif t == "NumberRange" then
|
||||
text = string.format("[%s, %s]", fmtNum(props.value.Min), fmtNum(props.value.Max))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue