local module = class("modulePetSceneMod", G_UIModuleBase)

function module.bind()
  return {}
end

function module.methods()
  return {
    dragBegin = function(self, pos)
      self.deltaX = 0
      self.modEuler = L_Vector3.new(0, self.modEuler.y + self.deltaX, 0)
      L_PetManager:setScenePetRot(self.modEuler)
      self.oldDragX = pos.x
    end,
    drag = function(self, pos)
      self.deltaX = (self.oldDragX - pos.x) * 0.3
      self.modEuler = L_Vector3.new(0, self.modEuler.y + self.deltaX, 0)
      L_PetManager:setScenePetRot(self.modEuler)
      self.oldDragX = pos.x
    end,
    dragEnd = function(self, pos)
      self.deltaX = (self.oldDragX - pos.x) * 0.3
      self.modEuler = L_Vector3.new(0, self.modEuler.y + self.deltaX, 0)
      L_PetManager:setScenePetRot(self.modEuler)
      self.oldDragX = pos.x
    end
  }
end

function module:created(...)
  module.super.created(self, ...)
end

function module:open()
  self.modEuler = L_Vector3.zero
  self.deltaX = 0
  self.oldDragX = 0
  L_PetManager:loadPetDetailScene()
end

function module:close()
  L_PetManager:removePetScene()
end

function module:show()
  L_PetManager:setSceneArtActive(true)
end

function module:hide()
  L_PetManager:setSceneArtActive(false)
end

function module:refreshPetMod(configId, isSpecial, isFlash)
  L_PetManager:loadPetModel(configId, isSpecial, isFlash)
end

function module:refreshBlackPet(configId)
  L_PetManager:loadBlackPetModel(configId)
end

function module:disableMod()
end

function module:setCameraOffset(offset)
  L_PetManager:setCameraNodeRotOffset(offset)
end

function module:setCameraPosOffset(offset)
  L_PetManager:setCameraNodePosOffset(offset)
end

return module
