|
@@ -36,6 +36,8 @@ class ShowBase:
|
|
|
self.wantDIRECT = self.config.GetBool('want-directtools', 0)
|
|
self.wantDIRECT = self.config.GetBool('want-directtools', 0)
|
|
|
self.wantStats = self.config.GetBool('want-stats', 0)
|
|
self.wantStats = self.config.GetBool('want-stats', 0)
|
|
|
|
|
|
|
|
|
|
+ taskMgr.taskTimerVerbose = self.config.GetBool('task-timer-verbose', 0)
|
|
|
|
|
+
|
|
|
self.initialState = NodeAttributes()
|
|
self.initialState = NodeAttributes()
|
|
|
# Set a default "off color" (i.e. use poly color) for color transitions
|
|
# Set a default "off color" (i.e. use poly color) for color transitions
|
|
|
self.initialState.setAttribute(ColorTransition.getClassType(),
|
|
self.initialState.setAttribute(ColorTransition.getClassType(),
|
|
@@ -61,7 +63,7 @@ class ShowBase:
|
|
|
# stores a CollisionTraverser pointer here, we'll traverse it
|
|
# stores a CollisionTraverser pointer here, we'll traverse it
|
|
|
# in the igloop task.
|
|
# in the igloop task.
|
|
|
self.cTrav = 0
|
|
self.cTrav = 0
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
# This is a list of cams associated with the display region's cameras
|
|
# This is a list of cams associated with the display region's cameras
|
|
|
self.camList = []
|
|
self.camList = []
|
|
|
for camera in self.cameraList:
|
|
for camera in self.cameraList:
|
|
@@ -131,7 +133,7 @@ class ShowBase:
|
|
|
# Particle manager
|
|
# Particle manager
|
|
|
self.particleMgr = particleMgr
|
|
self.particleMgr = particleMgr
|
|
|
self.particleMgr.setFrameStepping(1)
|
|
self.particleMgr.setFrameStepping(1)
|
|
|
- self.particleMgrEnabled = 0
|
|
|
|
|
|
|
+ self.particleMgrEnabled = 0
|
|
|
|
|
|
|
|
# Physics manager
|
|
# Physics manager
|
|
|
self.physicsMgr = physicsMgr
|
|
self.physicsMgr = physicsMgr
|
|
@@ -166,8 +168,8 @@ class ShowBase:
|
|
|
|
|
|
|
|
def disableParticles(self):
|
|
def disableParticles(self):
|
|
|
"""enableParticles(self)"""
|
|
"""enableParticles(self)"""
|
|
|
- self.particleMgrEnabled = 0
|
|
|
|
|
- self.physicsMgrEnabled = 0
|
|
|
|
|
|
|
+ self.particleMgrEnabled = 0
|
|
|
|
|
+ self.physicsMgrEnabled = 0
|
|
|
self.taskMgr.removeTasksNamed('manager-update')
|
|
self.taskMgr.removeTasksNamed('manager-update')
|
|
|
|
|
|
|
|
def toggleParticles(self):
|
|
def toggleParticles(self):
|
|
@@ -188,7 +190,7 @@ class ShowBase:
|
|
|
if (self.particleMgrEnabled == 1):
|
|
if (self.particleMgrEnabled == 1):
|
|
|
self.particleMgr.doParticles(dt)
|
|
self.particleMgr.doParticles(dt)
|
|
|
if (self.physicsMgrEnabled == 1):
|
|
if (self.physicsMgrEnabled == 1):
|
|
|
- self.physicsMgr.doPhysics(dt)
|
|
|
|
|
|
|
+ self.physicsMgr.doPhysics(dt)
|
|
|
return Task.cont
|
|
return Task.cont
|
|
|
|
|
|
|
|
def createStats(self):
|
|
def createStats(self):
|
|
@@ -200,7 +202,7 @@ class ShowBase:
|
|
|
def createAudioManager(self):
|
|
def createAudioManager(self):
|
|
|
if self.wantSound:
|
|
if self.wantSound:
|
|
|
AudioManager.spawnUpdate()
|
|
AudioManager.spawnUpdate()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
def createRootPanel(self):
|
|
def createRootPanel(self):
|
|
|
if self.wantTk:
|
|
if self.wantTk:
|
|
|
from TkGlobal import *
|
|
from TkGlobal import *
|
|
@@ -224,9 +226,9 @@ class ShowBase:
|
|
|
|
|
|
|
|
# Finally, render the frame.
|
|
# Finally, render the frame.
|
|
|
self.win.update()
|
|
self.win.update()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return Task.cont
|
|
return Task.cont
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
def restart(self):
|
|
def restart(self):
|
|
|
self.shutdown()
|
|
self.shutdown()
|
|
|
# give the igloop task a reasonably "late" priority,
|
|
# give the igloop task a reasonably "late" priority,
|
|
@@ -330,7 +332,7 @@ class ShowBase:
|
|
|
|
|
|
|
|
# If oobeMode was never set, set it to false and create the
|
|
# If oobeMode was never set, set it to false and create the
|
|
|
# structures we need to implement OOBE.
|
|
# structures we need to implement OOBE.
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try:
|
|
try:
|
|
|
self.oobeMode
|
|
self.oobeMode
|
|
|
except:
|
|
except:
|
|
@@ -388,14 +390,14 @@ class ShowBase:
|
|
|
mat = Mat4.translateMat(0, -10, 3) * base.camera.getMat(cameraParent)
|
|
mat = Mat4.translateMat(0, -10, 3) * base.camera.getMat(cameraParent)
|
|
|
mat.invertInPlace()
|
|
mat.invertInPlace()
|
|
|
self.oobeTrackball.node().setMat(mat)
|
|
self.oobeTrackball.node().setMat(mat)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
self.cam.reparentTo(self.oobeCameraTrackball)
|
|
self.cam.reparentTo(self.oobeCameraTrackball)
|
|
|
if not self.oobeVis.isEmpty():
|
|
if not self.oobeVis.isEmpty():
|
|
|
self.oobeVis.reparentTo(self.camera)
|
|
self.oobeVis.reparentTo(self.camera)
|
|
|
self.oobeMode = 1
|
|
self.oobeMode = 1
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def run(self):
|
|
def run(self):
|
|
|
self.taskMgr.run()
|
|
self.taskMgr.run()
|
|
|
|
|
|