示例#1
0
    public void update(int mouseX, int mouseY) {
      float mx = mouseX / radius;
      float my = mouseY / radius;

      boolean buttonState = Mouse.isButtonDown(mouseButton);
      if (!isDragging && buttonState) {
        isDragging = true;
        target.startDrag(mx, my);
      } else if (isDragging && !buttonState) {
        isDragging = false;
        target.endDrag(mx, my);
      }

      target.applyTransform(mx, my, isDragging);
    }
示例#2
0
 public void setTransform(Matrix4f transform) {
   target.lastTransform = transform;
 }