summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/PitchWidget.java
blob: c6e741ad0f4c4eae91e36024e21aecea64429024 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package NET.worlds.scape;

class PitchWidget extends WidgetButton {
   public PitchWidget(ToolBar toolbar) {
      super(toolbar, "pitch.gif", "Pitch");
   }

   @Override
   public String drag(boolean initialDrag, float deltax, float deltay) {
      if (Math.abs(deltax) > Math.abs(deltay)) {
         deltay = 0.0F;
      }

      Transform t = Transform.make();
      this.applyWorldTransform(initialDrag, t.spin(this.getWorldAxis(1, 0, 0), -deltay));
      t.recycle();
      return "Pitch";
   }
}