瀏覽代碼

*** empty log message ***

Mark Mine 25 年之前
父節點
當前提交
cab048ed43
共有 2 個文件被更改,包括 13 次插入14 次删除
  1. 11 14
      direct/src/directdevices/DirectJoybox.py
  2. 2 0
      direct/src/tkpanels/MopathRecorder.py

+ 11 - 14
direct/src/directdevices/DirectJoybox.py

@@ -57,7 +57,7 @@ class DirectJoybox(PandaObject):
         # Text object to display current mode
         self.readout = OnscreenText.OnscreenText( '', -0.9, -0.95 )
         # List of functions to cycle through
-        self.modeList = [self.joeMode, self.driveMode]
+        self.modeList = [self.joeMode, self.driveMode, self.orbitMode]
         # Pick initial mode
         self.updateFunc = self.joyboxFly
         self.modeName = 'Joe Mode'
@@ -247,26 +247,23 @@ class DirectJoybox(PandaObject):
                     DirectJoybox.hprMultiplier)
         posScale = (self.analogs.normalizeChannel(R_SLIDE, 0.1, 100) *
                     DirectJoybox.xyzMultiplier)
-        rx = hprScale * self.aList[R_LEFT_RIGHT] * self.deltaTime
-        ry = -1 * hprScale * self.aList[R_FWD_BACK] * self.deltaTime
-        h = -1 * hprScale * self.aList[R_TWIST] * self.deltaTime
         r = -0.01 * posScale * self.aList[R_FWD_BACK] * self.deltaTime
+        rx = hprScale * self.aList[R_LEFT_RIGHT] * self.deltaTime
+        ry = hprScale * self.aList[R_TWIST] * self.deltaTime
         x = posScale * self.aList[L_LEFT_RIGHT] * self.deltaTime
         z = posScale * self.aList[L_FWD_BACK] * self.deltaTime
+        h = -1 * hprScale * self.aList[L_TWIST] * self.deltaTime
         # Move dcs
         self.nodePath.setX(self.nodePath, x)
         self.nodePath.setZ(self.nodePath, z)
         self.nodePath.setH(self.nodePath, h)
-        if self.bList[R_STICK]:
-            self.orbitNode(rx, ry, 0)
-        else:
-            self.orbitNode(rx, 0, 0)
-            pos = self.nodePath.getPos(self.refCS)
-            if Vec3(pos).length() < 0.005:
-                pos.set(0,-0.01, 0)
-            # Now move on out
-            pos.assign(pos * (1 + r))
-            self.nodePath.setPos(self.refCS, pos)
+        self.orbitNode(rx, ry, 0)
+        pos = self.nodePath.getPos(self.refCS)
+        if Vec3(pos).length() < 0.005:
+            pos.set(0,-0.01, 0)
+        # Now move on out
+        pos.assign(pos * (1 + r))
+        self.nodePath.setPos(self.refCS, pos)
 
     def orbitNode(self, h, p, r):
         # Position the temp node path at the ref CS

+ 2 - 0
direct/src/tkpanels/MopathRecorder.py

@@ -572,6 +572,8 @@ class MopathRecorder(AppShell, PandaObject):
             # Reset curve fitters
             self.xyzCurveFitter.reset()
             self.hprCurveFitter.reset()
+            # Remove old curve
+            self.nurbsCurveDrawer.hide()
             # Create a new point set to hold raw data
             self.createNewPointSet()
             # Continuous or keyframe?