-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local Element = TS.import(script, script.Parent.Parent, "generic").Element local CustomViewportFrame do local super = Element CustomViewportFrame = setmetatable({}, { __tostring = function() return "CustomViewportFrame" end, __index = super, }) CustomViewportFrame.__index = CustomViewportFrame function CustomViewportFrame.new(...) local self = setmetatable({}, CustomViewportFrame) return self:constructor(...) or self end function CustomViewportFrame:constructor(element, childs) super.constructor(self, element, childs) self.worldModel = Instance.new("WorldModel") self.worldModel.Parent = self.element end function CustomViewportFrame:addCamera() if not self.camera then self.camera = Instance.new("Camera") self.camera.Parent = self.element self.element.CurrentCamera = self.camera end end function CustomViewportFrame:setCameraCFrame(cf) if self.camera then self.camera.CFrame = cf end end function CustomViewportFrame:render(instance) instance.Parent = self.worldModel end function CustomViewportFrame:clearRenderItems(checker) local _exp = self.worldModel:GetChildren() -- ▼ ReadonlyArray.forEach ▼ local _callback = function(x) if checker(x) then x:Destroy() end end for _k, _v in _exp do _callback(_v, _k - 1, _exp) end -- ▲ ReadonlyArray.forEach ▲ end function CustomViewportFrame:getCameraCFrame() if self.camera then return self.camera.CFrame end end function CustomViewportFrame:bindToValue(value) warn("bindToValue is not implemented on ViewportFrames!") end end return { CustomViewportFrame = CustomViewportFrame, }