diff --git a/direct/src/cluster/ClusterConfig.py b/direct/src/cluster/ClusterConfig.py index 3b0c6acfa3..cee0d919c7 100644 --- a/direct/src/cluster/ClusterConfig.py +++ b/direct/src/cluster/ClusterConfig.py @@ -33,35 +33,7 @@ ClientConfigs = { 'pos' : Vec3(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), 'hpr' : Vec3(51.213, 0.000, 0.000), 'focal length' : 0.809, @@ -84,7 +56,7 @@ ClientConfigs = { 'film offset' : (-0.000, 0.173), }, ], - 'cavetest' : [{'display name' : 'master', + 'seamless-cave' : [{'display name' : 'master', 'display mode' : 'client', 'pos' : Vec3(-0.105, -0.020, 5.000), 'hpr' : Vec3(-0.370, 0.000, 0.000), @@ -135,51 +107,258 @@ ClientConfigs = { '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', 'pos': Vec3(0), 'hpr': Vec3(0), @@ -230,5 +409,17 @@ ClientConfigs = { '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)} + ], } diff --git a/direct/src/directdevices/DirectDeviceManager.py b/direct/src/directdevices/DirectDeviceManager.py index 91345f0b8f..9b4436f257 100644 --- a/direct/src/directdevices/DirectDeviceManager.py +++ b/direct/src/directdevices/DirectDeviceManager.py @@ -132,7 +132,7 @@ class DirectAnalogs(AnalogNode, DirectObject): val = min( max( val, self.analogMin ), self.analogMax ) # Normalize values to given minVal and maxVal range 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): @@ -148,12 +148,12 @@ class DirectAnalogs(AnalogNode, DirectObject): val *= sf # Clamp value between min and max and scale around center if (val >= center): - val = (val - center) / (max - center) + val = (val - center) / float(max - center) else: - val = (val - center) / (center - min) + val = (val - center) / float(center - min) # Normalize values to given minVal and maxVal range return (((maxVal - minVal) * - ((val - min) / range)) + minVal) + ((val - min) / float(range))) + minVal) def normalizeChannel(self, chan, minVal = -1, maxVal = 1, sf = 1.0): try: diff --git a/direct/src/directutil/Mopath.py b/direct/src/directutil/Mopath.py index fb8fb0cf77..f08b986cef 100644 --- a/direct/src/directutil/Mopath.py +++ b/direct/src/directutil/Mopath.py @@ -15,6 +15,8 @@ class Mopath(PandaObject): self.tPoint = Point3(0) self.posPoint = Point3(0) self.hprPoint = Point3(0) + self.tangentVec = Vec3(0) + self.fFaceForward = 0 self.reset() def getMaxT(self): @@ -99,6 +101,9 @@ class Mopath(PandaObject): if (self.hprNurbsCurve != None): self.hprNurbsCurve.getPoint(self.playbackTime, 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): if (self.xyzNurbsCurve == None) and (self.hprNurbsCurve == None): diff --git a/direct/src/extensions/CInterval-extensions.py b/direct/src/extensions/CInterval-extensions.py index 72401270a7..8be14c84f3 100644 --- a/direct/src/extensions/CInterval-extensions.py +++ b/direct/src/extensions/CInterval-extensions.py @@ -43,8 +43,8 @@ tl.title('Interval Controls') outerFrame = Frame(tl) def entryScaleCommand(t,s=self): - s.pause() s.setT(t) + s.pause() self.es = es = EntryScale.EntryScale( outerFrame, text = self.getName(), min = 0, max = math.floor(self.getDuration() * 100) / 100, @@ -54,11 +54,11 @@ bf = Frame(outerFrame) # Jump to start and end def toStart(s=self, es=es): - s.pause() s.setT(0.0) - def toEnd(s=self): s.pause() + def toEnd(s=self): s.setT(s.getDuration()) + s.pause() jumpToStart = Button(bf, text = '<<', command = toStart) # Stop/play buttons def doPlay(s=self, es=es): diff --git a/direct/src/interval/Interval.py b/direct/src/interval/Interval.py index c55b48bfd6..0071c3ddff 100644 --- a/direct/src/interval/Interval.py +++ b/direct/src/interval/Interval.py @@ -352,8 +352,8 @@ class Interval(DirectObject): tl.title('Interval Controls') outerFrame = Frame(tl) def entryScaleCommand(t,s=self): - s.pause() s.setT(t) + s.pause() self.es = es = EntryScale.EntryScale( outerFrame, text = self.getName(), min = 0, max = math.floor(self.getDuration() * 100) / 100, @@ -365,9 +365,11 @@ class Interval(DirectObject): def toStart(s=self, es=es): s.pause() s.setT(0.0) + s.pause() def toEnd(s=self): s.pause() s.setT(s.getDuration()) + s.pause() jumpToStart = Button(bf, text = '<<', command = toStart) # Stop/play buttons def doPlay(s=self, es=es):