diff --git a/direct/src/showbase/Audio3DManager.py b/direct/src/showbase/Audio3DManager.py
new file mode 100644
index 0000000000..6f0df0011a
--- /dev/null
+++ b/direct/src/showbase/Audio3DManager.py
@@ -0,0 +1,80 @@
+import pandac.AudioSound
+import pandac.AudioManager
+
+class Audio3DManager:
+
+ def __init__(self, audio_manager, listener_target = None):
+ self.audio_manager = audio_manager
+ self.listener_target = listener_target
+
+ self.sound_dict = {}
+
+
+ def attachSoundToObject(self, sound, object):
+ # sound is an AudioSound
+ # object is any Panda object with coordinates
+ for known_object in self.sound_dict.keys():
+ if sound_dict[known_object].count(sound):
+ # This sound is already attached to something
+ return 0
+
+ if not self.sound_dict.has_key(object):
+ self.sound_dict[object] = []
+
+ self.sound_dict[object].append(sound)
+ return 1
+
+
+ def detachSound(self, sound):
+ for known_object in self.sound_dict.keys():
+ if sound_dict[known_object].count(sound):
+ self.sound_dict[known_object].remove()
+ if len(sound_dict[known_object]) == 0:
+ # if there are no other sounds, don't track
+ # the object any more
+ del self.sound_dict[known_object]
+ return 1
+ return 0
+
+
+ def getSoundsOnObject(self, object):
+ if not self.sound_dict.has_key(object):
+ return []
+ sound_list = []
+ sound_list.extend(self.sound_dict[object])
+ return sound_list
+
+
+ def attachListener(self, object):
+ self.listener_target = object
+ return 1
+
+
+ def detachListener(self):
+ self.listener_target = None
+ return 1
+
+
+ def update(self):
+ # Update the positions of all sounds based on the objects
+ # to which they are attached
+ for known_object in self.sound_dict.keys():
+ tracked_sound = 0
+ while tracked_sound < len(self.sound_dict[known_object]):
+ sound = self.sound_dict[known_object][tracked_sound]
+ if self.listener_target:
+ pos = known_object.getPos(self.listener_target)
+ else:
+ pos = known_object.getPos()
+ sound.set3dAttributes(pos[0], pos[1], pos[2], 0,0,0)
+ tracked_sound += 1
+
+ # Update the position of the listener based on the object
+ # to which it is attached
+ if self.listener_target:
+ pos = self.listener_target.getPos()
+ self.audio_manager.audio3dSetListenerAttributes(pos[0], pos[1], pos[2], 0,0,0, 0,1,0, 0,0,1)
+ else:
+ self.audio_manager.audio3dSetListenerAttributes(0,0,0, 0,0,0, 0,1,0, 0,0,1)
+ self.audio_manager.audio3dUpdate()
+ return 1
diff --git a/doc/.project b/doc/.project
new file mode 100644
index 0000000000..29141a9be1
--- /dev/null
+++ b/doc/.project
@@ -0,0 +1,11 @@
+
+
+ panda
+
+
+
+
+
+
+
+
diff --git a/doc/SceneEditor/.project b/doc/SceneEditor/.project
new file mode 100644
index 0000000000..390de7af63
--- /dev/null
+++ b/doc/SceneEditor/.project
@@ -0,0 +1,11 @@
+
+
+ SceneEditor
+
+
+
+
+
+
+
+
diff --git a/doc/SceneEditor/AlignTool.py b/doc/SceneEditor/AlignTool.py
new file mode 100644
index 0000000000..84968fed0b
--- /dev/null
+++ b/doc/SceneEditor/AlignTool.py
@@ -0,0 +1,188 @@
+#################################################################
+# AlignTool.py
+# Written by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004
+#################################################################
+from AppShell import *
+from TkGlobal import *
+
+
+class AlignTool(AppShell):
+ #################################################################
+ # AlignTool(AppShell)
+ #################################################################
+ appversion = '1.0'
+ appname = 'Align Tool'
+ frameWidth = 220
+ frameHeight = 330
+ frameIniPosX = 250
+ frameIniPosY = 250
+ padx = 0
+ pady = 0
+
+
+ def __init__(self, list = [], parent = None, nodePath = None, **kw):
+ # Keep nodePath Data
+ self.nodePath = nodePath
+ self.targetList = list
+ self.targetName = None
+ # Rename App
+ self.appname += (' '+self.nodePath.getName())
+ # Define the megawidget options.
+ optiondefs = (
+ ('title', self.appname, None),
+ )
+ self.defineoptions(kw, optiondefs)
+ if parent == None:
+ self.parent = Toplevel()
+ AppShell.__init__(self, self.parent)
+ self.parent.geometry('%dx%d+%d+%d' % (self.frameWidth, self.frameHeight,self.frameIniPosX,self.frameIniPosY))
+
+ self.initialiseoptions(AlignTool)
+
+ self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
+
+ def appInit(self):
+ return
+
+ def createInterface(self):
+ # The interior of the toplevel panel
+ interior = self.interior()
+ mainFrame = Frame(interior)
+ frame = Frame(mainFrame)
+ self.nameBox = self.createcomponent(
+ 'Align Target', (), None,
+ Pmw.ComboBox, (frame,),
+ labelpos = W, label_text='Target Node:', entry_width = 20, entry_state = DISABLED,
+ selectioncommand = self.setTargetNode,
+ scrolledlist_items = self.targetList)
+ self.nameBox.pack(side=LEFT)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+ group = Pmw.Group(mainFrame, tag_text = 'Setting')
+ group.pack(side=TOP, fill = 'both', expand = 1,pady=5)
+ groupFrame = group.interior()
+ # X and H checkbox
+ frame = Frame(groupFrame)
+ self.alignXVar = IntVar()
+ self.alignXVar.set(False)
+ self.alignXButton = Checkbutton(
+ frame,
+ text = ': Align X',
+ variable = self.alignXVar)
+ self.alignXButton.pack(side=LEFT, expand=False)
+ self.alignHVar = IntVar()
+ self.alignHVar.set(False)
+ self.alignHButton = Checkbutton(
+ frame,
+ text = ': Align H',
+ variable = self.alignHVar)
+ self.alignHButton.pack(side=RIGHT, expand=False)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+
+ groupFrame.pack(side=TOP, fill = 'both', expand = 1,padx=5,pady=5)
+
+ frame = Frame(mainFrame)
+ Button(frame, text='Align', width = 13, command=self.Align_press).pack(side=LEFT)
+ Button(frame, text='OK', width = 13, command=self.ok_press).pack(side=RIGHT)
+ frame.pack(side=BOTTOM, fill = X, expand = 1,pady=5)
+
+ # Y and P checkbox
+ frame = Frame(groupFrame)
+ self.alignYVar = IntVar()
+ self.alignYVar.set(False)
+ self.alignYButton = Checkbutton(
+ frame,
+ text = ': Align Y',
+ variable = self.alignYVar)
+ self.alignYButton.pack(side=LEFT, expand=False)
+ self.alignPVar = IntVar()
+ self.alignPVar.set(False)
+ self.alignPButton = Checkbutton(
+ frame,
+ text = ': Align P',
+ variable = self.alignPVar)
+ self.alignPButton.pack(side=RIGHT, expand=False)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+
+ # Z and R checkbox
+ frame = Frame(groupFrame)
+ self.alignZVar = IntVar()
+ self.alignZVar.set(False)
+ self.alignZButton = Checkbutton(
+ frame,
+ text = ': Align Z',
+ variable = self.alignZVar)
+ self.alignZButton.pack(side=LEFT, expand=False)
+ self.alignRVar = IntVar()
+ self.alignRVar.set(False)
+ self.alignRButton = Checkbutton(
+ frame,
+ text = ': Align R',
+ variable = self.alignRVar)
+ self.alignRButton.pack(side=RIGHT, expand=False)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+
+ # Scale
+ frame = Frame(groupFrame)
+ Label(frame,text='Align Scale:').pack(side=LEFT)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+ frame = Frame(groupFrame)
+ self.alignSXVar = IntVar()
+ self.alignSXVar.set(False)
+ self.alignSXButton = Checkbutton(
+ frame,
+ text = ': X',
+ variable = self.alignSXVar)
+ self.alignSXButton.pack(side=LEFT, expand=False)
+ self.alignSYVar = IntVar()
+ self.alignSYVar.set(False)
+ self.alignSYButton = Checkbutton(
+ frame,
+ text = ': Y',
+ variable = self.alignSYVar)
+ self.alignSYButton.pack(side=LEFT, expand=False)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+ self.alignSZVar = IntVar()
+ self.alignSZVar.set(False)
+ self.alignSZButton = Checkbutton(
+ frame,
+ text = ': Z',
+ variable = self.alignSZVar)
+ self.alignSZButton.pack(side=LEFT, expand=False)
+ frame.pack(side=TOP, fill = X, expand = 1,pady=5)
+
+
+ mainFrame.pack(fill = 'both', expand = 1,padx=7,pady=7)
+
+
+ def createMenuBar(self):
+ self.menuBar.destroy()
+
+ def onDestroy(self, event):
+ messenger.send('ALW_close', [self.nodePath.getName()])
+ '''
+ If you have open any thing, please rewrite here!
+ '''
+ pass
+
+ ###############################
+
+ def ok_press(self):
+ #################################################################
+ # ok_press(self)
+ # Callback function
+ # This function will be called when user click on the "OK" button on the window.
+ #################################################################
+ self.quit()
+
+ def Align_press(self):
+ list = [self.alignXVar.get(), self.alignYVar.get(), self.alignZVar.get(),
+ self.alignHVar.get(), self.alignPVar.get(), self.alignRVar.get(),
+ self.alignSXVar.get(), self.alignSYVar.get(), self.alignSZVar.get()]
+ if self.targetName != None:
+ messenger.send('ALW_align', [self.nodePath, self.targetName, list])
+ return
+
+ def setTargetNode(self,name=None):
+ self.targetName = name
+ return
+
diff --git a/doc/SceneEditor/Dirlight.egg b/doc/SceneEditor/Dirlight.egg
new file mode 100644
index 0000000000..5a9a500370
--- /dev/null
+++ b/doc/SceneEditor/Dirlight.egg
@@ -0,0 +1,575 @@
+ { Z-Up }
+
+ {
+ "MaxEggPlugin nul.max -o 'E:\sshadhan\Desktop\Dirlight.egg'"
+}
+ Tex1 {
+ "DirLight.tif"
+ format { rgb }
+ wrapu { repeat }
+ wrapv { repeat }
+ minfilter { linear_mipmap_linear }
+ magfilter { linear }
+}
+ Box03 {
+ {
+ {
+ 0.204526 0 0 0
+ 0 3.98227e-008 0.204526 0
+ 0 -0.204526 3.98227e-008 0
+ 0 0 0 1
+ }
+ }
+ Box03.verts {
+ 1 {
+ -1.02263 -0.00012118 -1.02263
+ { 0 -0.204526 3.98227e-008 }
+ { 0.537617 0.269239 }
+ }
+ 2 {
+ 1.02263 -0.00012118 -1.02263
+ { 0 -0.204526 3.98227e-008 }
+ { 0.769888 0.269239 }
+ }
+ 3 {
+ 1.02263 -0.000120782 1.02263
+ { 0 -0.204526 3.98227e-008 }
+ { 0.769888 0.501509 }
+ }
+ 4 {
+ -1.02263 -0.000120782 1.02263
+ { 0 -0.204526 3.98227e-008 }
+ { 0.537617 0.501509 }
+ }
+ 5 {
+ -1.02263 3.06777 -1.02263
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.516079 0.378406 }
+ }
+ 6 {
+ 1.02263 3.06777 -1.02263
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.283808 0.378406 }
+ }
+ 7 {
+ 1.02263 -0.00012118 -1.02263
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.283808 0.03 }
+ }
+ 8 {
+ -1.02263 -0.00012118 -1.02263
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.516079 0.03 }
+ }
+ 9 {
+ 1.02263 3.06777 -1.02263
+ { 0.204526 0 0 }
+ { 0.516079 0.759119 }
+ }
+ 10 {
+ 1.02263 3.06777 1.02263
+ { 0.204526 0 0 }
+ { 0.283808 0.759119 }
+ }
+ 11 {
+ 1.02263 -0.000120782 1.02263
+ { 0.204526 0 0 }
+ { 0.283808 0.410713 }
+ }
+ 12 {
+ 1.02263 -0.00012118 -1.02263
+ { 0.204526 0 0 }
+ { 0.516079 0.410713 }
+ }
+ 13 {
+ 1.02263 3.06777 1.02263
+ { 0 3.98227e-008 0.204526 }
+ { 0.262271 0.759119 }
+ }
+ 14 {
+ -1.02263 3.06777 1.02263
+ { 0 3.98227e-008 0.204526 }
+ { 0.03 0.759119 }
+ }
+ 15 {
+ -1.02263 -0.000120782 1.02263
+ { 0 3.98227e-008 0.204526 }
+ { 0.03 0.410713 }
+ }
+ 16 {
+ 1.02263 -0.000120782 1.02263
+ { 0 3.98227e-008 0.204526 }
+ { 0.262271 0.410713 }
+ }
+ 17 {
+ -1.02263 3.06777 1.02263
+ { -0.204526 0 0 }
+ { 0.262271 0.378406 }
+ }
+ 18 {
+ -1.02263 3.06777 -1.02263
+ { -0.204526 0 0 }
+ { 0.03 0.378406 }
+ }
+ 19 {
+ -1.02263 -0.00012118 -1.02263
+ { -0.204526 0 0 }
+ { 0.03 0.03 }
+ }
+ 20 {
+ -1.02263 -0.000120782 1.02263
+ { -0.204526 0 0 }
+ { 0.262271 0.03 }
+ }
+ 21 {
+ -1.02263 3.06777 -1.02263
+ { 0 0.204526 -3.98227e-008 }
+ { 0.537617 0.262271 }
+ }
+ 22 {
+ -1.02263 3.06777 1.02263
+ { 0 0.204526 -3.98227e-008 }
+ { 0.537617 0.03 }
+ }
+ 23 {
+ -0.0931723 3.06777 0.0931723
+ { 0 0.204526 -3.98227e-008 }
+ { 0.643171 0.135554 }
+ }
+ 24 {
+ -0.0931723 3.06777 -0.0931723
+ { 0 0.204526 -3.98227e-008 }
+ { 0.643171 0.156716 }
+ }
+ 25 {
+ 1.02263 3.06777 1.02263
+ { 0 0.204526 -3.98227e-008 }
+ { 0.769888 0.03 }
+ }
+ 26 {
+ 0.0931723 3.06777 0.0931723
+ { 0 0.204526 -3.98227e-008 }
+ { 0.664333 0.135554 }
+ }
+ 27 {
+ 1.02263 3.06777 -1.02263
+ { 0 0.204526 -3.98227e-008 }
+ { 0.769888 0.262271 }
+ }
+ 28 {
+ 0.0931723 3.06777 -0.0931723
+ { 0 0.204526 -3.98227e-008 }
+ { 0.664333 0.156716 }
+ }
+ 29 {
+ -0.0931723 3.06777 -0.0931723
+ { -0.204526 0 0 }
+ { 0.700095 0.508478 }
+ }
+ 30 {
+ -0.0931723 3.06777 0.0931723
+ { -0.204526 0 0 }
+ { 0.721257 0.508478 }
+ }
+ 31 {
+ -0.0931723 7.13171 0.0931715
+ { -0.204526 0 0 }
+ { 0.721257 0.97 }
+ }
+ 32 {
+ -0.0931723 7.13171 -0.0931731
+ { -0.204526 0 0 }
+ { 0.700095 0.97 }
+ }
+ 33 {
+ -0.0931723 3.06777 0.0931723
+ { 0 3.98227e-008 0.204526 }
+ { 0.653846 0.508478 }
+ }
+ 34 {
+ 0.0931723 3.06777 0.0931723
+ { 0 3.98227e-008 0.204526 }
+ { 0.675008 0.508478 }
+ }
+ 35 {
+ 0.0931723 7.13171 0.0931715
+ { 0 3.98227e-008 0.204526 }
+ { 0.675008 0.97 }
+ }
+ 36 {
+ -0.0931723 7.13171 0.0931715
+ { 0 3.98227e-008 0.204526 }
+ { 0.653846 0.97 }
+ }
+ 37 {
+ 0.0931723 3.06777 0.0931723
+ { 0.204526 0 0 }
+ { 0.676971 0.508478 }
+ }
+ 38 {
+ 0.0931723 3.06777 -0.0931723
+ { 0.204526 0 0 }
+ { 0.698133 0.508478 }
+ }
+ 39 {
+ 0.0931723 7.13171 -0.0931731
+ { 0.204526 0 0 }
+ { 0.698133 0.97 }
+ }
+ 40 {
+ 0.0931723 7.13171 0.0931715
+ { 0.204526 0 0 }
+ { 0.676971 0.97 }
+ }
+ 41 {
+ 0.0931723 3.06777 -0.0931723
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.72322 0.508478 }
+ }
+ 42 {
+ -0.0931723 3.06777 -0.0931723
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.744382 0.508478 }
+ }
+ 43 {
+ -0.0931723 7.13171 -0.0931731
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.744382 0.97 }
+ }
+ 44 {
+ 0.0931723 7.13171 -0.0931731
+ { 0 -3.98227e-008 -0.204526 }
+ { 0.72322 0.97 }
+ }
+ 45 {
+ -0.0931723 7.13171 -0.0931731
+ { -0.0336239 -0.201743 3.92809e-008 }
+ { 0.819457 0.311841 }
+ }
+ 46 {
+ -0.0931723 7.13171 0.0931715
+ { -0.0336239 -0.201743 3.92809e-008 }
+ { 0.819457 0.333003 }
+ }
+ 47 {
+ -0.468305 7.19423 0.468304
+ { -0.0336239 -0.201743 3.92809e-008 }
+ { 0.776855 0.375605 }
+ }
+ 48 {
+ -0.468305 7.19423 -0.468306
+ { -0.0336239 -0.201743 3.92809e-008 }
+ { 0.776855 0.269239 }
+ }
+ 49 {
+ -0.0931723 7.13171 0.0931715
+ { 0 -0.201743 0.033624 }
+ { 0.819457 0.333003 }
+ }
+ 50 {
+ 0.0931723 7.13171 0.0931715
+ { 0 -0.201743 0.033624 }
+ { 0.84062 0.333003 }
+ }
+ 51 {
+ 0.468305 7.19423 0.468304
+ { 0 -0.201743 0.033624 }
+ { 0.883222 0.375605 }
+ }
+ 52 {
+ -0.468305 7.19423 0.468304
+ { 0 -0.201743 0.033624 }
+ { 0.776855 0.375605 }
+ }
+ 53 {
+ 0.0931723 7.13171 0.0931715
+ { 0.0336239 -0.201743 3.92809e-008 }
+ { 0.84062 0.333003 }
+ }
+ 54 {
+ 0.0931723 7.13171 -0.0931731
+ { 0.0336239 -0.201743 3.92809e-008 }
+ { 0.84062 0.311841 }
+ }
+ 55 {
+ 0.468305 7.19423 -0.468306
+ { 0.0336239 -0.201743 3.92809e-008 }
+ { 0.883222 0.269239 }
+ }
+ 56 {
+ 0.468305 7.19423 0.468304
+ { 0.0336239 -0.201743 3.92809e-008 }
+ { 0.883222 0.375605 }
+ }
+ 57 {
+ 0.0931723 7.13171 -0.0931731
+ { 0 -0.201743 -0.0336239 }
+ { 0.84062 0.311841 }
+ }
+ 58 {
+ -0.0931723 7.13171 -0.0931731
+ { 0 -0.201743 -0.0336239 }
+ { 0.819457 0.311841 }
+ }
+ 59 {
+ -0.468305 7.19423 -0.468306
+ { 0 -0.201743 -0.0336239 }
+ { 0.776855 0.269239 }
+ }
+ 60 {
+ 0.468305 7.19423 -0.468306
+ { 0 -0.201743 -0.0336239 }
+ { 0.883222 0.269239 }
+ }
+ 61 {
+ -0.468305 7.19423 -0.468306
+ { -0.18883 0.0785766 -1.52994e-008 }
+ { 0.537617 0.508478 }
+ }
+ 62 {
+ -0.468305 7.19423 0.468304
+ { -0.18883 0.0785766 -1.52994e-008 }
+ { 0.643983 0.508478 }
+ }
+ 63 {
+ 0 8.31963 -1.02257e-006
+ { -0.18883 0.0785766 -1.52994e-008 }
+ { 0.5908 0.646908 }
+ }
+ 64 {
+ -0.468305 7.19423 0.468304
+ { 0 0.0785766 0.18883 }
+ { 0.776855 0.03 }
+ }
+ 65 {
+ 0.468305 7.19423 0.468304
+ { 0 0.0785766 0.18883 }
+ { 0.883222 0.03 }
+ }
+ 66 {
+ 0 8.31963 -1.02257e-006
+ { 0 0.0785766 0.18883 }
+ { 0.830039 0.16843 }
+ }
+ 67 {
+ 0.468305 7.19423 0.468304
+ { 0.18883 0.0785766 -1.52994e-008 }
+ { 0.03 0.791425 }
+ }
+ 68 {
+ 0.468305 7.19423 -0.468306
+ { 0.18883 0.0785766 -1.52994e-008 }
+ { 0.136366 0.791425 }
+ }
+ 69 {
+ 0 8.31963 -1.02257e-006
+ { 0.18883 0.0785766 -1.52994e-008 }
+ { 0.0831832 0.929855 }
+ }
+ 70 {
+ 0.468305 7.19423 -0.468306
+ { 0 0.0785765 -0.18883 }
+ { 0.283808 0.791425 }
+ }
+ 71 {
+ -0.468305 7.19423 -0.468306
+ { 0 0.0785765 -0.18883 }
+ { 0.390175 0.791425 }
+ }
+ 72 {
+ 0 8.31963 -1.02257e-006
+ { 0 0.0785765 -0.18883 }
+ { 0.336992 0.929855 }
+ }
+ }
+ {
+ { 1 1 1 1 }
+ { Tex1 }
+ { 1 2 3 [ { Box03.verts } }
+ }
+ {
+ { 1 1 1 1 }
+ { Tex1 }
+ { 3 4 1 ][ { Box03.verts } }
+ }
+ {
+ { 1 1 1 1 }
+ { Tex1 }
+ { 5 6 7 ][ { Box03.verts } }
+ }
+ {
+ { 1 1 1 1 }
+ { Tex1 }
+ { 7 8 5 ][ { Box03.verts } }
+ }
+ {
+ { 1 1 1 1 }
+ { Tex1 }
+ { 9 10 11 ][ { Box03.verts } }
+ }
+ {
+ ]