rojo-rbx / rbx-dom

Roblox DOM and (de)serialization implementation in Rust
MIT License
105 stars 42 forks source link

Changed WorldPivotData getter/setter to WorldPivot #408

Closed phoriah closed 2 months ago

phoriah commented 2 months ago

GetPivot / PivotTo don't always reflect the value of WorldPivotData, actual value of which is reflected through WorldPivot (as mentioned in the #179 ) This can be observed by running the following tests in Studio

local Model = Instance.new("Model")
local Part = Instance.new("Part")

Part.Parent = Model

Model.PrimaryPart = Part -- If PrimaryPart doesn't exist then WorldPivot == GetPivot (Pretty sure)

Model.Name = "WPDTest"
Model.Parent = workspace
Model.WorldPivot *= CFrame.new(2.1, 2.3, 2.5) -- Try swapping this with PivotTo

local WorldPivot, GetPivot = Model.WorldPivot, Model:GetPivot()

print(WorldPivot)
warn(GetPivot)
print(WorldPivot == GetPivot)
-- Save the file & see it's contents
phoriah commented 2 months ago

There might be other files that also need changing..

Dekkonot commented 2 months ago

Believe this is the only file that needs to be changed. Thank you.