Browse Source

Fixed joybox resolution problem, and interval jumptostart and end commands

Mark Mine 22 years ago
parent
commit
317713f789

+ 266 - 75
direct/src/cluster/ClusterConfig.py

@@ -33,35 +33,7 @@ ClientConfigs = {
                               'pos' : Vec3(0),
                               'pos' : Vec3(0),
                               'hpr' : Vec3(-30,0,0)}
                               'hpr' : Vec3(-30,0,0)}
                              ],
                              ],
-    'carttest'            : [{'display name' : 'master',
-                              'display mode' : 'client',
-                              'pos' : Vec3(0),
-                              'hpr' : Vec3(0),
-                              },
-                             {'display name' : 'left',
-                              'pos' : Vec3(-.105,0,0),
-                              'hpr' : Vec3(0,0,-90)},
-                             {'display name' : 'right',
-                              'pos' : Vec3(.105,0,0),
-                              'hpr' : Vec3(0,0,-90)}
-                             ],
-    'parallax-two-server' : [{'display name' : 'master',
-                              'display mode' : 'client',
-                              'pos' : Vec3(0),
-                              'hpr' : Vec3(0)},
-                             {'display name' : 'la',
-                              'pos' : Vec3(0),
-                              'hpr' : Vec3(0)}
-                             ],
-    'mono-modelcave-pipe0': [{'display name' : 'display0',
-                              'display mode' : 'client',
-                              'pos' : Vec3(0),
-                              'hpr' : Vec3(0)},
-                             {'display name' : 'display1',
-                              'pos' : Vec3(0),
-                              'hpr' : Vec3(0)}
-                             ],
-    'cavetest3'   : [{'display name' : 'la',
+    'mono-cave'   : [{'display name' : 'la',
                       'pos' : Vec3(-0.105, -0.020, 5.000),
                       'pos' : Vec3(-0.105, -0.020, 5.000),
                       'hpr' : Vec3(51.213, 0.000, 0.000),
                       'hpr' : Vec3(51.213, 0.000, 0.000),
                       'focal length' : 0.809,
                       'focal length' : 0.809,
@@ -84,7 +56,7 @@ ClientConfigs = {
                       'film offset' : (-0.000, 0.173),
                       'film offset' : (-0.000, 0.173),
                       },
                       },
                      ],
                      ],
-    'cavetest'        : [{'display name' : 'master',
+    'seamless-cave'   : [{'display name' : 'master',
                           'display mode' : 'client',
                           'display mode' : 'client',
                           'pos' : Vec3(-0.105, -0.020, 5.000),
                           'pos' : Vec3(-0.105, -0.020, 5.000),
                           'hpr' : Vec3(-0.370, 0.000, 0.000),
                           'hpr' : Vec3(-0.370, 0.000, 0.000),
@@ -135,51 +107,258 @@ ClientConfigs = {
                           'film offset' : (-0.000, 0.173),
                           'film offset' : (-0.000, 0.173),
                           },
                           },
                          ],
                          ],
-    'cavetest5'        : [{'display name' : 'master',
-                          'display mode' : 'client',
-                          'pos' : Vec3(-0.105, -0.020, 5.000),
-                          'hpr' : Vec3(-0.370, 0.000, 0.000),
-                          'focal length' : 0.815,
-                          'film size' : (1.000, 0.831),
-                          'film offset' : (0.000, 0.173),
-                          },
-                         {'display name' : 'la',
-                          'pos' : Vec3(-0.105, -0.020, 5.000),
-                          'hpr' : Vec3(51.213, 0.000, 0.000),
-                          'focal length' : 0.809,
-                          'film size' : (1.000, 0.831),
-                          'film offset' : (0.000, 0.173),
-                          },
-                         {'display name' : 'lb',
-                          'pos' : Vec3(-0.105, -0.020, 5.000),
-                          'hpr' : Vec3(-0.370, 0.000, 0.000),
-                          'focal length' : 0.815,
-                          'film size' : (1.000, 0.831),
-                          'film offset' : (0.000, 0.173),
-                          },
-                         {'display name' : 'lc',
-                          'pos' : Vec3(-0.105, -0.020, 5.000),
-                          'hpr' : Vec3(-51.675, 0.000, 0.000),
-                          'focal length' : 0.820,
-                          'film size' : (1.000, 0.830),
-                          'film offset' : (-0.000, 0.173),
-                          },
-                         {'display name' : 'ra',
-                          'pos' : Vec3(0.105, -0.020, 5.000),
-                          'hpr' : Vec3(51.675, 0.000, 0.000),
-                          'focal length' : 0.820,
-                          'film size' : (1.000, 0.830),
-                          'film offset' : (0.000, 0.173),
-                          },
-                         {'display name' : 'rb',
-                          'pos' : Vec3(0.105, -0.020, 5.000),
-                          'hpr' : Vec3(0.370, 0.000, 0.000),
-                          'focal length' : 0.815,
-                          'film size' : (1.000, 0.831),
-                          'film offset' : (0.000, 0.173),
-                          },
-                         ],
-    'parallaxtest'        : [{'display name' : 'master',
+    'nemo-cave'        : [{'display name' : 'master',
+                           'display mode' : 'client',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'la',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(51.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'lb',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'lc',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-51.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (-0.000, 0.173),
+                           },
+                          {'display name' : 'ra',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(51.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rb',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rc',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-51.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (-0.000, 0.173),
+                           },
+                          {'display name' : 'lAudienceL',
+                           'pos' : Vec3(-4.895, -0.020, 5.000),
+                           'hpr' : Vec3(51.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rAudienceL',
+                           'pos' : Vec3(-5.105, -8.0, 5.000),
+                           'hpr' : Vec3(51.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'lAudienceR',
+                           'pos' : Vec3(5.105, -0.020, 5.000),
+                           'hpr' : Vec3(-51.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rAudienceR',
+                           'pos' : Vec3(4.895, -8.0, 5.000),
+                           'hpr' : Vec3(-51.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          ],
+    'nemo-cave-narrow' : [{'display name' : 'master',
+                           'display mode' : 'client',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'la',
+                           'pos' : Vec3(-0.105, -19.890, 5.000),
+                           'hpr' : Vec3(51.500, 0.000, 0.000),
+                           'focal length' : 1.662,
+                           'film size' : (1.000, 0.828),
+                           'film offset' : (1.079, 0.173),
+                           },
+                          {'display name' : 'lb',
+                           'pos' : Vec3(-0.105, -19.890, 5.000),
+                           'hpr' : Vec3(0.000, 0.000, 0.000),
+                           'focal length' : 2.186,
+                           'film size' : (1.000, 0.828),
+                           'film offset' : (0.007, 0.173),
+                           },
+                          {'display name' : 'lc',
+                           'pos' : Vec3(-0.105, -19.890, 5.000),
+                           'hpr' : Vec3(-51.500, 0.000, 0.000),
+                           'focal length' : 1.673,
+                           'film size' : (1.000, 0.828),
+                           'film offset' : (-1.070, 0.173),
+                           },
+                          {'display name' : 'ra',
+                           'pos' : Vec3(0.105, -19.890, 5.000),
+                           'hpr' : Vec3(51.500, 0.000, 0.000),
+                           'focal length' : 1.673,
+                           'film size' : (1.000, 0.828),
+                           'film offset' : (1.070, 0.173),
+                           },
+                          {'display name' : 'rb',
+                           'pos' : Vec3(0.105, -19.890, 5.000),
+                           'hpr' : Vec3(0.000, 0.000, 0.000),
+                           'focal length' : 2.186,
+                           'film size' : (1.000, 0.828),
+                           'film offset' : (-0.007, 0.173),
+                           },
+                          {'display name' : 'rc',
+                           'pos' : Vec3(0.105, -19.890, 5.000),
+                           'hpr' : Vec3(-51.500, 0.000, 0.000),
+                           'focal length' : 1.662,
+                           'film size' : (1.000, 0.828),
+                           'film offset' : (-1.079, 0.173),
+                           },
+                          {'display name' : 'lAudienceL',
+                           'pos' : Vec3(-0.105, -19.890, 5.000),
+                           'hpr' : Vec3(55.706, 0.000, 0.000),
+                           'focal length' : 1.225,
+                           'film size' : (1.000, 0.762),
+                           'film offset' : (-0.195, 0.095),
+                           },
+                          {'display name' : 'rAudienceL',
+                           'pos' : Vec3(0.105, -19.890, 5.000),
+                           'hpr' : Vec3(55.706, 0.000, 0.000),
+                           'focal length' : 1.241,
+                           'film size' : (1.000, 0.762),
+                           'film offset' : (-0.206, 0.095),
+                           },
+                          {'display name' : 'lAudienceR',
+                           'pos' : Vec3(-0.105, -19.890, 5.000),
+                           'hpr' : Vec3(-62.162, 0.000, 0.000),
+                           'focal length' : 1.554,
+                           'film size' : (1.000, 0.801),
+                           'film offset' : (-0.026, 0.100),
+                           },
+                          {'display name' : 'rAudienceR',
+                           'pos' : Vec3(0.105, -19.890, 5.000),
+                           'hpr' : Vec3(-62.162, 0.000, 0.000),
+                           'focal length' : 1.536,
+                           'film size' : (1.000, 0.801),
+                           'film offset' : (-0.036, 0.100),
+                           },
+                          {'display name' : 'lCart',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rCart',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          ],
+    'fourd-cave'        : [{'display name' : 'master',
+                            'display mode' : 'client',
+                            'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'la',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(51.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'lb',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'lc',
+                           'pos' : Vec3(-0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-51.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (-0.000, 0.173),
+                           },
+                          {'display name' : 'ra',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(51.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rb',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(0.370, 0.000, 0.000),
+                           'focal length' : 0.815,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rc',
+                           'pos' : Vec3(0.105, -0.020, 5.000),
+                           'hpr' : Vec3(-51.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (-0.000, 0.173),
+                           },
+                          {'display name' : 'lAudienceL',
+                           'pos' : Vec3(-4.895, -0.020, 5.000),
+                           'hpr' : Vec3(65.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rAudienceL',
+                           'pos' : Vec3(-5.105, -8.0, 5.000),
+                           'hpr' : Vec3(65.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'lAudienceR',
+                           'pos' : Vec3(5.105, -0.020, 5.000),
+                           'hpr' : Vec3(-65.213, 0.000, 0.000),
+                           'focal length' : 0.809,
+                           'film size' : (1.000, 0.831),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          {'display name' : 'rAudienceR',
+                           'pos' : Vec3(4.895, -8.0, 5.000),
+                           'hpr' : Vec3(-65.675, 0.000, 0.000),
+                           'focal length' : 0.820,
+                           'film size' : (1.000, 0.830),
+                           'film offset' : (0.000, 0.173),
+                           },
+                          ],
+    'parallax-cave'        : [{'display name' : 'master',
                               'display mode' : 'client',
                               'display mode' : 'client',
                               'pos': Vec3(0),
                               'pos': Vec3(0),
                               'hpr': Vec3(0),
                               'hpr': Vec3(0),
@@ -230,5 +409,17 @@ ClientConfigs = {
                               'film offset' : (-0.000, 0.173),
                               'film offset' : (-0.000, 0.173),
                               },
                               },
                              ],
                              ],
+    'carttest'            : [{'display name' : 'master',
+                              'display mode' : 'client',
+                              'pos' : Vec3(0),
+                              'hpr' : Vec3(0),
+                              },
+                             {'display name' : 'left',
+                              'pos' : Vec3(-.105,0,0),
+                              'hpr' : Vec3(0,0,-90)},
+                             {'display name' : 'right',
+                              'pos' : Vec3(.105,0,0),
+                              'hpr' : Vec3(0,0,-90)}
+                             ],
     }
     }
 
 

+ 4 - 4
direct/src/directdevices/DirectDeviceManager.py

@@ -132,7 +132,7 @@ class DirectAnalogs(AnalogNode, DirectObject):
         val = min( max( val, self.analogMin ), self.analogMax )
         val = min( max( val, self.analogMin ), self.analogMax )
         # Normalize values to given minVal and maxVal range
         # Normalize values to given minVal and maxVal range
         return (((maxVal - minVal) *
         return (((maxVal - minVal) *
-                 ((val - self.analogMin) / self.analogRange)) + minVal)
+                 ((val - self.analogMin) / float(self.analogRange))) + minVal)
 
 
 
 
     def normalize(self, val, minVal = -1, maxVal = 1, sf = 1.0):
     def normalize(self, val, minVal = -1, maxVal = 1, sf = 1.0):
@@ -148,12 +148,12 @@ class DirectAnalogs(AnalogNode, DirectObject):
         val *= sf
         val *= sf
         # Clamp value between min and max and scale around center
         # Clamp value between min and max and scale around center
         if (val >= center):
         if (val >= center):
-            val = (val - center) / (max - center)
+            val = (val - center) / float(max - center)
         else:
         else:
-            val = (val - center) / (center - min)            
+            val = (val - center) / float(center - min)            
         # Normalize values to given minVal and maxVal range
         # Normalize values to given minVal and maxVal range
         return (((maxVal - minVal) *
         return (((maxVal - minVal) *
-                 ((val - min) / range)) + minVal)
+                 ((val - min) / float(range))) + minVal)
             
             
     def normalizeChannel(self, chan, minVal = -1, maxVal = 1, sf = 1.0):
     def normalizeChannel(self, chan, minVal = -1, maxVal = 1, sf = 1.0):
         try:
         try:

+ 5 - 0
direct/src/directutil/Mopath.py

@@ -15,6 +15,8 @@ class Mopath(PandaObject):
         self.tPoint = Point3(0)
         self.tPoint = Point3(0)
         self.posPoint = Point3(0)
         self.posPoint = Point3(0)
         self.hprPoint = Point3(0)
         self.hprPoint = Point3(0)
+        self.tangentVec = Vec3(0)
+        self.fFaceForward = 0
         self.reset()
         self.reset()
 
 
     def getMaxT(self):
     def getMaxT(self):
@@ -99,6 +101,9 @@ class Mopath(PandaObject):
         if (self.hprNurbsCurve != None):
         if (self.hprNurbsCurve != None):
             self.hprNurbsCurve.getPoint(self.playbackTime, self.hprPoint)
             self.hprNurbsCurve.getPoint(self.playbackTime, self.hprPoint)
             node.setHpr(self.hprPoint)
             node.setHpr(self.hprPoint)
+        elif (self.fFaceForward and (self.xyzNurbsCurve != None)):
+            self.xyzNurbsCurve.getTangent(self.playbackTime, self.tangentVec)
+            node.lookAt(Point3(self.posPoint + self.tangentVec))
 
 
     def play(self, node, time = 0.0, loop = 0):
     def play(self, node, time = 0.0, loop = 0):
         if (self.xyzNurbsCurve == None) and (self.hprNurbsCurve == None):
         if (self.xyzNurbsCurve == None) and (self.hprNurbsCurve == None):

+ 3 - 3
direct/src/extensions/CInterval-extensions.py

@@ -43,8 +43,8 @@
             tl.title('Interval Controls')
             tl.title('Interval Controls')
         outerFrame = Frame(tl)
         outerFrame = Frame(tl)
         def entryScaleCommand(t,s=self):
         def entryScaleCommand(t,s=self):
-            s.pause()
             s.setT(t)
             s.setT(t)
+            s.pause()
         self.es = es = EntryScale.EntryScale(
         self.es = es = EntryScale.EntryScale(
             outerFrame, text = self.getName(),
             outerFrame, text = self.getName(),
             min = 0, max = math.floor(self.getDuration() * 100) / 100,
             min = 0, max = math.floor(self.getDuration() * 100) / 100,
@@ -54,11 +54,11 @@
         bf = Frame(outerFrame)
         bf = Frame(outerFrame)
         # Jump to start and end
         # Jump to start and end
         def toStart(s=self, es=es):
         def toStart(s=self, es=es):
-            s.pause()
             s.setT(0.0)
             s.setT(0.0)
-        def toEnd(s=self):
             s.pause()
             s.pause()
+        def toEnd(s=self):
             s.setT(s.getDuration())
             s.setT(s.getDuration())
+            s.pause()
         jumpToStart = Button(bf, text = '<<', command = toStart)
         jumpToStart = Button(bf, text = '<<', command = toStart)
         # Stop/play buttons
         # Stop/play buttons
         def doPlay(s=self, es=es):
         def doPlay(s=self, es=es):

+ 3 - 1
direct/src/interval/Interval.py

@@ -352,8 +352,8 @@ class Interval(DirectObject):
             tl.title('Interval Controls')
             tl.title('Interval Controls')
         outerFrame = Frame(tl)
         outerFrame = Frame(tl)
         def entryScaleCommand(t,s=self):
         def entryScaleCommand(t,s=self):
-            s.pause()
             s.setT(t)
             s.setT(t)
+            s.pause()
         self.es = es = EntryScale.EntryScale(
         self.es = es = EntryScale.EntryScale(
             outerFrame, text = self.getName(),
             outerFrame, text = self.getName(),
             min = 0, max = math.floor(self.getDuration() * 100) / 100,
             min = 0, max = math.floor(self.getDuration() * 100) / 100,
@@ -365,9 +365,11 @@ class Interval(DirectObject):
         def toStart(s=self, es=es):
         def toStart(s=self, es=es):
             s.pause()
             s.pause()
             s.setT(0.0)
             s.setT(0.0)
+            s.pause()
         def toEnd(s=self):
         def toEnd(s=self):
             s.pause()
             s.pause()
             s.setT(s.getDuration())
             s.setT(s.getDuration())
+            s.pause()
         jumpToStart = Button(bf, text = '<<', command = toStart)
         jumpToStart = Button(bf, text = '<<', command = toStart)
         # Stop/play buttons
         # Stop/play buttons
         def doPlay(s=self, es=es):
         def doPlay(s=self, es=es):