Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: <andy_miller@us...> - 2008-07-17 10:38:42
|
Revision: 662 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=662&view=rev Author: andy_miller Date: 2008-07-17 10:38:12 +0000 (Thu, 17 Jul 2008) Log Message: ----------- CEGUI Demo updates thanks to Dermont Changes to support CEGUI 0.6.1 Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/demos/cegui/CEGUI_framework.py trunk/python-ogre/demos/cegui/resources.cfg trunk/python-ogre/demos/ogreode/SimpleScenes.py trunk/python-ogre/demos/ogreode/SimpleScenes_Buggy.py trunk/python-ogre/demos/ogreode/SimpleScenes_Chain.py trunk/python-ogre/demos/ogreode/SimpleScenes_Joints.py trunk/python-ogre/demos/ogreode/SimpleScenes_TriMesh.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/demos/cegui/Demo_CEGUI_DragnDropv061.py trunk/python-ogre/demos/cegui/Demo_CEGUI_Falgard1v061.py trunk/python-ogre/demos/cegui/Demo_CEGUI_FirstWindowv061.py trunk/python-ogre/demos/cegui/Demo_CEGUI_FontDemov061.py trunk/python-ogre/demos/cegui/Demo_CEGUI_ScrollablePanev061.py trunk/python-ogre/demos/cegui/Demo_CEGUI_TabControlv061.py trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py trunk/python-ogre/demos/cegui/datafiles/ trunk/python-ogre/demos/cegui/datafiles/configs/ trunk/python-ogre/demos/cegui/datafiles/configs/CEGUIConfig.xsd trunk/python-ogre/demos/cegui/datafiles/fonts/ trunk/python-ogre/demos/cegui/datafiles/fonts/Commonv2c.ttf trunk/python-ogre/demos/cegui/datafiles/fonts/Commonwealth-10.font trunk/python-ogre/demos/cegui/datafiles/fonts/DejaVuSans-10.font trunk/python-ogre/demos/cegui/datafiles/fonts/DejaVuSans.ttf trunk/python-ogre/demos/cegui/datafiles/fonts/FairChar-30.font trunk/python-ogre/demos/cegui/datafiles/fonts/Font.xsd trunk/python-ogre/demos/cegui/datafiles/fonts/Iconified-12.font trunk/python-ogre/demos/cegui/datafiles/fonts/Iconiv2.ttf trunk/python-ogre/demos/cegui/datafiles/fonts/Legal.txt trunk/python-ogre/demos/cegui/datafiles/fonts/README trunk/python-ogre/demos/cegui/datafiles/fonts/common.txt trunk/python-ogre/demos/cegui/datafiles/fonts/fkp-16.font trunk/python-ogre/demos/cegui/datafiles/fonts/fkp.de.pcf trunk/python-ogre/demos/cegui/datafiles/fonts/icon.txt trunk/python-ogre/demos/cegui/datafiles/imagesets/ trunk/python-ogre/demos/cegui/datafiles/imagesets/DriveIcons.imageset trunk/python-ogre/demos/cegui/datafiles/imagesets/DriveIcons.png trunk/python-ogre/demos/cegui/datafiles/imagesets/FairChar.imageset trunk/python-ogre/demos/cegui/datafiles/imagesets/FairChar.tga trunk/python-ogre/demos/cegui/datafiles/imagesets/GPN-2000-001437.tga trunk/python-ogre/demos/cegui/datafiles/imagesets/Imageset.xsd trunk/python-ogre/demos/cegui/datafiles/imagesets/ReadMe.txt trunk/python-ogre/demos/cegui/datafiles/imagesets/TaharezLook.imageset trunk/python-ogre/demos/cegui/datafiles/imagesets/TaharezLook.tga trunk/python-ogre/demos/cegui/datafiles/imagesets/Vanilla.imageset trunk/python-ogre/demos/cegui/datafiles/imagesets/WindowsLook.imageset trunk/python-ogre/demos/cegui/datafiles/imagesets/WindowsLook.tga trunk/python-ogre/demos/cegui/datafiles/imagesets/vanilla.tga trunk/python-ogre/demos/cegui/datafiles/layouts/ trunk/python-ogre/demos/cegui/datafiles/layouts/Console.wnd trunk/python-ogre/demos/cegui/datafiles/layouts/Demo7Windows.layout trunk/python-ogre/demos/cegui/datafiles/layouts/Demo8.layout trunk/python-ogre/demos/cegui/datafiles/layouts/DragDropDemo.layout trunk/python-ogre/demos/cegui/datafiles/layouts/FontDemo.layout trunk/python-ogre/demos/cegui/datafiles/layouts/GUILayout.xsd trunk/python-ogre/demos/cegui/datafiles/layouts/TabControlDemo.layout trunk/python-ogre/demos/cegui/datafiles/layouts/TabPage.layout trunk/python-ogre/demos/cegui/datafiles/layouts/TabPage1.layout trunk/python-ogre/demos/cegui/datafiles/layouts/TabPage2.layout trunk/python-ogre/demos/cegui/datafiles/layouts/TextDemo.layout trunk/python-ogre/demos/cegui/datafiles/layouts/TreeDemoTaharez.layout trunk/python-ogre/demos/cegui/datafiles/layouts/VanillaConsole.layout trunk/python-ogre/demos/cegui/datafiles/layouts/VanillaWindows.layout trunk/python-ogre/demos/cegui/datafiles/looknfeel/ trunk/python-ogre/demos/cegui/datafiles/looknfeel/Falagard.xsd trunk/python-ogre/demos/cegui/datafiles/looknfeel/TaharezLook.looknfeel trunk/python-ogre/demos/cegui/datafiles/looknfeel/Vanilla.looknfeel trunk/python-ogre/demos/cegui/datafiles/looknfeel/WindowsLook.looknfeel trunk/python-ogre/demos/cegui/datafiles/lua_scripts/ trunk/python-ogre/demos/cegui/datafiles/lua_scripts/IConsole.lua trunk/python-ogre/demos/cegui/datafiles/lua_scripts/InstancedInit.lua trunk/python-ogre/demos/cegui/datafiles/lua_scripts/demo8.lua trunk/python-ogre/demos/cegui/datafiles/schemes/ trunk/python-ogre/demos/cegui/datafiles/schemes/Demo8.scheme trunk/python-ogre/demos/cegui/datafiles/schemes/GUIScheme.xsd trunk/python-ogre/demos/cegui/datafiles/schemes/TaharezLook.scheme trunk/python-ogre/demos/cegui/datafiles/schemes/TaharezLookWidgetAliases.scheme trunk/python-ogre/demos/cegui/datafiles/schemes/TaharezLookWidgets.scheme trunk/python-ogre/demos/cegui/datafiles/schemes/VanillaSkin.scheme trunk/python-ogre/demos/cegui/datafiles/schemes/WindowsLook.scheme trunk/python-ogre/demos/cegui/datafiles/schemes/WindowsLookWidgets.scheme trunk/python-ogre/demos/cegui/v061/ trunk/python-ogre/demos/cegui/v061/TreeDemoMaterial.layout trunk/python-ogre/demos/cegui/v061/TreeDemoTaharez.layout trunk/python-ogre/demos/cegui/v061/TreeDemoVanilla.layout Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-07-17 08:53:19 UTC (rev 661) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-07-17 10:38:12 UTC (rev 662) @@ -38,8 +38,7 @@ PATH_THIRDPARTY = os.path.join(module_dir, 'ThirdParty' ) PATH_Ogre = os.path.join(BASE_DIR, 'ogre') PATH_OgreAddons = os.path.join(BASE_DIR, 'OgreAddons') -PATH_CEGUI = os.path.join(BASE_DIR, 'CEGUI-0.5.0') -PATH_CEGUI = os.path.join(BASE_DIR, 'CEGUI-0.6.0') +PATH_CEGUI = os.path.join(BASE_DIR, 'CEGUI-0.6.1') PATH_OIS = os.path.join(BASE_DIR, 'ois' ) ##'ois-1.0RC1') PATH_Newton = os.path.join(BASE_DIR, 'newtonsdk','sdk') @@ -56,7 +55,7 @@ PATH_ogreforests= os.path.join(PATH_THIRDPARTY,'forests') PATH_OGREAL= os.path.join(PATH_THIRDPARTY,'ogreal') -PATH_OGREAL= os.path.join(BASE_DIR,'ogreal') +# PATH_OGREAL= os.path.join(BASE_DIR,'ogreal') PATH_OPCODE= os.path.join(PATH_THIRDPARTY,'opcode') PATH_quickgui= os.path.join(PATH_THIRDPARTY,'quickgui') @@ -107,7 +106,7 @@ PATH_LIB_OgreOdePrefab = os.path.join( PATH_OgreOde, 'prefab/lib/Release' ) PATH_LIB_OgreOdeLoader = os.path.join( PATH_OgreOde, 'loader/lib/Release' ) -PATH_LIB_OgreAL = os.path.join( PATH_OGREAL, 'lib/Release' ) +PATH_LIB_OgreAL = os.path.join( PATH_OGREAL ) # , 'lib/Release' ) PATH_LIB_betagui = PATH_betagui PATH_LIB_quickgui = PATH_quickgui PATH_LIB_NxOgre= os.path.join(PATH_NxOgre, 'lib') @@ -140,7 +139,7 @@ PATH_INCLUDE_OPCODE = PATH_OPCODE PATH_INCLUDE_ODESOURCE = os.path.join( PATH_ODE, 'ode/src') -PATH_INCLUDE_OgreAL = os.path.join( PATH_OGREAL, 'include' ) +PATH_INCLUDE_OgreAL = os.path.join( PATH_OGREAL ) #, 'include' ) PATH_INCLUDE_OPENAL = os.path.join( PATH_OPENAL, 'include') PATH_INCLUDE_OGG= os.path.join( PATH_OGG, 'include' ) PATH_INCLUDE_VORBIS= os.path.join( PATH_VORBIS, 'include' ) Modified: trunk/python-ogre/demos/cegui/CEGUI_framework.py =================================================================== --- trunk/python-ogre/demos/cegui/CEGUI_framework.py 2008-07-17 08:53:19 UTC (rev 661) +++ trunk/python-ogre/demos/cegui/CEGUI_framework.py 2008-07-17 10:38:12 UTC (rev 662) @@ -1,96 +1,96 @@ -import ctypes - -# The follow patch from Tim (Mithro) fixes a loder issue with CEGUI - previously we'd patched CEGUI to -# ensure the CEGUIBase was linked to every module to solve the issue with Python dynamically loading -# the _cegui_.so module without RTLD_GLOBAL set - then when CEGUI opened it's dynamic modules it -# couldn't find all the symbols. - -print ctypes.CDLL("../../../root/usr/lib/libCEGUIBase.so", ctypes.RTLD_GLOBAL ) - -import ogre.gui.CEGUI as CEGUI - -# Another fix for CEGUI to ensure we get a working parser.. -CEGUI.System.setDefaultXMLParserName("TinyXMLParser") - -import ogre.io.OIS as OIS -import SampleFramework - -##----------------------------------------------------------------## -def convertOISMouseButtonToCegui( buttonID): - if buttonID ==0: - return CEGUI.LeftButton - elif buttonID ==1: - return CEGUI.RightButton - elif buttonID ==2: - return CEGUI.MiddleButton - elif buttonID ==3: - return CEGUI.X1Button - else: - return CEGUI.LeftButton - -def _PointHack(x, y): - return CEGUI.Vector2(x, y) -CEGUI.Point = _PointHack - -def cegui_reldim ( x ) : - return CEGUI.UDim((x),0) - -class MouseListener ( OIS.MouseListener ): - def __init__(self): - OIS.MouseListener.__init__( self) - - ##----------------------------------------------------------------## - def mouseMoved( self, arg ): - CEGUI.System.getSingleton().injectMouseMove( arg.get_state().X.rel, arg.get_state().Y.rel ) - return True - - ##----------------------------------------------------------------## - def mousePressed( self, arg, id ): - CEGUI.System.getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id)) - return True - - ##----------------------------------------------------------------## - def mouseReleased( self, arg, id ): - CEGUI.System.getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id)) - return True - - -class GuiFrameListener(SampleFramework.FrameListener , OIS.KeyListener, OIS.MouseListener): - - def __init__(self, renderWindow, camera, CEGUIRenderer): - - SampleFramework.FrameListener.__init__(self, renderWindow, camera, True, True, True) - OIS.KeyListener.__init__(self) - self.mouselistener = MouseListener () - #OIS.MouseListener.__init_(self) - - self.Mouse.setEventCallback(self.mouselistener) - self.Keyboard.setEventCallback(self) - - self.ShutdownRequested = False - self.GUIRenderer = CEGUIRenderer - self.keepRendering = True # whether to continue rendering or not - self.numScreenShots = 0 # screen shot count - - ## Tell the frame listener to exit at the end of the next frame - def requestShutdown( self ): - self.ShutdownRequested = True - - def frameEnded(self, evt): - if self.ShutdownRequested: - return False - else: - return SampleFramework.FrameListener.frameEnded(self, evt) - - ##----------------------------------------------------------------## - def keyPressed( self, arg ): - if arg.key == OIS.KC_ESCAPE: - self.ShutdownRequested = True - CEGUI.System.getSingleton().injectKeyDown( arg.key ) - CEGUI.System.getSingleton().injectChar( arg.text ) - return True - - ##----------------------------------------------------------------## - def keyReleased( self, arg ): - CEGUI.System.getSingleton().injectKeyUp( arg.key ) - return True +import ctypes + +# The follow patch from Tim (Mithro) fixes a loder issue with CEGUI - previously we'd patched CEGUI to +# ensure the CEGUIBase was linked to every module to solve the issue with Python dynamically loading +# the _cegui_.so module without RTLD_GLOBAL set - then when CEGUI opened it's dynamic modules it +# couldn't find all the symbols. + +#print ctypes.CDLL("../../../root/usr/lib/libCEGUIBase.so", ctypes.RTLD_GLOBAL ) + +import ogre.gui.CEGUI as CEGUI + +# Another fix for CEGUI to ensure we get a working parser.. +CEGUI.System.setDefaultXMLParserName("TinyXMLParser") + +import ogre.io.OIS as OIS +import SampleFramework + +##----------------------------------------------------------------## +def convertOISMouseButtonToCegui( buttonID): + if buttonID ==0: + return CEGUI.LeftButton + elif buttonID ==1: + return CEGUI.RightButton + elif buttonID ==2: + return CEGUI.MiddleButton + elif buttonID ==3: + return CEGUI.X1Button + else: + return CEGUI.LeftButton + +def _PointHack(x, y): + return CEGUI.Vector2(x, y) +CEGUI.Point = _PointHack + +def cegui_reldim ( x ) : + return CEGUI.UDim((x),0) + +class MouseListener ( OIS.MouseListener ): + def __init__(self): + OIS.MouseListener.__init__( self) + + ##----------------------------------------------------------------## + def mouseMoved( self, arg ): + CEGUI.System.getSingleton().injectMouseMove( arg.get_state().X.rel, arg.get_state().Y.rel ) + return True + + ##----------------------------------------------------------------## + def mousePressed( self, arg, id ): + CEGUI.System.getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id)) + return True + + ##----------------------------------------------------------------## + def mouseReleased( self, arg, id ): + CEGUI.System.getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id)) + return True + + +class GuiFrameListener(SampleFramework.FrameListener , OIS.KeyListener, OIS.MouseListener): + + def __init__(self, renderWindow, camera, CEGUIRenderer): + + SampleFramework.FrameListener.__init__(self, renderWindow, camera, True, True, True) + OIS.KeyListener.__init__(self) + self.mouselistener = MouseListener () + #OIS.MouseListener.__init_(self) + + self.Mouse.setEventCallback(self.mouselistener) + self.Keyboard.setEventCallback(self) + + self.ShutdownRequested = False + self.GUIRenderer = CEGUIRenderer + self.keepRendering = True # whether to continue rendering or not + self.numScreenShots = 0 # screen shot count + + ## Tell the frame listener to exit at the end of the next frame + def requestShutdown( self ): + self.ShutdownRequested = True + + def frameEnded(self, evt): + if self.ShutdownRequested: + return False + else: + return SampleFramework.FrameListener.frameEnded(self, evt) + + ##----------------------------------------------------------------## + def keyPressed( self, arg ): + if arg.key == OIS.KC_ESCAPE: + self.ShutdownRequested = True + CEGUI.System.getSingleton().injectKeyDown( arg.key ) + CEGUI.System.getSingleton().injectChar( arg.text ) + return True + + ##----------------------------------------------------------------## + def keyReleased( self, arg ): + CEGUI.System.getSingleton().injectKeyUp( arg.key ) + return True Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_DragnDropv061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_DragnDropv061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_DragnDropv061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,167 @@ +#/*************************************************************************** +# * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team +# * +# * Permission is hereby granted, free of charge, to any person obtaining +# * a copy of this software and associated documentation files (the +# * "Software"), to deal in the Software without restriction, including +# * without limitation the rights to use, copy, modify, merge, publish, +# * distribute, sublicense, and/or sell copies of the Software, and to +# * permit persons to whom the Software is furnished to do so, subject to +# * the following conditions: +# * +# * The above copyright notice and this permission notice shall be +# * included in all copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# * OTHER DEALINGS IN THE SOFTWARE. +# ***************************************************************************/ + + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +from CEGUI_framework import * + + +def createUVector2( x, y): + return CEGUI.UVector2(CEGUI.UDim(x,0), CEGUI.UDim(y,0)) + +def handle_ItemDropped(args): + if not args.window.getChildCount(): + # add dragdrop item as child of target if target has no item already + args.window.addChildWindow(args.dragDropItem) + # Now we must reset the item position from it's 'dropped' location, + # since we're now a child of an entirely different window + args.dragDropItem.setPosition( + createUVector2(0.05, 0.05) ) + return True + + + + +class GEUIApplication(SampleFramework.Application): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.CEGUIRenderer = 0 + self.CEGUISystem = 0 + + def _createScene(self): + + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.25, 0.25, 0.25) + + # initiaslise CEGUI Renderer + self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + False, 3000, + self.sceneManager) + + self.CEGUISystem = CEGUI.System(self.CEGUIRenderer) + CEGUI.Logger.getSingleton().loggingLevel = CEGUI.Insane + + # load TaharezLook scheme + CEGUI.SchemeManager.getSingleton().loadScheme("WindowsLook.scheme") + + # load font and setup default if not loaded via scheme + if not CEGUI.FontManager.getSingleton().isFontPresent("DejaVuSans-10.font"): + try: + CEGUI.FontManager.getSingleton().createFont("DejaVuSans-10.font") + except: + ## assume font is defined in loaded scheme + pass + + ## set up defaults + CEGUI.System.getSingleton().setDefaultMouseCursor("WindowsLook", "MouseArrow") + CEGUI.System.getSingleton().setDefaultFont("DejaVuSans-10") + + # load the drive icons imageset + CEGUI.ImagesetManager.getSingleton().createImageset("DriveIcons.imageset") + + ## load the initial layout + CEGUI.System.getSingleton().setGUISheet( + CEGUI.WindowManager.getSingleton().loadWindowLayout("DragDropDemo.layout", False)) + + ## setup events + self._subscribeEvents() + + + def _subscribeEvents(self): + wmgr = CEGUI.WindowManager.getSingleton() + + + # Subscribe the same handler to each of the twelve slots + base_name = "Root/MainWindow/Slot" + for i in range(1,13): + try: + # get the window pointer for this slot + wnd = wmgr.getWindow(base_name + CEGUI.PropertyHelper.intToString(i)) + wnd.subscribeEvent( + CEGUI.Window.EventDragDropItemDropped, handle_ItemDropped,"") + except CEGUI.Exception, e: + print e + + def _createCamera(self): + self.camera = self.sceneManager.createCamera("PlayerCam") + self.camera.nearClipDistance = 5 + + def _createFrameListener(self): + self.frameListener = CEGUIFrameListener(self.renderWindow, self.camera, self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(True) + + def __del__(self): + "Clear variables, this is needed to ensure the correct order of deletion" + del self.camera + del self.sceneManager + del self.frameListener + del self.CEGUISystem + del self.CEGUIRenderer + del self.root + del self.renderWindow + +class CEGUIFrameListener(GuiFrameListener): + + def __init__(self, renderWindow, camera, sceneManager): + GuiFrameListener.__init__(self, renderWindow, camera, sceneManager) + + self.keepRendering = True # whether to continue rendering or not + + # Subscribe handler to deal with user closing the frame window + try: + main_wnd = CEGUI.WindowManager.getSingleton().getWindow("Root/MainWindow") + main_wnd.subscribeEvent( + CEGUI.FrameWindow.EventCloseClicked, self, "handle_CloseButton") + + # if something goes wrong, log the issue but do not bomb! + except CEGUI.Exception, e: + print e + + def handle_CloseButton(self, args): + self.keepRendering = False + return True + + def frameStarted(self, evt): + if not self.keepRendering: + return False + else: + return GuiFrameListener.frameStarted(self,evt) + + +if __name__ == '__main__': + try: + ta = GEUIApplication() + ta.go() + except ogre.OgreException, e: + print e Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_Falgard1v061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_Falgard1v061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_Falgard1v061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,283 @@ +#/*************************************************************************** +# * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team +# * +# * Permission is hereby granted, free of charge, to any person obtaining +# * a copy of this software and associated documentation files (the +# * "Software"), to deal in the Software without restriction, including +# * without limitation the rights to use, copy, modify, merge, publish, +# * distribute, sublicense, and/or sell copies of the Software, and to +# * permit persons to whom the Software is furnished to do so, subject to +# * the following conditions: +# * +# * The above copyright notice and this permission notice shall be +# * included in all copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# * OTHER DEALINGS IN THE SOFTWARE. +# ***************************************************************************/ + + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +from CEGUI_framework import * + + +def cegui_reldim ( x ) : + return CEGUI.UDim((x),0) + +def ceguimax ( x, y ) : + if x>y: return x + return y +def ceguimin ( x, y ) : + if x<y: return x + return y + + + + +class DemoConsole(): + + SubmitButtonID = 1 + EntryBoxID = 2 + HistoryID = 3 + + def __init__(self, id_name, parent=None): + + d_root = CEGUI.WindowManager.getSingleton().loadWindowLayout("VanillaConsole.layout", id_name, 'General') + self.d_historyPos = 0 + self.d_root = d_root + self.d_history = [] + + # we will destroy the console box windows ourselves + d_root.setDestroyedByParent(False) + + + + # Do events wire-up + d_root.subscribeEvent( + CEGUI.Window.EventKeyDown, self, "handleKeyDown") + + d_root.getChild(self.SubmitButtonID).subscribeEvent( + CEGUI.PushButton.EventClicked, self, "handleSubmit") + d_root.getChild(self.EntryBoxID).subscribeEvent( + CEGUI.Editbox.EventTextAccepted, self, "handleSubmit") + + # decide where to attach the console main window + def attachTo(parent, sheet): + if parent : return parent + return sheet + + parent = attachTo(parent , CEGUI.System.getSingleton().getGUISheet() ) + + # attach this window if parent is valid + if parent: + parent.addChildWindow(d_root) + + + def __del__(self): + # destroy the windows that we loaded earlier + CEGUI.WindowManager.getSingleton().destroyWindow(self.d_root) + self.d_root = 0 + + + def toggleVisibility(self): + if self.d_root.isVisible(True): + self.d_root.hide() + else: + self.d_root.show() + + + def isVisible(self): + return self.d_root.isVisible() + + def handleSubmit(self, args): + + # get the text entry editbox + editbox = self.d_root.getChild(self.EntryBoxID) + + # get text out of the editbox + edit_text = editbox.getText() + + # if the string is not empty + if len(edit_text.c_str())>0: + # add this entry to the command history buffer + self.d_history.append(edit_text) + # reset history position + self.d_historyPos = len(self.d_history) + # append newline to this entry + edit_text += '\n' + # get history window + history = self.d_root.getChild(self.HistoryID) + print dir(history) + # append new text to history output + history.setText(history.getText() + edit_text) + # scroll to bottom of history output + history.setCaratIndex(-1) + # erase text in text entry box. + editbox.setText("") + + # re-activate the text entry box + editbox.activate() + + return True + + def handleKeyDown(self, args): + + # get the text entry editbox + editbox = self.d_root.getChild(self.EntryBoxID) + + if args.scancode == CEGUI.Key.ArrowUp : + self.d_historyPos = ceguimax(self.d_historyPos - 1, -1) + if self.d_historyPos >= 0: + editbox.setText(self.d_history[self.d_historyPos]) + editbox.setCaratIndex(-1) + else: + editbox.setText("") + editbox.activate() + + elif args.scancode == CEGUI.Key.ArrowDown : + self.d_historyPos = ceguimin(self.d_historyPos + 1, len(self.d_history) ) + if self.d_historyPos < len(self.d_history): + editbox.setText(self.d_history[self.d_historyPos]) + editbox.setCaratIndex(-1) + else: + editbox.setText("") + + editbox.activate() + + else: + return False + + return True + + +class GEUIApplication(SampleFramework.Application): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.CEGUIRenderer = 0 + self.CEGUISystem = 0 + self.d_console = None + + def _createScene(self): + + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.25, 0.25, 0.25) + + # initiaslise OgreCEGUI Renderer + + self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + False, 3000, + self.sceneManager) + self.CEGUISystem = CEGUI.System(self.CEGUIRenderer) + + ## set the logging level + CEGUI.Logger.getSingleton().loggingLevel = CEGUI.Insane + + ## we will make extensive use of the WindowManager. + winMgr = CEGUI.WindowManager.getSingleton() + + # Load the scheme to initialse the VanillaSkin which we use in this sample + CEGUI.SchemeManager.getSingleton().loadScheme("VanillaSkin.scheme") + # set default mouse image + CEGUI.System.getSingleton().setDefaultMouseCursor("Vanilla-Images", "MouseArrow") + + # load an image to use as a background + CEGUI.ImagesetManager.getSingleton().createImagesetFromImageFile("BackgroundImage", "GPN-2000-001437.tga") + + # here we will use a StaticImage as the root, then we can use + # it to place a background image + background = winMgr.createWindow("Vanilla/StaticImage") + # set area rectangle + background.setArea(CEGUI.URect(cegui_reldim(0), cegui_reldim(0), + cegui_reldim(1), cegui_reldim(1))) + # disable frame and standard background + background.setProperty("FrameEnabled", "false") + background.setProperty("BackgroundEnabled", "false") + # set the background image + background.setProperty("Image", "set:BackgroundImage image:full_image") + # install this as the root GUI sheet + CEGUI.System.getSingleton().setGUISheet(background) + + if not CEGUI.FontManager.getSingleton().isFontPresent("Iconified-12"): + CEGUI.FontManager.getSingleton().createFont("Iconified-12.font") + + # load some demo windows and attach to the background 'root' + background.addChildWindow(winMgr.loadWindowLayout("VanillaWindows.layout", False)) + + # create an instance of the console class. + self.d_console = DemoConsole("Demo") + + # listen for key presses on the root window. + background.subscribeEvent( + CEGUI.Window.EventKeyDown, + self, 'handleRootKeyDown') + + # activate the background window + background.activate() + + def handleRootKeyDown(self, args): + keyArgs = args + + if keyArgs.scancode == CEGUI.Key.F12: + self.d_console.toggleVisibility() + + else: + return False + return True + + + + def _createCamera(self): + self.camera = self.sceneManager.createCamera("PlayerCam") + self.camera.nearClipDistance = 5 + + def _createFrameListener(self): + self.frameListener = CEGUIFrameListener(self.renderWindow, self.camera, self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(True) + + def cleanUp(self): + print "Cleaning Up" + del self.d_console + + def __del__(self): + "Clear variables, this is needed to ensure the correct order of deletion" + del self.camera + del self.sceneManager + del self.frameListener + del self.CEGUISystem + del self.CEGUIRenderer + del self.root + del self.renderWindow + +class CEGUIFrameListener(GuiFrameListener): + + def __init__(self, renderWindow, camera, sceneManager): + GuiFrameListener.__init__(self, renderWindow, camera, sceneManager) + self.MenuMode=True + self.keepRendering = True # whether to continue rendering or not + + + +if __name__ == '__main__': + try: + ta = GEUIApplication() + ta.go() + ta.cleanUp() + except ogre.OgreException, e: + print e + Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_FirstWindowv061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_FirstWindowv061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_FirstWindowv061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,273 @@ +#/*************************************************************************** +# * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team +# * +# * Permission is hereby granted, free of charge, to any person obtaining +# * a copy of this software and associated documentation files (the +# * "Software"), to deal in the Software without restriction, including +# * without limitation the rights to use, copy, modify, merge, publish, +# * distribute, sublicense, and/or sell copies of the Software, and to +# * permit persons to whom the Software is furnished to do so, subject to +# * the following conditions: +# * +# * The above copyright notice and this permission notice shall be +# * included in all copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# * OTHER DEALINGS IN THE SOFTWARE. +# ***************************************************************************/ + + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +from CEGUI_framework import * + + + +def cegui_reldim ( x ) : + return CEGUI.UDim((x),0) + +class GEUIApplication(SampleFramework.Application): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.CEGUIRenderer = 0 + self.CEGUISystem = 0 + self.MenuMode = True + self.menuItems = [] + + def _createScene(self): + + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.25, 0.25, 0.25) + + # initiaslise OgreCEGUI Renderer + ## Parameters are: + ## a) OgreRenderWindow object. + ## b) param post_queue + ## set to True to have GUI rendered after render queue + ## queue_id, or False to have the GUI rendered before + ## render queue + ## c) render queue_id. + ## where ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY indicates + ## ceguiogre window is rendered above all else + ## d) param max_quads + ## obsolete + ## e) sceneManager + + self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + False, 3000, + self.sceneManager) + + ## Note it is also possible to initialise the OgreCEGUI renderer + ## with out the scenemanager, e.g: + ## self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ## ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + ## False, 3000) + ## + ## However you must call setTargetSceneManager before rendering + ## self.CEGUIRenderer.setTargetSceneManager(self.sceneManager) + + self.CEGUISystem = CEGUI.System(self.CEGUIRenderer) + + ## set the logging level + CEGUI.Logger.getSingleton().loggingLevel = CEGUI.Insane + + ## CEGUI relies on various systems being set-up, so this is what we do + ## here first. + ## + ## Note that is is possible, and even usual, for most of these steps to + ## be done automatically via a "scheme" definition, or even from the + ## cegui.conf configuration file, however for completeness, and as an + ## example, virtually everything is being done manually in this example + ## code. + ## + ## Imagesets area a collection of named areas within a texture or image + ## file. Each area becomes an Image, and has a unique name by which it + ## can be referenced. This sample is using the TaharezLook widgets, and + ## these rely upon the TaharezLook Imageset; so we must load this in + ## before doing anything else. Note that the Imageset would normally be + ## specified as part of a scheme file, although as this example is + ## demonstrating, it is not a requirement. + ## + ## Load TaharezLook imageset by making use of the ImagesetManager + ## singleton. + + taharezImages = CEGUI.ImagesetManager.getSingleton().createImageset("TaharezLook.imageset") + + ## The next thing we do is to set a default mouse cursor image. This is + ## not strictly essential, although it is nice to always have a visible + ## cursor if a window or widget does not explicitly set one of its own. + ## + ## The TaharezLook Imageset contains an Image named "MouseArrow" + ## which is the ideal thing to have as a defult mouse cursor image. + + CEGUI.System.getSingleton().setDefaultMouseCursor(taharezImages.getImage("MouseArrow")) + + + ## Now we have the gui imagery side of thigs set up, we should load + ## in a font. + ## You should always load in at least one font, this is to ensure + ## that there is a default available for any gui element which + ## needs to draw text. + ## The first font you load is automatically set as the initial + ## default font, although you can change the default later on + ## if so desired. Again, it is possible to list fonts to be + ## automatically loaded as part of a scheme, so + ## this step may not usually be performed explicitly. + ## + ## Fonts are loaded via the FontManager singleton. + + CEGUI.FontManager.getSingleton().createFont("Commonwealth-10.font") + + ## The widgets that we will be using for this sample are the + ## TaharezLook widgets, + ## and to enable us to use this 'skin' we must load the xml + ## specification - which within cegui is known as a "looknfeel" file. + ## + ## We load the looknfeel via the WidgetLookManager singleton. + + CEGUI.WidgetLookManager.getSingleton().parseLookNFeelSpecification("TaharezLook.looknfeel") + + + ## The final step of basic initialisation that is usually peformed is + ## registering some widgets with the system via a scheme file. + ## The scheme basically states the name of a dynamically loaded module + ## that contains the widget classes that we wish to use. + ## As stated previously, a scheme can actually conatin much more + ## information, though for the sake of this first example, we + ## load a scheme which only contains what is required to register + ## some widgets. + ## + ## Use the SchemeManager singleton to load in a scheme that + ## registers widgets, for TaharezLook. + + CEGUI.SchemeManager.getSingleton().loadScheme("TaharezLookWidgets.scheme") + + + ## Now the system is initialised, we can actually create some + ## UI elements, for this first example, a full-screen 'root' window + ## is set as the active GUI sheet, and then a simple frame window + ## will be created and attached to it. + + ## All windows and widgets are created via the WindowManager singleton. + + winMgr = CEGUI.WindowManager.getSingleton() + + ## Here we create a "DeafultWindow". This is a native type, that is, + ## it does not have to be loaded via a scheme, it is always available. + ## One common use for the DefaultWindow is as a generic container for + ## other windows. Its size defaults to 1.0 x 1.0 using the Relative + ## metrics mode, which means when it is set as the root GUI sheet + ## window, it will cover the entire display. + ## The DefaultWindow does not perform any rendering of its own, + ## so is invisible. + ## + ## Create a DefaultWindow called 'Root'. + + root = winMgr.createWindow("DefaultWindow", "Root") + + # set the GUI root window (also known as the GUI "sheet"), + # so the gui we set up will be visible. + + CEGUI.System.getSingleton().setGUISheet(root) + + ## A FrameWindow is a window with a frame and a titlebar which + ## may be moved around and resized. + ## + ## Create a FrameWindow in the TaharezLook style, and name it + ## 'Demo Window' + + wnd = winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window") + + ## Here we attach the newly created FrameWindow to the previously + ## created DefaultWindow which we will be using as the root of the + ## displayed gui. + + root.addChildWindow(wnd) + + ## Windows are in Relative metrics mode by default. This means that + ## we can specify sizes and positions without having to know the + ## exact pixel size of the elements in advance. The relative + ## metrics mode co-ordinates are relative to the parent of the + ## window where the co-ordinates are being set. + ## This means that if 0.5 is specified as the width for a window, + ## that window will be half as its parent window. + ## + ## Here we set the FrameWindow so that it is half the size of + ## the display, and centered within the display. + ## Note that cegui_reldim in python is a convenience method specified + ## at the strat of this program + + wnd.setPosition(CEGUI.UVector2( cegui_reldim(0.25), + cegui_reldim(0.25))) + wnd.setSize(CEGUI.UVector2( cegui_reldim(0.5), + cegui_reldim(0.5))) + + ## now we set the maximum and minum sizes for the new window. + ## These are specified using relative co-ordinates, but the + ## important thing to note is that these settings are aways + ## relative to the display rather than the parent window. + ## + ## here we set a maximum size for the FrameWindow which is + ## equal to the size of the display, and a minimum size of + ##one tenth of the display. + + wnd.setMaxSize(CEGUI.UVector2( cegui_reldim( 1.0), + cegui_reldim( 1.0))) + wnd.setMinSize(CEGUI.UVector2( cegui_reldim( 0.1), + cegui_reldim( 0.1))) + + ## As a final step in the initialisation of our sample window, + ## we set the window's text to "Hello World!", so that this text + ## will appear as the caption in the FrameWindow's titlebar. + wnd.setText("Hello World!") + + + def _createCamera(self): + self.camera = self.sceneManager.createCamera("PlayerCam") + self.camera.nearClipDistance = 5 + + def _createFrameListener(self): + self.frameListener = CEGUIFrameListener(self.renderWindow, self.camera, self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(True) + + def __del__(self): + "Clear variables, this is needed to ensure the correct order of deletion" + del self.camera + del self.sceneManager + del self.frameListener + del self.CEGUISystem + del self.CEGUIRenderer + del self.root + del self.renderWindow + +class CEGUIFrameListener(GuiFrameListener): + + def __init__(self, renderWindow, camera, sceneManager): + GuiFrameListener.__init__(self, renderWindow, camera, sceneManager) + self.MenuMode=True + + def frameStarted(self, evt): + return GuiFrameListener.frameStarted(self,evt) + + +if __name__ == '__main__': + try: + ta = GEUIApplication() + ta.go() + except ogre.OgreException, e: + print e Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_FontDemov061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_FontDemov061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_FontDemov061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,302 @@ +# -*- coding: utf-8 -*- + +#/*************************************************************************** +# * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team +# * +# * Permission is hereby granted, free of charge, to any person obtaining +# * a copy of this software and associated documentation files (the +# * "Software"), to deal in the Software without restriction, including +# * without limitation the rights to use, copy, modify, merge, publish, +# * distribute, sublicense, and/or sell copies of the Software, and to +# * permit persons to whom the Software is furnished to do so, subject to +# * the following conditions: +# * +# * The above copyright notice and this permission notice shall be +# * included in all copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# * OTHER DEALINGS IN THE SOFTWARE. +#/////# -*- coding: latin-1 -*- +# ***************************************************************************/ + + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +from CEGUI_framework import * + + +def createUVector2( x, y): + return CEGUI.UVector2(CEGUI.UDim(x,0), CEGUI.UDim(y,0)) +def cegui_reldim ( x ) : + return CEGUI.UDim((x),0) + +def getFontDict(): + SCHEME_FONT = {} + SCHEME_FONT['Commonwealth-10'] = "Commonwealth-10.font" + SCHEME_FONT['BlueHighway-12'] = "bluehighway-12.font" + SCHEME_FONT['BlueHighway-10'] = "bluehighway-10.font" + SCHEME_FONT['BlueHighway-8'] = "bluehighway-8.font" + SCHEME_FONT['DejaVuSans-10'] = "DejaVuSans-10.font" + SCHEME_FONT['Commonwealth-10'] = "Commonwealth-10.font" + SCHEME_FONT['Iconified-12'] = "Iconified-12.font" + SCHEME_FONT['fkp-16'] = "fkp-16.font" + SCHEME_FONT['FairChar-30'] = "FairChar-30.font" + return SCHEME_FONT + + +def getLanguageDict(): + LANGUAGE_DICT = {} + LANGUAGE_DICT['English'] = "THIS IS SOME TEXT IN UPPERCASE\n and this is lowercase...\n Try Catching The Brown Fox While It's Jumping Over The Lazy Dog" + LANGUAGE_DICT['Russian'] = u"Всё ускоряющаяся эволюция компьютерных технологий предъявила жёсткие требования к производителям как собственно вычислительной техники, так и периферийных устройств.\n" + LANGUAGE_DICT['Romanian'] = u"CEI PATRU APOSTOLI\n au fost trei:\n Luca şi Matfei\n" + LANGUAGE_DICT['Danish'] = u"FARLIGE STORE BOGSTAVER\n og flere men små...\n Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen Walther spillede på xylofon\n" + LANGUAGE_DICT['French'] = u'La Peña' + return LANGUAGE_DICT + +global MIN_POINT_SIZE +MIN_POINT_SIZE=6.0 + + +class GEUIApplication(SampleFramework.Application): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.CEGUIRenderer = 0 + self.CEGUISystem = 0 + self.MenuMode = True + self.ListItems = [] + + def _createScene(self): + + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.25, 0.25, 0.25) + + # initiaslise CEGUI Renderer + self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + False, 3000, + self.sceneManager) + + self.CEGUISystem = CEGUI.System(self.CEGUIRenderer) + CEGUI.Logger.getSingleton().loggingLevel = CEGUI.Insane + + winMgr = CEGUI.WindowManager.getSingleton() + + # load scheme and set up defaults + CEGUI.SchemeManager.getSingleton().loadScheme ("TaharezLook.scheme") + CEGUI.System.getSingleton().setDefaultMouseCursor ("TaharezLook", "MouseArrow") + + # load all the fonts except Commonwealth which has been already loaded + fontDict = getFontDict() + for f in fontDict.keys(): + if not CEGUI.FontManager.getSingleton().isFontPresent(f): + CEGUI.FontManager.getSingleton().createFont(fontDict[f]) + + + # load an image to use as a background + CEGUI.ImagesetManager.getSingleton().createImagesetFromImageFile("BackgroundImage", "GPN-2000-001437.tga") + + # here we will use a StaticImage as the root, then we + # can use it to place a background image + background = winMgr.createWindow ("TaharezLook/StaticImage") + # set area rectangle + background.setArea (CEGUI.URect(cegui_reldim (0), cegui_reldim (0), + cegui_reldim (1), cegui_reldim (1))) + # disable frame and standard background + background.setProperty ("FrameEnabled", "false") + background.setProperty ("BackgroundEnabled", "false") + # set the background image + background.setProperty ("Image", "set:BackgroundImage image:full_image") + # install this as the root GUI sheet + CEGUI.System.getSingleton().setGUISheet (background) + + #/ set tooltip styles (by default there is none) + CEGUI.System.getSingleton().setDefaultTooltip ("TaharezLook/Tooltip") + + # load some demo windows and attach to the background 'root' + background.addChildWindow (winMgr.loadWindowLayout ("FontDemo.layout", False)) + + # Add the font names to the listbox + fontDict = getFontDict() + lbox = winMgr.getWindow ("FontDemo/FontList") + for f in fontDict.keys(): + item = CEGUI.ListboxTextItem(f) + item.setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush") + # ensure Python is in control of it's "deletion" + item.AutoDeleted = False + lbox.addItem( item) + self.ListItems.append(item) + + # set up the font listbox callback + lbox.subscribeEvent( + CEGUI.Listbox.EventSelectionChanged, self, "handleFontSelection") + # select the first font + lbox.setItemSelectState(0, True) + + # Add language list to the listbox + lbox = winMgr.getWindow ("FontDemo/LangList") + languageDict = getLanguageDict() + for l in languageDict.keys(): + item = CEGUI.ListboxTextItem(l) + item.setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush") + # ensure Python is in control of it's "deletion" + item.AutoDeleted = False + lbox.addItem( item) + self.ListItems.append(item) + + # set up the language listbox callback + lbox.subscribeEvent( + CEGUI.Listbox.EventSelectionChanged, self, "handleLangSelection") + # select the first language + lbox.setItemSelectState(0, True) + + winMgr.getWindow("FontDemo/AutoScaled").subscribeEvent( + CEGUI.Checkbox.EventCheckStateChanged, + self, 'handleAutoScaled') + winMgr.getWindow("FontDemo/Antialiased").subscribeEvent ( + CEGUI.Checkbox.EventCheckStateChanged, + self, 'handleAntialiased') + winMgr.getWindow("FontDemo/PointSize").subscribeEvent ( + CEGUI.Scrollbar.EventScrollPositionChanged, + self, 'handlePointSize') + + + + ## Event Handlers ## + def setFontDesc(self): + winMgr = CEGUI.WindowManager.getSingleton() + mle = winMgr.getWindow("FontDemo/FontSample") + f = mle.getFont() + s = f.getProperty("Name") + if f.isPropertyPresent("PointSize"): + s += "." + f.getProperty("PointSize") + winMgr.getWindow("FontDemo/FontDesc").setText(s) + + def handleFontSelection(self,e): + lbox = e.window + if lbox.getFirstSelectedItem(): + f = CEGUI.FontManager.getSingleton().getFont( + lbox.getFirstSelectedItem().getText()) + + winMgr = CEGUI.WindowManager.getSingleton() + winMgr.getWindow("FontDemo/FontSample").setFont(f) + b = f.isPropertyPresent("AutoScaled") + cb = winMgr.getWindow("FontDemo/AutoScaled") + cb.setEnabled(b) + if b: + cb.setSelected(CEGUI.PropertyHelper.stringToBool(f.getProperty ("AutoScaled"))) + + b = f.isPropertyPresent("Antialiased") + cb = winMgr.getWindow("FontDemo/Antialiased") + cb.setEnabled (b) + if b: + cb.setSelected(CEGUI.PropertyHelper.stringToBool(f.getProperty ("Antialiased"))) + + b = f.isPropertyPresent ("PointSize") + sb = winMgr.getWindow("FontDemo/PointSize") + sb.setEnabled(b) + if b: + sb.setScrollPosition ( CEGUI.PropertyHelper.stringToFloat(f.getProperty("PointSize")) - MIN_POINT_SIZE) + + self.setFontDesc() + + return True + + + def handleAutoScaled (self, e): + winMgr = CEGUI.WindowManager.getSingleton() + cb = e.window + mle = winMgr.getWindow("FontDemo/FontSample") + f = mle.getFont() + f.setProperty("AutoScaled", + CEGUI.PropertyHelper.boolToString(cb.isSelected())) + + return True + + + def handleAntialiased(self, e): + winMgr = CEGUI.WindowManager.getSingleton() + cb = e.window + mle = winMgr.getWindow("FontDemo/FontSample") + f = mle.getFont() + f.setProperty ("Antialiased", + CEGUI.PropertyHelper.boolToString(cb.isSelected())) + + return True + + def handlePointSize(self, e): + winMgr = CEGUI.WindowManager.getSingleton() + sb = e.window + f = winMgr.getWindow("FontDemo/FontSample").getFont() + f.setProperty ("PointSize", + CEGUI.PropertyHelper.intToString ( + int(MIN_POINT_SIZE + sb.getScrollPosition ()))) + self.setFontDesc() + + return True + + def handleLangSelection(self, e): + lbox = e.window + if lbox.getFirstSelectedItem(): + idx = lbox.getItemIndex(lbox.getFirstSelectedItem()) + winMgr = CEGUI.WindowManager.getSingleton() + + cs = CEGUI.String() + cs.assign( getLanguageDict().values()[idx].encode("utf-8") ) + winMgr.getWindow("FontDemo/FontSample").setText(cs) + + return True + + + def _createCamera(self): + self.camera = self.sceneManager.createCamera("PlayerCam") + self.camera.nearClipDistance = 5 + + def _createFrameListener(self): + self.frameListener = CEGUIFrameListener(self.renderWindow, self.camera, self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(True) + + def __del__(self): + "Clear variables, this is needed to ensure the correct order of deletion" + del self.camera + del self.sceneManager + del self.frameListener + del self.CEGUISystem + del self.CEGUIRenderer + del self.root + del self.renderWindow + +class CEGUIFrameListener(GuiFrameListener): + + def __init__(self, renderWindow, camera, sceneManager): + GuiFrameListener.__init__(self, renderWindow, camera, sceneManager) + + self.keepRendering = True # whether to continue rendering or not + + + def frameStarted(self, evt): + if not self.keepRendering: + return False + else: + return GuiFrameListener.frameStarted(self,evt) + + +if __name__ == '__main__': + try: + ta = GEUIApplication() + ta.go() + except ogre.OgreException, e: + print e Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_ScrollablePanev061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_ScrollablePanev061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_ScrollablePanev061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,252 @@ +#/*************************************************************************** +# * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team +# * +# * Permission is hereby granted, free of charge, to any person obtaining +# * a copy of this software and associated documentation files (the +# * "Software"), to deal in the Software without restriction, including +# * without limitation the rights to use, copy, modify, merge, publish, +# * distribute, sublicense, and/or sell copies of the Software, and to +# * permit persons to whom the Software is furnished to do so, subject to +# * the following conditions: +# * +# * The above copyright notice and this permission notice shall be +# * included in all copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# * OTHER DEALINGS IN THE SOFTWARE. +# ***************************************************************************/ + + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +from CEGUI_framework import * + + +def createUVector2( x, y): + return CEGUI.UVector2(CEGUI.UDim(x,0), CEGUI.UDim(y,0)) + +# Handler for the 'Demo -> New dialog' menu item +def demoNewDialog(args): + # add a dialog to this pane so we have some more stuff to drag around :) + dlg = CEGUI.WindowManager.getSingletonPtr().createWindow("WindowsLook/FrameWindow") + dlg.setMinSize(CEGUI.UVector2(CEGUI.UDim(0,200),CEGUI.UDim(0,100))) + dlg.setText("Drag me around too!") + + # we put this in the center of the viewport into the scrollable pane + uni_center = CEGUI.UVector2( CEGUI.UDim(0.5,0), CEGUI.UDim(0.5,0) ) + d_root = CEGUI.WindowManager.getSingletonPtr().getWindow("RootWindow") + d_pane = CEGUI.WindowManager.getSingletonPtr().getWindow("DialogPane") + + center = CEGUI.CoordConverter.windowToScreen(d_root, uni_center) + target = CEGUI.CoordConverter.screenToWindow(d_pane.getContentPane(), center) + dlg.setPosition(CEGUI.UVector2( CEGUI.UDim(0,target.d_x-100), + CEGUI.UDim(0,target.d_y-50))) + + d_pane.addChildWindow(dlg) + + return True + +#Handler for global hotkeys +def hotkeysHandler(e): + k = e + if k.scancode == CEGUI.Key.Space: + # space is a hotkey for demo -> new dialog + # this handler does not use the event args at all so this is fine :) + # though maybe a bit hackish... + demoNewDialog(e) + else: + return False + return True + +class GEUIApplication(SampleFramework.Application): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.CEGUIRenderer = 0 + self.CEGUISystem = 0 + self.menuItems = [] + + def _createScene(self): + + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.25, 0.25, 0.25) + + # initiaslise CEGUI Renderer + self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + False, 3000, + self.sceneManager) + + self.CEGUISystem = CEGUI.System(self.CEGUIRenderer) + CEGUI.Logger.getSingleton().loggingLevel = CEGUI.Insane + + # load TaharezLook scheme + CEGUI.SchemeManager.getSingleton().loadScheme("WindowsLook.scheme") + + ## load the default font + if not CEGUI.FontManager.getSingleton().isFontPresent("DejaVuSans-10.font"): + d_font = CEGUI.FontManager.getSingleton().createFont("DejaVuSans-10.font") + else: + d_font = CEGUI.FontManager.getSingleton().getFont("DejaVuSans-10") + + # to look more like a real application, we override the autoscale setting + # for both skin and font + wndlook = CEGUI.ImagesetManager.getSingleton().getImageset("WindowsLook") + wndlook.setAutoScalingEnabled(False) + d_font.setProperty("AutoScaled", "false") + + # set the mouse cursor + d_system = CEGUI.System.getSingletonPtr() + d_system.setDefaultMouseCursor(wndlook.getImage("MouseArrow")) + + # set the default tooltip type + d_system.setDefaultTooltip("WindowsLook/Tooltip") + + # We need the window manager to set up the test interface :) + d_wm = CEGUI.WindowManager.getSingletonPtr() + + # create a root window + # this will be a static, to give a nice app'ish background + d_root = d_wm.createWindow("WindowsLook/Static","RootWindow") + d_root.setProperty("FrameEnabled", "false") + # root window will take care of hotkeys + d_root.subscribeEvent( + CEGUI.Window.EventKeyDown, hotkeysHandler,"") + + + d_system.setGUISheet(d_root) + + # create a menubar. + # this will fit in the top of the screen and have options for the demo + bar_bottom = CEGUI.UDim(0,d_font.getLineSpacing(2)) + + bar = d_wm.createWindow("WindowsLook/Menubar") + bar.setArea(CEGUI.UDim(0,0),CEGUI.UDim(0,0),CEGUI.UDim(1,0),bar_bottom) + bar.setAlwaysOnTop(True) # we want the menu on top + d_root.addChildWindow(bar) + + # fill out the menubar + self.createMenu(bar) + + # create a scrollable pane for our demo content + d_pane = d_wm.createWindow("WindowsLook/ScrollablePane","DialogPane") + d_pane.setArea(CEGUI.URect( CEGUI.UDim(0,0), + bar_bottom, + CEGUI.UDim(1,0), + CEGUI.UDim(1,0))) + # this scrollable pane will be a kind of virtual desktop in the sense + # that it's bigger than the screen 3000 x 3000 pixels + d_pane.setContentPaneAutoSized(False) + d_pane.setContentPaneArea(CEGUI.Rect(0,0,3000,3000)) + d_root.addChildWindow(d_pane) + + # add a dialog to this pane so we have something to drag around :) + dlg = d_wm.createWindow("WindowsLook/FrameWindow") + dlg.setMinSize(CEGUI.UVector2(CEGUI.UDim(0,250),CEGUI.UDim(0,100))) + dlg.setText("Drag me around") + d_pane.addChildWindow(dlg) + + + # Creates the menu bar and fills it up :) + def createMenu(self, bar): + + d_wm = CEGUI.WindowManager.getSingletonPtr() + # file menu item + file = d_wm.createWindow("WindowsLook/MenuItem") + file.setText("File") + bar.addChildWindow(file) + + # file popup + popup = d_wm.createWindow("WindowsLook/PopupMenu") + file.addChildWindow(popup) + + # quit item in file menu + item = d_wm.createWindow("WindowsLook/MenuItem","QuitItem") + item.setText("Quit") + popup.addChildWindow(item) + + # demo menu item + demo = d_wm.createWindow("WindowsLook/MenuItem") + demo.setText("Demo") + bar.addChildWindow(demo) + + # demo popup + popup = d_wm.createWindow("WindowsLook/PopupMenu") + demo.addChildWindow(popup) + + # demo -> new window + item = d_wm.createWindow("WindowsLook/MenuItem","NewDialogWindow") + item.setText("New dialog") + item.setTooltipText("Hotkey: Space") + + item.subscribeEvent( + "Clicked", demoNewDialog,"") + + popup.addChildWindow(item) + + + + + def _createCamera(self): + self.camera = self.sceneManager.createCamera("PlayerCam") + self.camera.nearClipDistance = 5 + + def _createFrameListener(self): + self.frameListener = CEGUIFrameListener(self.renderWindow, self.camera, self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(True) + + def __del__(self): + "Clear variables, this is needed to ensure the correct order of deletion" + del self.camera + del self.sceneManager + del self.frameListener + del self.CEGUISystem + del self.CEGUIRenderer + del self.root + del self.renderWindow + +class CEGUIFrameListener(GuiFrameListener): + + def __init__(self, renderWindow, camera, sceneManager): + GuiFrameListener.__init__(self, renderWindow, camera, sceneManager) + + self.keepRendering = True # whether to continue rendering or not + + item = CEGUI.WindowManager.getSingleton().getWindow("QuitItem") + item.subscribeEvent( + "Clicked", self, "fileQuit") + + # if something goes wrong, log the issue but do not bomb! + #except CEGUI.Exception, e: + # print e + + def fileQuit(self, args): + self.keepRendering = False + return True + + def frameStarted(self, evt): + if not self.keepRendering: + return False + else: + return GuiFrameListener.frameStarted(self,evt) + + +if __name__ == '__main__': + try: + ta = GEUIApplication() + ta.go() + except ogre.OgreException, e: + print e Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_TabControlv061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_TabControlv061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_TabControlv061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,371 @@ +#/*************************************************************************** +# * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team +# * +# * Permission is hereby granted, free of charge, to any person obtaining +# * a copy of this software and associated documentation files (the +# * "Software"), to deal in the Software without restriction, including +# * without limitation the rights to use, copy, modify, merge, publish, +# * distribute, sublicense, and/or sell copies of the Software, and to +# * permit persons to whom the Software is furnished to do so, subject to +# * the following conditions: +# * +# * The above copyright notice and this permission notice shall be +# * included in all copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# * OTHER DEALINGS IN THE SOFTWARE. +# ***************************************************************************/ + + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +from CEGUI_framework import * + +def getPageTextList(): + PageText= [ + "This is page three",\ + "And this is page four, it's not too different from page three, isn't it?",\ + "Yep, you guessed, this is page five",\ + "And this is page six",\ + "Seven",\ + "Eight",\ + "Nine. Quite boring, isn't it?",\ + "Ten",\ + "Eleven",\ + "Twelve",\ + "Thirteen",\ + "Fourteen",\ + "Fifteen",\ + "And, finally, sixteen. Congrats, you found the last page!" ] + return PageText + +def cegui_reldim ( x ) : + return CEGUI.UDim((x),0) + +class GEUIApplication(SampleFramework.Application): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.CEGUIRenderer = 0 + self.CEGUISystem = 0 + self.ListItems = [] + + def _createScene(self): + + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.25, 0.25, 0.25) + + # initiaslise OgreCEGUI Renderer + + self.CEGUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, + ogre.RenderQueueGroupID.RENDER_QUEUE_OVERLAY, + False, 3000, + self.sceneManager) + self.CEGUISystem = CEGUI.System(self.CEGUIRenderer) + + ## set the logging level + CEGUI.Logger.getSingleton().loggingLevel = CEGUI.Insane + + ## we will make extensive use of the WindowManager. + winMgr = CEGUI.WindowManager.getSingleton() + + # load scheme and set up defaults + CEGUI.SchemeManager.getSingleton().loadScheme("TaharezLook.scheme") + CEGUI.System.getSingleton().setDefaultMouseCursor ("TaharezLook", "MouseArrow") + # Load font when not present in the scheme + fontMgr = CEGUI.FontManager.getSingleton() + if not fontMgr.isFontPresent("DejaVuSans-10"): # Request by name, not by file! + # First font gets set as the default font automatically + CEGUI.FontManager.getSingleton().createFont("DejaVuSans-10.font") + + # load an image to use as a background + CEGUI.ImagesetManager.getSingleton().createImagesetFromImageFile("BackgroundImage", "GPN-2000-001437.tga") + + # here we will use a StaticImage as the root, then we can use + # it to place a background image + background = winMgr.createWindow ("TaharezLook/StaticImage") + ## set area rectangle + background.setArea(CEGUI.URect ( cegui_reldim (0), cegui_reldim (0), + cegui_reldim (1), cegui_reldim (1))) + # disable frame and standard background + background.setProperty ("FrameEnabled", "false") + background.setProperty ("BackgroundEnabled", "false") + # set the background image + background.setProperty ("Image", "set:BackgroundImage image:full_image") + # install this as the root GUI sheet + CEGUI.System.getSingleton ().setGUISheet(background) + + # set tooltip styles (by default there is none) + CEGUI.System.getSingleton().setDefaultTooltip ("TaharezLook/Tooltip") + + # load some demo windows and attach to the background 'root' + # because of the 2nd parameter, all windows get prefixed with + # "TabControlDemo/" + ## workaround for python ogre, we don't have loadWindowLayout with prefix + ## so we assing random prefix to ensure unique window loaded and then set + ## prefix + + prefix = "TabControlDemo/" + w = winMgr.loadWindowLayout("TabControlDemo.layout", prefix,"General") + background.addChildWindow(w) + print w.getName() + + tc = winMgr.getWindow ("TabControlDemo/Frame/TabControl") + + # Add some pages to tab control + tc.addTab (winMgr.loadWindowLayout("TabPage1.layout", prefix, "General")) + tc.addTab (winMgr.loadWindowLayout("TabPage2.layout", prefix, "General")) + + # What did it load? + ## WindowManager::WindowIterator + #it = CEGUI.WindowManager::getSingleton().getIterator() + #for(; !it.isAtEnd() ; ++it) { + # const char* windowName = it.getCurrentValue()->getName().c_str(); + # printf("Name: %s\n", windowName); + #} + + winMgr.getWindow("TabControlDemo/Page1/AddTab").subscribeEvent ( + CEGUI.PushButton.EventClicked,self, "handleAddTab") + + # Click to visit this tab + winMgr.getWindow("TabControlDemo/Page1/Go").subscribeEvent( + CEGUI.PushButton.EventClicked,self, + "handleGoto") + + # Click to make this tab button visible (when scrolling is required) + winMgr.getWindow("TabControlDemo/Page1/Show").subscribeEvent ( + CEGUI.PushButton.EventClicked, self, + "handleShow") + + winMgr.getWindow("TabControlDemo/Page1/Del").subscribeEvent ( + CEGUI.PushButton.EventClicked, self, + "handleDel") + + rb = winMgr.getWindow("TabControlDemo/Page1/TabPaneTop") + rb.setSelected (tc.getTabPanePosition() == CEGUI.TabControl.Top) + rb.subscribeEvent ( + CEGUI.RadioButton.EventSelectStateChanged, self, + "handleTabPanePos") + + rb = winMgr.getWindow("TabControlDemo/Page1/TabPaneBottom") + rb.setSelected (tc.getTabPanePosition() == CEGUI.TabControl.Bottom) + rb.subscribeEvent ( + CEGUI.RadioButton.EventSelectStateChanged, self, + "handleTabPanePos") + + sb = winMgr.getWindow("TabControlDemo/Page1/TabHeight") + sb.setScrollPosition (tc.getTabHeight().d_offset) + sb.subscribeEvent ( + CEGUI.Scrollbar.EventScrollPositionChanged, self, + "handleTabHeight") + + sb = winMgr.getWindow("TabControlDemo/Page1/TabPadding") + sb.setScrollPosition (tc.getTabTextPadding().d_offset) + sb.subscribeEvent ( + CEGUI.Scrollbar.EventScrollPositionChanged, self, + "handleTabPadding") + + self.refreshPageList() + + + def refreshPageList(self): + winMgr = CEGUI.WindowManager.getSingleton() + # Check if the windows exists + lbox = None + tc = None + if winMgr.isWindowPresent("TabControlDemo/Page1/PageList"): + lbox = winMgr.getWindow("TabControlDemo/Page1/PageList") + + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + tc = winMgr.getWindow("TabControlDemo/Frame/TabControl") + + if lbox and tc: + lbox.resetList() + for i in range( tc.getTabCount() ): + item = CEGUI.ListboxTextItem(tc.getTabContentsAtIndex(i).getName()) + item.setSelectionBrushImage("TaharezLook", + "MultiListSelectionBrush") + # ensure Python is in control of it's "deletion" + item.AutoDeleted = False + lbox.addItem( item) + self.ListItems.append(item) + + + def handleTabPanePos(self, e): + + if e.window.getID()==0: + tpp = CEGUI.TabControl.Top + elif e.window.getID()==1: + tpp = CEGUI.TabControl.Bottom + else: + return False + + # Check if the window exists + winMgr = CEGUI.WindowManager.getSingleton() + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + winMgr.getWindow ( + "TabControlDemo/Frame/TabControl").setTabPanePosition(tpp) + return True + + def handleTabHeight(self, e): + sb = e.window + + # Check if the window exists + winMgr = CEGUI.WindowManager.getSingleton() + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + CEGUI.WindowManager.getSingleton().getWindow( + "TabControlDemo/Frame/TabControl").setTabHeight ( + CEGUI.UDim (0, sb.getScrollPosition())) + + # The return value mainly sais that we handled it, + # not if something failed. + return True + + def handleTabPadding(self, e): + sb = e.window + + # Check if the window exists + winMgr = CEGUI.WindowManager.getSingleton() + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + winMgr.getWindow ( + "TabControlDemo/Frame/TabControl").setTabTextPadding ( + CEGUI.UDim (0, sb.getScrollPosition ())) + return True + + def handleAddTab(self, e): + sb = e.window + winMgr = CEGUI.WindowManager.getSingleton() + # Check if the window exists + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + tc = winMgr.getWindow ( + "TabControlDemo/Frame/TabControl") + + # Add some tab buttons once + for num in range(3,17): + prefix = "TabControlDemo/Page%d" %(num) + if not winMgr.isWindowPresent(prefix): + pg = None + #try: + pg = winMgr.loadWindowLayout("TabPage.layout", prefix,"General") + + #except: + # print "Some error occured while adding a tabpage. Please see the logfile." + prefix = prefix + "Text" + # This window has just been created while loading the layout + print "is Present", winMgr.isWindowPresent(prefix) + if winMgr.isWindowPresent(prefix): + txt = winMgr.getWindow(prefix) + txt.setText( getPageTextList()[num - 3]) + pgname = "Page %d" %(num) + pg.setText(pgname) + tc.addTab(pg) + self.refreshPageList() + return True + + def handleGoto(self, e): + winMgr = CEGUI.WindowManager.getSingleton() + # Check if the windows exists + lbox = None + tc = None + if winMgr.isWindowPresent("TabControlDemo/Page1/PageList"): + lbox = winMgr.getWindow( + "TabControlDemo/Page1/PageList") + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + tc = winMgr.getWindow ( + "TabControlDemo/Frame/TabControl") + if lbox and tc: + lbi = lbox.getFirstSelectedItem() + if lbi: + tc.setSelectedTab(lbi.getText()) + return True + + def handleShow(self, e): + winMgr = CEGUI.WindowManager.getSingleton() + # Check if the windows exists + lbox = None + tc = None + if winMgr.isWindowPresent("TabControlDemo/Page1/PageList"): + lbox = winMgr.getWindow( + "TabControlDemo/Page1/PageList") + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + tc = winMgr.getWindow ( + "TabControlDemo/Frame/TabControl") + + if lbox and tc: + lbi = lbox.getFirstSelectedItem() + if lbi: + tc.makeTabVisible(lbi.getText()) + + return True + + def handleDel(self, e): + winMgr = CEGUI.WindowManager.getSingleton() + # Check if the windows exists + lbox = None + tc = None + if winMgr.isWindowPresent("TabControlDemo/Page1/PageList"): + lbox = winMgr.getWindow( + "TabControlDemo/Page1/PageList") + if winMgr.isWindowPresent("TabControlDemo/Frame/TabControl"): + tc = winMgr.getWindow ( + "TabControlDemo/Frame/TabControl") + + if lbox and tc: + lbi = lbox.getFirstSelectedItem() + if lbi: + tc.removeTab(lbi.getText()) + # Remove the actual window from Cegui + winMgr.destroyWindow(lbi.getText()) + self.refreshPageList() + return True + + + def _createCamera(self): + self.camera = self.sceneManager.createCamera("PlayerCam") + self.camera.nearClipDistance = 5 + + def _createFrameListener(self): + self.frameListener = CEGUIFrameListener(self.renderWindow, self.camera, self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(True) + + def __del__(self): + "Clear variables, this is needed to ensure the correct order of deletion" + del self.camera + del self.sceneManager + del self.frameListener + del self.CEGUISystem + del self.CEGUIRenderer + del self.root + del self.renderWindow + +class CEGUIFrameListener(GuiFrameListener): + + def __init__(self, renderWindow, camera, sceneManager): + GuiFrameListener.__init__(self, renderWindow, camera, sceneManager) + self.MenuMode=True + self.keepRendering = True # whether to continue rendering or not + + + def frameStarted(self, evt): + return GuiFrameListener.frameStarted(self,evt) + + +if __name__ == '__main__': + try: + ta = GEUIApplication() + ta.go() + except ogre.OgreException, e: + print e Added: trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py (rev 0) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,363 @@ +### +### This demo is a based on the cegui Tree example +### + + +##/************************************************************************* +## Crazy Eddie's GUI System (http://www.cegui.org.uk) +## Copyright (C)2004 - 2005 Paul D Turner (paul@...) +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## *************************************************************************/ + + +import sys +import os +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.io.OIS as OIS +import ogre.gui.CEGUI as CEGUI +import SampleFramework + +import sys, exceptions, random + +from CEGUI_framework import * + +# Note: only taharez scheme works, the cegui demo Vanilla TreeDemo.layout is +# missing +def getSchemeDict(scheme): + SCHEME_DICT = {} + + if scheme=="Vanilla": + SCHEME_DICT['SCHEME_FILE_NAME'] = "VanillaSkin.scheme" + SCHEME_DICT['IMAGES_FILE_NAME'] = "Vanilla-Images" + SCHEME_DICT['STATICIMAGE_NAME'] = "Vanilla/StaticImage" + SCHEME_DICT['TOOLTIP_NAME'] = "Vanilla/Tooltip" + SCHEME_DICT['LAYOUT_FILE_NAME'] = "TreeDemo.layout" + SCHEME_DICT['BRUSH_NAME'] = "GenericBrush" + else: + SCHEME_DICT['SCHEME_FILE_NAME'] = "TaharezLook.scheme" + SCHEME_DICT['IMAGES_FILE_NAME'] = "TaharezLook" + SCHEME_DICT['STATICIMAGE_NAME'] = "TaharezLook/StaticImage" + SCHEME_DICT['TOOLTIP_NAME'] = "TaharezLook/Tooltip" + SCHEME_DICT['LAYOUT_FILE_NAME'] = "TreeDemoTaharez.layout" + SCHEME_DICT['BRUSH_NAME'] = "TextSelectionBrush" + return SCHEME_DICT + + +def getSchemeFonts(): + SCHEME_FONT = {} + SCHEME_FONT['Commonwealth-10'] = "Commonwealth-10.font" + SCHEME_FONT['BlueHighway-12'] = "bluehighway-12.font" + SCHEME_FONT['BlueHighway-10'] = "bluehighway-10.font" + SCHEME_FONT['BlueHighway-8'] = "bluehighway-8.font" + return SCHEME_FONT + + +def cegui_reldim ( x ) : + return CEGUI.UDim((x),0) + +## ==================================================================== +class MaterialEditor(object): + + def __init__(self, text): + self.editBox = CEGUI.WindowManager.getSingleton().getWindow('MaterialEditor/MultiLineEditbox') + self.editFrame = CEGUI.WindowManager.getSingleton().getWindow('MaterialEditor') + self.enable(True) + self.update(text) + self.editFrame.setVisible(True) + + def __del__(self): + self.enable(False) + self.editFrame.setVisible(False) + + def enable(self, enableFlag): + self.editFrame.setEnabled(enableFlag) + + def clear(self, enableFlag): + self.editFrame.setText( '' ) + self.editBox.setText( '' ) + + def update(self, text): + self.editFrame.setText( text ) + mm = ogre.MaterialManager.getSingleton() + rm = ogre.ResourceGroupManager.getSingleton() + ds = rm.openResource(text, "General", True) + self.editBox.setText(ds.getAsString()) + + +## ========================================================= + +class GuiApplication ( SampleFramework.Application ): + + def __init__(self): + SampleFramework.Application.__init__(self) + self.GUIRenderer=0 + self.GUIsystem =0 + self.EditorGuiSheet=0 + self.ListItems = [] + self.resourceEditor = None + + def __del__(self): + del self.camera + del self.sceneManager + del self.frameListener + if self.resourceEditor: + self.resourceEditor = None + try: + if self.EditorGuiSheet: + CEGUI.WindowManager.getSingleton().destroyWindow(self.EditorGuiSheet) + except: + pass + del self.GUIsystem + del self.GUIRenderer + del self.root + del self.renderWindow + + def _setUpResources(self): + ogre.ResourceGroupManager.getSingleton().addResourceLocation("../media/gui", "FileSystem", "General", False) + SampleFramework.Application._setUpResources(self) + + ## Just override the mandatory create scene method + def _createScene(self): + sceneManager = self.sceneManager + sceneManager.ambientLight = ogre.ColourValue(0.5, 0.5, 0.5) + + ## Create a skydome + self.sceneManager.setSkyDome(True, "Examples/CloudySky", 5, 8) + + ## Create a light + l = self.sceneManager.createLight("MainLight") + l.setPosition(20,80,50) + + ## create Ogre CEGUI Renderer + self.GUIRenderer = CEGUI.OgreCEGUIRenderer( self.renderWindow,\ + ogre.RENDER_QUEUE_OVERLAY,\ + False,\ + 3000,\ + self.sceneManager) + ## setup GUI system + self.GUIsystem = CEGUI.System(self.GUIRenderer) + logger = CEGUI.Logger.getSingleton() + logger.setLoggingLevel( CEGUI.Informative ) + + # we will make extensive use of the WindowManager. + winMgr = CEGUI.WindowManager.getSingleton() + + ## get scheme characteristics + SCHEME_DICT = getSchemeDict('TaharezLook') + ##print SCHEME_DICT['SCHEME_FILE_NAME'] + ##print SCHEME_DICT['IMAGES_FILE_NAME'] + ##print SCHEME_DICT['STATICIMAGE_NAME'] + ##print SCHEME_DICT['TOOLTIP_NAME'] + ##print SCHEME_DICT['LAYOUT_FILE_NAME'] + ##print SCHEME_DICT['BRUSH_NAME'] + + ## load scheme and set up defaults + CEGUI.SchemeManager.getSingleton().loadScheme(SCHEME_DICT['SCHEME_FILE_NAME']) + self.GUIsystem.setDefaultMouseCursor(SCHEME_DICT['IMAGES_FILE_NAME'], "MouseArrow") + ######## + + ## Load Fonts + SCHEME_FONTS = getSchemeFonts() + for f in SCHEME_FONTS.keys(): + if not CEGUI.FontManager.getSingleton().isFontPresent(f): + CEGUI.FontManager.getSingleton().createFont(SCHEME_FONTS[f]) + self.GUIsystem.setDefaultFont( "BlueHighway-12") + ######## + + ## load image to use as a background + CEGUI.ImagesetManager.getSingleton().createImagesetFromImageFile("BackgroundImage", "GPN-2000-001437.tga") + + ## here we will use a StaticImage as the root, then we can use it to place a background image + background = winMgr.createWindow(SCHEME_DICT['STATICIMAGE_NAME'] , "background_wnd") + ## set position and size + background.setPosition(CEGUI.UVector2(cegui_reldim(0), cegui_reldim( 0))) + background.setSize(CEGUI.UVector2(cegui_reldim(1), cegui_reldim( 1))) + ## disable frame and standard background + background.setProperty("FrameEnabled", "false") + background.setProperty("BackgroundEnabled", "false") + ## set the background image + background.setProperty("Image", "set:BackgroundImage image:full_image") + ## install this as the root GUI sheet + CEGUI.System.getSingleton().setGUISheet(background) + ######## + + + ## now we create a DefaultWindow which we will attach all the widgets to + sheet = winMgr.createWindow("DefaultWindow", "root_wnd") + ## attach this to the 'real' root + background.addChildWindow(sheet) + ######## + + ## load tree layout + TreeDemoWindow = winMgr.loadWindowLayout(SCHEME_DICT['LAYOUT_FILE_NAME'], False) + ######## + + background.addChildWindow(winMgr.getWindow('DemoWindow')) + background.addChildWindow(winMgr.getWindow('MaterialEditor')) + + ## activate the background window + background.activate() + + ### IMPORTANT + ### - we have to create and hold a reference for our trees icon images + drives = CEGUI.ImagesetManager.getSingleton().createImageset("DriveIcons.imageset") + iconArray = [] + iconImages = [ "Artic",\ + "Black",\ + "Sunset",\ + "DriveStack",\ + "GlobalDrive",\ + "Blue",\ + "Lime",\ + "Silver",\ + "GreenCandy"] + iconArray = [ drives.getImage(image) for image in iconImages ] + self.iconArray = iconArray + + ## tree variables and events + IMAGES_FILE_NAME = SCHEME_DICT['IMAGES_FILE_NAME'] + BRUSH_NAME = SCHEME_DICT['BRUSH_NAME'] + theTree = winMgr.getWindow('DemoWindow/Tree') + theTree.initialise() + + theTree.subscribeEvent( CEGUI.Tree.EventSelectionChanged,\ + self,\ + "handleEventSelectionChanged") + theTree.subscribeEvent( CEGUI.Tree.EventBranchOpened,\ + self,\ + "handleEventBranchOpened") + theTree.subscribeEvent( CEGUI.Tree.EventBranchClosed,\ + self,\ + "handleEventBranchClosed") + + ######## + + ## helper to add list to TreeCtrl + def addListToTree(resourceList, parentItem, iconName): + for r in resourceList: + meshCtrlItem = CEGUI.TreeItem(r) + meshCtrlItem.setIcon(drives.getImage(iconName)) + meshCtrlItem.setSelectionBrushImage(IMAGES_FILE_NAME, BRUSH_NAME) + meshCtrlItem.AutoDeleted = False + meshCtrlItem.setFont("BlueHighway-12") + parentItem.addItem(meshCtrlItem) + self.ListItems.append(meshCtrlItem) + + ## helper to create TreeCtrl item + def createListItem(text, parentItem, iconName): + meshCtrlItem = CEGUI.TreeItem(text) + meshCtrlItem.setIcon(drives.getImage(iconName)) + meshCtrlItem.setSelectionBrushImage(IMAGES_FILE_NAME, BRUSH_NAME) + meshCtrlItem.AutoDeleted = False + meshCtrlItem.setFont("BlueHighway-12") + parentItem.addItem(meshCtrlItem) + self.ListItems.append(meshCtrlItem) + return meshCtrlItem + + # create root Item + newTreeCtrlEntryLvl1 = createListItem("Ogre Resources", + theTree,"Silver") + # resource items + overlayCtrlItem = createListItem("overlays", + newTreeCtrlEntryLvl1,"Lime") + particleCtrlItem = createListItem("particles", + newTreeCtrlEntryLvl1,"Lime") + matCtrlItem = createListItem("materials", + newTreeCtrlEntryLvl1,"Lime") + matScriptCtrlItem = createListItem("scripts", + matCtrlItem,"Lime") + matProgramCtrlItem = createListItem("programs", + matCtrlItem,"Lime") + + # add resource lists to tree + resManager = ogre.ResourceGroupManager.getSingleton() + + ## overlays + overlayList = resManager.findResourceNames("General", "*.overlay") + addListToTree(overlayList,overlayCtrlItem,"Silver") + + ## particles + particleList = resManager.findResourceNames("General", "*.particle") + addListToTree(particleList,particleCtrlItem,"Silver") + + ## materials + matList = resManager.findResourceNames("General", "*.material") + addListToTree(matList,matScriptCtrlItem,"Silver") + for p in ['cg', 'glsl','hlsl','frag']: + mProgramCtrlItem = createListItem(p, matProgramCtrlItem,"Lime") + matList = resManager.findResourceNames("General", "*.%s" %(p)) + addListToTree(matList,mProgramCtrlItem,"Silver") + + return True + + + ## Create new frame listener + def _createFrameListener(self): + self.frameListener = GuiFrameListener(self.renderWindow, self.camera, self.GUIRenderer) #self.sceneManager) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay(False) + + def handleEventSelectionChanged(self, args): + selectedItem = args.treeItem + if selectedItem: + text = selectedItem.getText().c_str() + itemList = text.split('.') + if len(itemList)>1: + if self.resourceEditor: + self.resourceEditor = None + ext = itemList[1] + if ext == "material": + self.resourceEditor = MaterialEditor(text) + elif ext == "cg": + self.resourceEditor = MaterialEditor(text) + elif ext == "glsl": + self.resourceEditor = MaterialEditor(text) + elif ext == "hlsl": + self.resourceEditor = MaterialEditor(text) + elif ext == "frag": + self.resourceEditor = MaterialEditor(text) + elif ext == "overlay": + self.resourceEditor = MaterialEditor(text) + elif ext == "particle": + self.resourceEditor = MaterialEditor(text) + + return True + + def handleEventBranchOpened(self, args): + print "Branch Open" + return True + + def handleEventBranchClosed(self, args): + print "Branch Closed" + return True + + def handleQuit(self, e): + self.frameListener.requestShutdown() + return True + +if __name__ == '__main__': + try: + ta = GuiApplication() + ta.go() + except ogre.OgreException, e: + print e + + + + Added: trunk/python-ogre/demos/cegui/datafiles/configs/CEGUIConfig.xsd =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/configs/CEGUIConfig.xsd (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/configs/CEGUIConfig.xsd 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"> + + <xsd:element name="CEGUIConfig" type="CEGUIConfigType"/> + + <xsd:simpleType name="LogLevel"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Errors"/> + <xsd:enumeration value="Standard"/> + <xsd:enumeration value="Informative"/> + <xsd:enumeration value="Insane"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:complexType name="CEGUIConfigType"> + <xsd:attribute name="Logfile" type="xsd:string" use="optional" default=""/> + <xsd:attribute name="Scheme" type="xsd:string" use="optional" default=""/> + <xsd:attribute name="DefaultFont" type="xsd:string" use="optional" default=""/> + <xsd:attribute name="Layout" type="xsd:string" use="optional" default=""/> + <xsd:attribute name="InitScript" type="xsd:string" use="optional" default=""/> + <xsd:attribute name="TerminateScript" type="xsd:string" use="optional" default=""/> + <xsd:attribute name="DefaultResourceGroup" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="LoggingLevel" type="LogLevel" use="optional" default="Standard" /> + </xsd:complexType> + +</xsd:schema> + + Property changes on: trunk/python-ogre/demos/cegui/datafiles/fonts/Commonv2c.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/cegui/datafiles/fonts/Commonwealth-10.font =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/Commonwealth-10.font (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/Commonwealth-10.font 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,2 @@ +<?xml version="1.0" ?> +<Font Name="Commonwealth-10" Filename="Commonv2c.ttf" Type="FreeType" Size="10" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/> Added: trunk/python-ogre/demos/cegui/datafiles/fonts/DejaVuSans-10.font =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/DejaVuSans-10.font (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/DejaVuSans-10.font 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,2 @@ +<?xml version="1.0" ?> +<Font Name="DejaVuSans-10" Filename="DejaVuSans.ttf" Type="FreeType" Size="10" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/> Property changes on: trunk/python-ogre/demos/cegui/datafiles/fonts/DejaVuSans.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/cegui/datafiles/fonts/FairChar-30.font =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/FairChar-30.font (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/FairChar-30.font 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,30 @@ +<?xml version="1.0" ?> +<Font Name="FairChar-30" Filename="FairChar.imageset" Type="Pixmap" NativeHorzRes="640" NativeVertRes="480" AutoScaled="false"> + <Mapping Codepoint="32" Image=" " HorzAdvance="15" /> + <Mapping Codepoint="65" Image="A" /> + <Mapping Codepoint="66" Image="B" /> + <Mapping Codepoint="67" Image="C" /> + <Mapping Codepoint="68" Image="D" /> + <Mapping Codepoint="69" Image="E" /> + <Mapping Codepoint="70" Image="F" /> + <Mapping Codepoint="71" Image="G" /> + <Mapping Codepoint="72" Image="H" /> + <Mapping Codepoint="73" Image="I" /> + <Mapping Codepoint="74" Image="J" /> + <Mapping Codepoint="75" Image="K" /> + <Mapping Codepoint="76" Image="L" /> + <Mapping Codepoint="77" Image="M" /> + <Mapping Codepoint="78" Image="N" /> + <Mapping Codepoint="79" Image="O" /> + <Mapping Codepoint="80" Image="P" /> + <Mapping Codepoint="81" Image="Q" /> + <Mapping Codepoint="82" Image="R" /> + <Mapping Codepoint="83" Image="S" /> + <Mapping Codepoint="84" Image="T" /> + <Mapping Codepoint="85" Image="U" /> + <Mapping Codepoint="86" Image="V" /> + <Mapping Codepoint="87" Image="W" /> + <Mapping Codepoint="88" Image="X" /> + <Mapping Codepoint="89" Image="Y" /> + <Mapping Codepoint="90" Image="Z" /> +</Font> Added: trunk/python-ogre/demos/cegui/datafiles/fonts/Font.xsd =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/Font.xsd (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/Font.xsd 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,34 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"> + <xsd:element name="Font" type="FontType" /> + + <xsd:complexType name="FontType"> + <xsd:sequence> + <xsd:element name="Mapping" type="MapType" maxOccurs="unbounded" minOccurs="0" /> + </xsd:sequence> + <xsd:attributeGroup ref="FontAttrs" /> + </xsd:complexType> + <xsd:complexType name="MapType"> + <xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" /> + <xsd:attribute name="Image" type="xsd:string" use="required" /> + <xsd:attribute name="HorzAdvance" type="xsd:integer" use="optional" default="-1" /> + </xsd:complexType> + <xsd:attributeGroup name="FontAttrs"> + <xsd:attribute name="Name" type="xsd:string" use="required" /> + <xsd:attribute name="Filename" type="xsd:string" use="required" /> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="Type" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="FreeType" /> + <xsd:enumeration value="Pixmap" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="Size" type="xsd:nonNegativeInteger" use="optional" default="12" /> + <xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" /> + <xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" /> + <xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" /> + <xsd:attribute name="AntiAlias" type="xsd:boolean" use="optional" default="true" /> + </xsd:attributeGroup> +</xsd:schema> Added: trunk/python-ogre/demos/cegui/datafiles/fonts/Iconified-12.font =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/Iconified-12.font (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/Iconified-12.font 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,2 @@ +<?xml version="1.0" ?> +<Font Name="Iconified-12" Filename="Iconiv2.ttf" Type="FreeType" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/> Property changes on: trunk/python-ogre/demos/cegui/datafiles/fonts/Iconiv2.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/cegui/datafiles/fonts/Legal.txt =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/Legal.txt (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/Legal.txt 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,29 @@ +The file fkp.de.pcf is a X11 bitmap font, taken from the artwiz font collection: +http://artwizaleczapka.sourceforge.net + +artwiz-aleczapka is released under the terms of GNU General Public License +(GPL) version 2. Read file 'COPYING' from the artwiz package for detailed info. + +================================================================================ + +DejaVuSans.ttf is a international TrueType font from the excellent DejaVu font +package, which is distributed under the conditions of the Bitstream Vera Fonts +Copyright, which can be found in the DejaVu package. + +DejaVu fonts 2.2 (c)2004-2006 Stepan Roh and DejaVu fonts team +-------------------------------------------------------------- + +The DejaVu fonts are a font family based on the Bitstream Vera Fonts +(http://gnome.org/fonts/). Its purpose is to provide a wider range of +characters (see status.txt for more information) while maintaining the +original look and feel. + +DejaVu fonts are based on Bitstream Vera fonts version 1.10. + +================================================================================ + +FairChar.font is a image-based font from the good old days of the demo scene, +when 320x240 and 320x480 were the best resolutions invented ever ;-) I don't +know who is the original author of these nice glyphs, everything but the .GIF +file was lost in the long road from early 90s, when I got it from some BBS +to nowadays... -- Andrew Zabolotny. Added: trunk/python-ogre/demos/cegui/datafiles/fonts/README =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/README (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/README 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,4 @@ +The fonts in this directory were obtained from Iconian Fonts and may be freely used for all non-commercial uses. + +http://www.iconian.com/ + \ No newline at end of file Added: trunk/python-ogre/demos/cegui/datafiles/fonts/common.txt =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/common.txt (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/common.txt 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,9 @@ +Commonwealth Truetype Font for Windows version 2 + +2003 Iconian Fonts - Daniel Zadorozny + +http://www.iconian.com/ + +This font may be freely distributed and is free for all non-commercial uses. This font is e-mailware; that is, if you like it, please e-mail the author at: + +iconian@... \ No newline at end of file Added: trunk/python-ogre/demos/cegui/datafiles/fonts/fkp-16.font =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/fkp-16.font (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/fkp-16.font 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,2 @@ +<?xml version="1.0" ?> +<Font Name="fkp-16" Filename="fkp.de.pcf" Type="FreeType" Size="16" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/> Property changes on: trunk/python-ogre/demos/cegui/datafiles/fonts/fkp.de.pcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/cegui/datafiles/fonts/icon.txt =================================================================== --- trunk/python-ogre/demos/cegui/datafiles/fonts/icon.txt (rev 0) +++ trunk/python-ogre/demos/cegui/datafiles/fonts/icon.txt 2008-07-17 10:38:12 UTC (rev 662) @@ -0,0 +1,11 @@ +Iconified Truetype Font for Windows version 2 + +2003 Iconian Fonts - Daniel Zadorozny + +http://www.iconian.com/ + +"Iconified" was named by Graham Meade of Gemfonts (http://skyscraper.fortunecity.com/windows/3/maingemnew.htm) + @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-07-22 09:50:58
|
Revision: 665 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=665&view=rev Author: mithro Date: 2008-07-22 09:51:07 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Fixed boost_python_index for non-deb builds. Modified Paths: -------------- trunk/python-ogre/boost/debian/rules trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/boost/Makefile Added: trunk/python-ogre/boost/Makefile =================================================================== --- trunk/python-ogre/boost/Makefile (rev 0) +++ trunk/python-ogre/boost/Makefile 2008-07-22 09:51:07 UTC (rev 665) @@ -0,0 +1,25 @@ + +export GCC_VERSION=`gcc --version | head -1 | sed -e's/.*) \([0-9]\)\.\([0-9]\).*/\1\2/'` +export PYTHON_VERSION=`python -V 2>&1 | sed -e's/Python \(2\.[45]\).*/\1/'` + +all: libs/python/src/indexing/indexing_slice.cpp libs/python/src/indexing/python_iterator.cpp + g++ $? \ + -I . \ + -I /usr/include/python${PYTHON_VERSION} \ + -shared -Wl,-soname,libboost_python_index-gcc${GCC_VERSION}-1_34_1.so -o libboost_python_index-gcc${GCC_VERSION}-1_34_1.so -fPIC \ + -lboost_python \ + -lpython${PYTHON_VERSION} + +install: + mkdir -p ${PREFIX}/usr/lib + cp libboost_python_index-gcc${GCC_VERSION}-1_34_1.so ${PREFIX}/usr/lib + ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-1_34_1.so ${PREFIX}/usr/lib/libboost_python_index.so + + mkdir -p ${PREFIX}/usr/include + cp -rvf boost ${PREFIX}/usr/include + rm -rf `find ${PREFIX}/usr/include -name .svn -type d` + +clean: + rm *.so + +.PHONY: install clean Modified: trunk/python-ogre/boost/debian/rules =================================================================== --- trunk/python-ogre/boost/debian/rules 2008-07-22 04:45:24 UTC (rev 664) +++ trunk/python-ogre/boost/debian/rules 2008-07-22 09:51:07 UTC (rev 665) @@ -8,7 +8,9 @@ # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 +export DH_COMPAT=2 export GCC_VERSION=`gcc --version | head -1 | sed -e's/.*) \([0-9]\)\.\([0-9]\).*/\1\2/'` +export PYTHON_VERSION=`python -V 2>&1 | sed -e's/Python \(2\.[45]\).*/\1/'` # shared library versions, option 1 #version=2.0.5 @@ -23,25 +25,15 @@ configure-stamp: dh_testdir # Add here commands to configure the package. - + touch configure-stamp - build: build-stamp build-stamp: configure-stamp dh_testdir - - - # Add here commands to compile the package. - g++ \ - ./libs/python/src/indexing/indexing_slice.cpp \ - ./libs/python/src/indexing/python_iterator.cpp \ - -I . \ - -I /usr/include/python2.5 \ - -shared -Wl,-soname,libboost_python_index-gcc${GCC_VERSION}-1_34_1.so -o libboost_python_index-gcc${GCC_VERSION}-1_34_1.so -fPIC \ - -lboost_python \ - -lpython2.5 - + + make all + touch $@ clean: @@ -51,7 +43,7 @@ # Add here commands to clean up after the build process. rm *.so || true - + dh_clean install: build @@ -59,17 +51,10 @@ dh_testroot dh_clean -k dh_installdirs - + # Add here commands to install the package into debian/tmp - mkdir -p $(CURDIR)/debian/tmp/usr/lib - cp libboost_python_index-gcc${GCC_VERSION}-1_34_1.so $(CURDIR)/debian/tmp/usr/lib - ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-1_34_1.so $(CURDIR)/debian/tmp/usr/lib/libboost_python_index.so + PREFIX=$(CURDIR)/debian/tmp make install - mkdir -p $(CURDIR)/debian/tmp/usr/include - cp -rvf boost $(CURDIR)/debian/tmp/usr/include - rm -rf `find $(CURDIR)/debian/tmp/usr/include -name .svn -type d` - - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -84,7 +69,7 @@ dh_movefiles -plibboost-python1.34.1-index-dev /usr/include/boost dh_movefiles -plibboost-python1.34.1-index /usr/lib - + # dh_install # dh_installmenu # dh_installdebconf Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-07-22 04:45:24 UTC (rev 664) +++ trunk/python-ogre/environment.py 2008-07-22 09:51:07 UTC (rev 665) @@ -528,8 +528,10 @@ ["rm","-rf %s" % (base,), os.getcwd()], ["cp",'-rvf %s/ %s' % (os.path.join('python-ogre','boost'), base), os.getcwd()], ] - # FIXME: This should have build commands! - buildCmds = [] + buildCmds = [ + [0,'make all', os.path.join(os.getcwd(), base)], + [0,'PREFIX=%s make install' % PREFIX, os.path.join(os.getcwd(), base)], + ] lib = boost.lib.replace("python", "python_index") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-07-23 10:04:31
|
Revision: 670 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=670&view=rev Author: mithro Date: 2008-07-23 10:04:31 +0000 (Wed, 23 Jul 2008) Log Message: ----------- More fixes to OgreAL. Modified Paths: -------------- trunk/python-ogre/code_generators/ogreal/generate_code.py trunk/python-ogre/debian/changelog trunk/python-ogre/debian/rules trunk/python-ogre/demos/ogreal/Demo_AL_01.py Modified: trunk/python-ogre/code_generators/ogreal/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogreal/generate_code.py 2008-07-23 06:12:17 UTC (rev 669) +++ trunk/python-ogre/code_generators/ogreal/generate_code.py 2008-07-23 10:04:31 UTC (rev 670) @@ -107,7 +107,14 @@ context = main_ns.decl("ALCcontext_struct") context.opaque = True - + + # These symbols are missing from the lib even though they are defined in + # the header file! + main_ns.decl("alSource3i").exclude() + main_ns.decl("alSourceiv").exclude() + main_ns.decl("alGetSource3i").exclude() + main_ns.decl("alGetSourceiv").exclude() + ############################################################ ## ## And things that need to have their argument and call values fixed. @@ -304,9 +311,9 @@ ## now we need to ensure a series of headers and additional source files are ## copied to the generated directory.. -# common_utils.copyTree ( sourcePath = environment.Config.PATH_Config.PATH_OGREAL, -# destPath = environment.ogreal.generated_dir, -# recursive=False ) + common_utils.copyTree ( sourcePath = environment.Config.PATH_OGREAL, + destPath = environment.ogreal.generated_dir, + recursive=False ) if __name__ == '__main__': start_time = time.clock() Modified: trunk/python-ogre/debian/changelog =================================================================== --- trunk/python-ogre/debian/changelog 2008-07-23 06:12:17 UTC (rev 669) +++ trunk/python-ogre/debian/changelog 2008-07-23 10:04:31 UTC (rev 670) @@ -1,3 +1,13 @@ +python-ogre (0.0.0-4) unstable; urgency=low + + * Fixed ogreal to link against boost_python_index. + + -- Tim 'Mithro' Ansell <mithro@...> Wed, 23 Jul 2008 16:13:51 +1000 +python-ogre (0.0.0-3) unstable; urgency=low + + * Really fixed the CEGUI.loadWindowLayout method (now with defaults!). + + -- Tim 'Mithro' Ansell <mithro@...> Wed, 16 Jul 2008 18:19:51 +1000 python-ogre (0.0.0-2) unstable; urgency=low * Fixed the CEGUI.loadWindowLayout method. Modified: trunk/python-ogre/debian/rules =================================================================== --- trunk/python-ogre/debian/rules 2008-07-23 06:12:17 UTC (rev 669) +++ trunk/python-ogre/debian/rules 2008-07-23 10:04:31 UTC (rev 670) @@ -26,7 +26,7 @@ LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c et LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c plib LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c ogreforests -# LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c ogreal + LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c ogreal LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c watermesh touch $@ Modified: trunk/python-ogre/demos/ogreal/Demo_AL_01.py =================================================================== --- trunk/python-ogre/demos/ogreal/Demo_AL_01.py 2008-07-23 06:12:17 UTC (rev 669) +++ trunk/python-ogre/demos/ogreal/Demo_AL_01.py 2008-07-23 10:04:31 UTC (rev 670) @@ -135,7 +135,7 @@ OgreAL.SoundManager.getSingleton().getSound("Roar").play() - bgSound = self.soundManager.createSound("ZeroFactor", "Zero Factor - Untitled.ogg", True, True) + bgSound = self.soundManager.createSound("ZeroFactor", "6chan.ogg", True, True) node = sceneManager.getRootSceneNode().createChildSceneNode("CameraNode") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-07-23 12:08:35
|
Revision: 673 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=673&view=rev Author: mithro Date: 2008-07-23 12:08:42 +0000 (Wed, 23 Jul 2008) Log Message: ----------- Added support for ffmpeg module. Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_system.py trunk/python-ogre/ThirdParty/ffmpeg/videoPlayer.h trunk/python-ogre/debian/changelog trunk/python-ogre/debian/control trunk/python-ogre/debian/rules Modified: trunk/python-ogre/PythonOgreConfig_system.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_system.py 2008-07-23 11:44:41 UTC (rev 672) +++ trunk/python-ogre/PythonOgreConfig_system.py 2008-07-23 12:08:42 UTC (rev 673) @@ -57,7 +57,7 @@ PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.66') ###PATH_PhysX= os.path.join(BASE_DIR, 'Physx/v2.7.3/SDKs') PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') -PATH_ffmpeg= os.path.join(BASE_DIR, 'ffmpeg') +PATH_ffmpeg= os.path.join(BASE_DIR) #, 'ffmpeg') PATH_navi = os.path.join(BASE_DIR, 'navi','Navi') PATH_particleuniverse = os.path.join(PATH_Ogre, 'PlugIns', 'ParticleUniverse' ) PATH_cadunetree= os.path.join(PATH_THIRDPARTY, 'cadunetree') @@ -136,7 +136,7 @@ PATH_INCLUDE_TheoraDemo = os.path.join (PATH_Theora,'..', 'CEGUI_TheoraDemo','include') PATH_INCLUDE_ogrevideoffmpeg = PATH_ogrevideoffmpeg -PATH_INCLUDE_ffmpeg = os.path.join (PATH_ffmpeg,'include') +PATH_INCLUDE_ffmpeg = os.path.join (PATH_ffmpeg,'include', 'ffmpeg') PATH_INCLUDE_plib = PATH_plib PATH_INCLUDE_navi = os.path.join (PATH_navi,'include') PATH_INCLUDE_noise = PATH_noise Modified: trunk/python-ogre/ThirdParty/ffmpeg/videoPlayer.h =================================================================== --- trunk/python-ogre/ThirdParty/ffmpeg/videoPlayer.h 2008-07-23 11:44:41 UTC (rev 672) +++ trunk/python-ogre/ThirdParty/ffmpeg/videoPlayer.h 2008-07-23 12:08:42 UTC (rev 673) @@ -5,13 +5,13 @@ #include "Ogre.h" // // ffmpeg includes -// #include <ffmpeg/avcodec.h> -// #include <ffmpeg/avformat.h> extern "C" { #define __STDC_CONSTANT_MACROS #define __STDC_LIMIT_MACROS -#include <libavformat/avformat.h> -#include <libavcodec/avcodec.h> +#include <ffmpeg/avcodec.h> +#include <ffmpeg/avformat.h> +//#include <libavformat/avformat.h> +//#include <libavcodec/avcodec.h> } using namespace Ogre; Modified: trunk/python-ogre/debian/changelog =================================================================== --- trunk/python-ogre/debian/changelog 2008-07-23 11:44:41 UTC (rev 672) +++ trunk/python-ogre/debian/changelog 2008-07-23 12:08:42 UTC (rev 673) @@ -1,3 +1,8 @@ +python-ogre (0.0.0-5) unstable; urgency=low + + * Fixed the ffmpeg package. + + -- Tim 'Mithro' Ansell <mithro@...> Wed, 23 Jul 2008 22:06:51 +1000 python-ogre (0.0.0-4) unstable; urgency=low * Fixed ogreal to link against boost_python_index. Modified: trunk/python-ogre/debian/control =================================================================== --- trunk/python-ogre/debian/control 2008-07-23 11:44:41 UTC (rev 672) +++ trunk/python-ogre/debian/control 2008-07-23 12:08:42 UTC (rev 673) @@ -16,6 +16,7 @@ libceguiogre-dev (>= 1.4) | libogre-dev (<< 1.4.5), libogre-dev (< 1.5), libopenal-dev, libogg-dev, libvorbis-dev, + libavformat-dev, libavcodec-dev, gccxml (>=0.7.0), pygccxml, pyplusplus Standards-Version: 3.7.2 Modified: trunk/python-ogre/debian/rules =================================================================== --- trunk/python-ogre/debian/rules 2008-07-23 11:44:41 UTC (rev 672) +++ trunk/python-ogre/debian/rules 2008-07-23 12:08:42 UTC (rev 673) @@ -27,6 +27,7 @@ LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c plib LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c ogreforests LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c ogreal + LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c ogrevideoffmpeg LD_PRELOAD='' python BuildModule.py --usesystem --failhard -g -c watermesh touch $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-07-28 06:56:49
|
Revision: 675 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=675&view=rev Author: andy_miller Date: 2008-07-28 06:56:57 +0000 (Mon, 28 Jul 2008) Log Message: ----------- Minor change to windows build messages and Physx wrapper Modified Paths: -------------- trunk/python-ogre/code_generators/physx/python_physx_sizeof.h trunk/python-ogre/demos/theora/demo_video.py trunk/python-ogre/demos/theora/resources.cfg trunk/python-ogre/environment.py Modified: trunk/python-ogre/code_generators/physx/python_physx_sizeof.h =================================================================== --- trunk/python-ogre/code_generators/physx/python_physx_sizeof.h 2008-07-24 12:45:21 UTC (rev 674) +++ trunk/python-ogre/code_generators/physx/python_physx_sizeof.h 2008-07-28 06:56:57 UTC (rev 675) @@ -4,4 +4,10 @@ sizeof(_Nx3F32); sizeof(NxUserEntityReport<unsigned int>); sizeof(NxUserEntityReport<NxShape*>); +sizeof ( NxForceFieldShapeGroup ); +sizeof ( NxArray<NxForceFieldShapeGroup*, NxAllocatorDefault> ); +sizeof ( NxArray<NxShapeDesc*, NxAllocatorDefault> ); +sizeof ( NxArray<NxFluidEmitterDesc, NxAllocatorDefault> ); +sizeof ( NxArray<NxForceFieldShapeDesc*, NxAllocatorDefault> ); +sizeof ( _Nx3F32 ); Modified: trunk/python-ogre/demos/theora/demo_video.py =================================================================== --- trunk/python-ogre/demos/theora/demo_video.py 2008-07-24 12:45:21 UTC (rev 674) +++ trunk/python-ogre/demos/theora/demo_video.py 2008-07-28 06:56:57 UTC (rev 675) @@ -47,7 +47,7 @@ self.Control.setTextureTecPassStateLevel( 0, 0, 0 ) self.Control.setSeekEnabled( False ) - self.Control.setAutoAudioUpdate ( True ) +# self.Control.setAutoAudioUpdate ( True ) mat = ogre.MaterialManager.getSingleton().getByName("Example/TheoraVideoPlayer/Play") #Create the material the first time through this method @@ -97,6 +97,7 @@ ret = sf.FrameListener.frameStarted(self, frameEvent) if self.video and ret: self.video.blitFrameCheck() + self.video.getAudioDriver().autoUpdate() return ret Modified: trunk/python-ogre/demos/theora/resources.cfg =================================================================== --- trunk/python-ogre/demos/theora/resources.cfg 2008-07-24 12:45:21 UTC (rev 674) +++ trunk/python-ogre/demos/theora/resources.cfg 2008-07-28 06:56:57 UTC (rev 675) @@ -3,6 +3,7 @@ # Resource locations to be added to the default path [General] +FileSystem=. FileSystem=../media FileSystem=../media_extra Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-07-24 12:45:21 UTC (rev 674) +++ trunk/python-ogre/environment.py 2008-07-28 06:56:57 UTC (rev 675) @@ -849,7 +849,8 @@ ] buildCmds = [ [0, unzip + " " + os.path.join(downloadPath,base)+".zip", os.getcwd()], - [0, 'echo Please use MSVC to build the CEGUI Release project',''], + [0, 'echo Now run build_vs2008.bat from the CEGUI makefiles\premake directory',''], + [0, 'echo then use MSVC to build the CEGUI Release project',''], [0, 'echo WARNING - Check that RTTI is enabled in the compiler options',''], [0, 'echo Then ensure that OgreGUIRender is compiled with this version of CEGUI',''] ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-07-29 09:34:21
|
Revision: 676 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=676&view=rev Author: andy_miller Date: 2008-07-29 09:34:29 +0000 (Tue, 29 Jul 2008) Log Message: ----------- Initial Implementation for the PCZ Portal Scene Manager Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/demos/theora/demo_video.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/code_generators/ogrepcz/ trunk/python-ogre/code_generators/ogrepcz/customization_data.py trunk/python-ogre/code_generators/ogrepcz/generate_code.py trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz.h trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_aliases.h trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-07-28 06:56:57 UTC (rev 675) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-07-29 09:34:29 UTC (rev 676) @@ -81,6 +81,7 @@ PATH_navi = os.path.join(BASE_DIR, 'navi', 'navi') PATH_particleuniverse = os.path.join(PATH_Ogre, 'PlugIns', 'ParticleUniverse' ) +PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) # it's time for the SDK version if SDK: @@ -174,6 +175,7 @@ ##PATH_INCLUDE_ogreforests = os.path.join (PATH_ogreforests,'include') PATH_INCLUDE_ogreforests = PATH_ogreforests PATH_INCLUDE_particleuniverse = os.path.join(PATH_particleuniverse, 'include' ) +PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include') ,os.path.join(BASE_DIR, 'vorbis', 'include') Added: trunk/python-ogre/code_generators/ogrepcz/customization_data.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/customization_data.py (rev 0) +++ trunk/python-ogre/code_generators/ogrepcz/customization_data.py 2008-07-29 09:34:29 UTC (rev 676) @@ -0,0 +1,17 @@ + +def header_files( version ): + return ["Ogre.h", + "OgrePortal.h", + "OgrePCZSceneNode.h", + "OgrePCZone.h", + "OgrePCZSceneManager.h", + "OgrePCZSceneQuery.h", + "OgrePCZLight.h", + "OgrePCPlane.h", + "OgrePCZFrustum.h" + + ] + +def huge_classes( version ): + return [] + \ No newline at end of file Added: trunk/python-ogre/code_generators/ogrepcz/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/generate_code.py (rev 0) +++ trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-07-29 09:34:29 UTC (rev 676) @@ -0,0 +1,341 @@ +#!/usr/bin/env python +# ----------------------------------------------------------------------------- +# This source file is part of Python-MAIN_NAMESPACE and is covered by the LGPL +# For the latest info, see http://python-ogre.org/ +# +# ----------------------------------------------------------------------------- + +## STARTER TEMPLATE.. +## replace ogrepcz with lowercase project name +## set MAIN_NAMESPACE +## rename and configure .h files + + +import os, sys, time, shutil + +#add environment to the path +sys.path.append( os.path.join( '..', '..' ) ) +#add common utils to the pass +sys.path.append( '..' ) +sys.path.append( '.' ) + +import environment +import common_utils +import customization_data +import hand_made_wrappers + + +from pygccxml import parser +from pygccxml import declarations +from pyplusplus import messages +from pyplusplus import module_builder +from pyplusplus import decl_wrappers + +from pyplusplus import function_transformers as ft +from pyplusplus.module_builder import call_policies +from pyplusplus.module_creator import sort_algorithms + +import common_utils.extract_documentation as exdoc +import common_utils.var_checker as varchecker +import common_utils.ogre_properties as ogre_properties +from common_utils import docit + +MAIN_NAMESPACE = 'Ogre' + +############################################################ +## +## Here is where we manually exclude stuff +## +############################################################ + +def ManualExclude ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + excludes=['::Ogre::PCZCamera', + '::Ogre::PCZSceneManagerFactory' + ] + for e in excludes: + main_ns.class_(e).exclude() + print "Excluded Class:", e + + excludes=['::Ogre::PCZSceneManagerFactory::initMetaData', + '::Ogre::PCZSceneManagerFactory::createInstance', + '::Ogre::PCZSceneManagerFactory::destroyInstance' + ] + for e in excludes: + main_ns.member_functions(e).exclude() + print "Excluded Member Function:", e + + excludes=['::Ogre::PCZSceneManagerFactory::FACTORY_TYPE_NAME' + ] + for e in excludes: + main_ns.variable(e).exclude() + print "Excluded Variable:", e + +############################################################ +## +## And there are things that manually need to be INCLUDED +## +############################################################ + +def ManualInclude ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + +############################################################ +## +## And things that need manual fixes, but not necessarly hand wrapped +## +############################################################ +def ManualFixes ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + for c in global_ns.classes(): + if c.decl_string.startswith("::std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >"): + print "Excluding:", c + c.include(already_exposed=True) + try: + global_ns.namespace("std").class_('vector<Ogre::PlaneBoundedVolume>, std::allocator<Ogre::BoundedVolume> >').exclude() + print "OK1" + except: + print "FAIL1" + try: + main_ns.class_("std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >").exclude() + print "OK2" + except: + print "FAIL2" + try: + main_ns.class_("::std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >").exclude() + print "OK3" + except: + print "FAIL3" + +############################################################ +## +## And things that need to have their argument and call values fixed. +## ie functions that pass pointers in the argument list and of course we need +## to read the updated values - so instead we pass them back +## as new values in a tuple (ETC ETC) +## +############################################################ + +def ManualTransformations ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + + def create_output( size ): + return [ ft.output( i ) for i in range( size ) ] + +# # # this is from the Ogre generate wrapper and is needed to remove vertexData from the camera +# # known = ['indexBuffer', 'vertexData', 'indexData'] +# # for c in mb.classes(): +# # for v in c.variables(allow_empty = True ): +# # if v.name in known: +# # v.apply_smart_ptr_wa = True +# # print "Applying Smart Pointer (know): ", v.name, " of class: ", c.name + + +############################################################################### +## +## Now for the AUTOMATIC stuff that should just work +## +############################################################################### + +def AutoFixes ( mb, MAIN_NAMESPACE ): + """ now we fix a range of things automatically - typically by going through + the entire name space trying to guess stuff and fix it:) + """ + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + + # Functions that have void pointers in their argument list need to change to unsigned int's + pointee_types=[] + ignore_names=[] + common_utils.Fix_Void_Ptr_Args ( main_ns ) # , pointee_types, ignore_names ) + + # and change functions that return a variety of pointers to instead return unsigned int's + pointee_types=[] + ignore_names=[] # these are function names we know it's cool to exclude + common_utils.Fix_Pointer_Returns ( main_ns ) # , pointee_types, ignore_names ) + + # functions that need to have implicit conversions turned off + ImplicitClasses=[] + common_utils.Fix_Implicit_Conversions ( main_ns, ImplicitClasses ) + + if os.name =='nt': + Fix_NT( mb ) + elif os.name =='posix': + Fix_Posix( mb ) + + common_utils.Auto_Document( mb, MAIN_NAMESPACE ) + + +############################################################################### +## +## here are the helper functions that do much of the work +## +############################################################################### +def Fix_Posix ( mb ): + """ fixup for posix specific stuff -- note only expect to be called on a posix machine + """ + ## we could do more here if need be... + if sys.platform == 'darwin': + pass + elif sys.platform.startswith ('linux'): + pass + + +def Fix_NT ( mb ): + """ fixup for NT systems + """ + + +# +# the 'main'function +# +def generate_code(): + messages.disable( +# Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X + messages.W1020 + , messages.W1021 + , messages.W1022 + , messages.W1023 + , messages.W1024 + , messages.W1025 + , messages.W1026 + , messages.W1027 + , messages.W1028 + , messages.W1029 + , messages.W1030 + , messages.W1031 + , messages.W1035 + , messages.W1040 + , messages.W1038 + , messages.W1041 + , messages.W1036 # pointer to Python immutable member + , messages.W1033 # unnamed variables + , messages.W1018 # expose unnamed classes + , messages.W1049 # returns reference to local variable + , messages.W1014 # unsupported '=' operator + ) + # + # Use GCCXML to create the controlling XML file. + # If the cache file (../cache/*.xml) doesn't exist it gets created, otherwise it just gets loaded + # NOTE: If you update the source library code you need to manually delete the cache .XML file + # + xml_cached_fc = parser.create_cached_source_fc( + os.path.join( environment.ogrepcz.root_dir, "python_ogrepcz.h" ) + , environment.ogrepcz.cache_file ) + + defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY'] + defined_symbols.append( 'VERSION_' + environment.ogrepcz.version ) + + # + # build the core Py++ system from the GCCXML created source + # + mb = module_builder.module_builder_t( [ xml_cached_fc ] + , gccxml_path=environment.gccxml_bin + , working_directory=environment.root_dir + , include_paths=environment.ogrepcz.include_dirs + , define_symbols=defined_symbols + , indexing_suite_version=2 + , cflags=environment.ogrepcz.cflags + ) + + # if this module depends on another set it here + mb.register_module_dependency ( environment.ogre.generated_dir ) + + # normally implicit conversions work OK, however they can cause strange things to happen so safer to leave off + mb.constructors().allow_implicit_conversion = False + + mb.BOOST_PYTHON_MAX_ARITY = 25 + mb.classes().always_expose_using_scope = True + + # + # We filter (both include and exclude) specific classes and functions that we want to wrap + # + global_ns = mb.global_ns + global_ns.exclude() + + # We don't include all of MAIN_NAMESPACE otherwise we get the same full wrapper + # so instead we include classes with names that start with PCZ + main_ns = global_ns.namespace( MAIN_NAMESPACE ) +# main_ns.include() + for c in main_ns.classes(): + if c.name.startswith ('PCZ'): + print "Including ", c + c.include() + + common_utils.AutoExclude ( mb, MAIN_NAMESPACE ) + ManualExclude ( mb ) + common_utils.AutoInclude ( mb, MAIN_NAMESPACE ) + ManualInclude ( mb ) + # here we fixup functions that expect to modifiy their 'passed' variables + ManualTransformations ( mb ) + AutoFixes ( mb, MAIN_NAMESPACE ) + ManualFixes ( mb ) + # + # We need to tell boost how to handle calling (and returning from) certain functions + # + common_utils.Set_DefaultCall_Policies ( mb.global_ns.namespace ( MAIN_NAMESPACE ) ) + + # + # the manual stuff all done here !!! + # + hand_made_wrappers.apply( mb ) + + NoPropClasses = [""] + for cls in main_ns.classes(): + if cls.name not in NoPropClasses: + cls.add_properties( recognizer=ogre_properties.ogre_property_recognizer_t() ) + + common_utils.add_constants( mb, { 'ogrepcz_version' : '"%s"' % environment.ogrepcz.version.replace("\n", "\\\n") + , 'python_version' : '"%s"' % sys.version.replace("\n", "\\\n" ) } ) + + ## need to create a welcome doc string for this... + common_utils.add_constants( mb, { '__doc__' : '"ogrepcz DESCRIPTION"' } ) + + + ########################################################################################## + # + # Creating the code. After this step you should not modify/customize declarations. + # + ########################################################################################## + extractor = exdoc.doc_extractor() # I'm excluding the UTFstring docs as lots about nothing + mb.build_code_creator (module_name='_ogrepcz_' , doc_extractor= extractor ) + + for inc in environment.ogrepcz.include_dirs: + mb.code_creator.user_defined_directories.append(inc ) + mb.code_creator.user_defined_directories.append( environment.ogrepcz.generated_dir ) + mb.code_creator.replace_included_headers( customization_data.header_files( environment.ogrepcz.version ) ) + + huge_classes = map( mb.class_, customization_data.huge_classes( environment.ogrepcz.version ) ) + + mb.split_module(environment.ogrepcz.generated_dir, huge_classes, use_files_sum_repository=False) + + ## now we need to ensure a series of headers and additional source files are + ## copied to the generated directory.. + +# common_utils.copyTree ( sourcePath = environment.Config.PATH_INCLUDE_ogrepcz, +# destPath = environment.ogrepcz.generated_dir, +# recursive=False ) + +if __name__ == '__main__': + start_time = time.clock() + generate_code() + print 'Source code was updated( %f minutes ).' % ( ( time.clock() - start_time )/60 ) Added: trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py (rev 0) +++ trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py 2008-07-29 09:34:29 UTC (rev 676) @@ -0,0 +1,15 @@ +import os +import environment + + + +################################################################################################# +################################################################################################# + +def apply_reg ( class_, code ): + for c in code: + class_.add_registration_code ( c ) + +def apply( mb ): + pass + \ No newline at end of file Added: trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz.h =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz.h (rev 0) +++ trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz.h 2008-07-29 09:34:29 UTC (rev 676) @@ -0,0 +1,27 @@ +#include "Ogre.h" +#include "OgrePortal.h" +#include "OgrePCZSceneNode.h" +#include "OgrePCZone.h" +#include "OgrePCZSceneManager.h" +#include "OgrePCZSceneQuery.h" +#include "OgrePCZLight.h" +#include "OgrePCPlane.h" +#include "OgrePCZFrustum.h" + + +// First we create a magic namespace to hold all our aliases +namespace pyplusplus { namespace aliases { + + #include "python_ogrepcz_aliases.h" +} } + +// then we exposed everything needed (and more) to ensure GCCXML makes them visible to Py++ +// +namespace python_ogrepcz{ namespace details{ +inline void instantiate(){ + using namespace Ogre; + #include "python_ogrepcz_sizeof.h" + +} } } + + Added: trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_aliases.h =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_aliases.h (rev 0) +++ trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_aliases.h 2008-07-29 09:34:29 UTC (rev 676) @@ -0,0 +1 @@ +// typedef name nicename; Added: trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h (rev 0) +++ trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h 2008-07-29 09:34:29 UTC (rev 676) @@ -0,0 +1 @@ +// sizeof ( variable ); Modified: trunk/python-ogre/demos/theora/demo_video.py =================================================================== --- trunk/python-ogre/demos/theora/demo_video.py 2008-07-28 06:56:57 UTC (rev 675) +++ trunk/python-ogre/demos/theora/demo_video.py 2008-07-29 09:34:29 UTC (rev 676) @@ -42,12 +42,12 @@ if not self.Control: print "\n\nClip not found\n" sys.exit() - self.Control.setInputName( '../media_extra/fish.ogg' ) + self.Control.setInputName( '../media_extra/konqi_ad1_nl.avi.ogg') ##fish.ogg' ) self.Control.setPlayMode(theora.TextureEffectPause ) self.Control.setTextureTecPassStateLevel( 0, 0, 0 ) self.Control.setSeekEnabled( False ) -# self.Control.setAutoAudioUpdate ( True ) + self.Control.setAutoAudioUpdate ( True ) mat = ogre.MaterialManager.getSingleton().getByName("Example/TheoraVideoPlayer/Play") #Create the material the first time through this method @@ -97,7 +97,6 @@ ret = sf.FrameListener.frameStarted(self, frameEvent) if self.video and ret: self.video.blitFrameCheck() - self.video.getAudioDriver().autoUpdate() return ret Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-07-28 06:56:57 UTC (rev 675) +++ trunk/python-ogre/environment.py 2008-07-29 09:34:29 UTC (rev 676) @@ -1569,6 +1569,24 @@ libs=[ boost.lib, 'OgreMain' ] ModuleName="cadunetree" +class ogrepcz: + active = False + pythonModule = True + version="1.0" + name='ogrepcz' + parent="ogre/renderer" + cflags = "" + include_dirs = [ Config.PATH_Boost, + Config.PATH_INCLUDE_Ogre, + Config.PATH_INCLUDE_ogrepcz + ] + lib_dirs = [Config.PATH_LIB_Boost, + Config.PATH_LIB_Ogre_OgreMain + ] + CheckIncludes=[] + libs=[ boost.lib, 'Plugin_PCZSceneManager', 'OgreMain' ] + ModuleName="ogrepcz" + class opensteer: active = False pythonModule = True @@ -1647,6 +1665,7 @@ , 'particleuniverse' : particleuniverse , 'cadunetree' : cadunetree ,'opensteer' : opensteer + ,'ogrepcz' : ogrepcz } # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-07-29 10:24:57
|
Revision: 677 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=677&view=rev Author: andy_miller Date: 2008-07-29 10:25:07 +0000 (Tue, 29 Jul 2008) Log Message: ----------- Add the ogrepcz module to setup.py and the packages directory Modified Paths: -------------- trunk/python-ogre/setup.py Added Paths: ----------- trunk/python-ogre/packages_2.5/ogre/renderer/ogrepcz/ trunk/python-ogre/packages_2.5/ogre/renderer/ogrepcz/__init__.py Added: trunk/python-ogre/packages_2.5/ogre/renderer/ogrepcz/__init__.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/renderer/ogrepcz/__init__.py (rev 0) +++ trunk/python-ogre/packages_2.5/ogre/renderer/ogrepcz/__init__.py 2008-07-29 10:25:07 UTC (rev 677) @@ -0,0 +1,13 @@ +import sys, os +import warnings +warnings.simplefilter('ignore', RuntimeWarning) + +# Note that we put the Python-Ogre path first to ensure we don't get strange problems with windows +# picking up the wrong dlls -- Thanks to Pelle for tracking down this issue.. +if sys.platform == 'win32': + os.environ['PATH'] = __path__[0] +';' + os.environ['PATH'] + +from _ogrepcz_ import * + +warnings.resetwarnings( ) + Modified: trunk/python-ogre/setup.py =================================================================== --- trunk/python-ogre/setup.py 2008-07-29 09:34:29 UTC (rev 676) +++ trunk/python-ogre/setup.py 2008-07-29 10:25:07 UTC (rev 677) @@ -71,7 +71,8 @@ 'ogre.addons.plib','ogre.gui.navi', 'ogre.addons.ogreforests', 'ogre.addons.et', 'ogre.addons.caelum', 'ogre.addons.noise', 'ogre.addons.watermesh', 'ogre.addons.ofusion', - 'ogre.addons.particleuniverse', 'ogre.addons.cadunetree' ], + 'ogre.addons.particleuniverse', 'ogre.addons.cadunetree', + 'ogre.renderer.ogrepcz' ], "package_dir": {'': 'packages_'+ PythonVersionString }, "package_data": {'': ['*.pyd', '*.dll', '*.so']} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-07-29 12:56:11
|
Revision: 678 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=678&view=rev Author: andy_miller Date: 2008-07-29 12:56:20 +0000 (Tue, 29 Jul 2008) Log Message: ----------- further Portal work (not finished with the demo) Modified Paths: -------------- trunk/python-ogre/code_generators/ogrepcz/generate_code.py trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py Added Paths: ----------- trunk/python-ogre/demos/ogrepcz/ trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py trunk/python-ogre/demos/ogrepcz/RoomObject.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/demos/resources.cfg Removed Paths: ------------- trunk/python-ogre/demos/ogre/resources.cfg trunk/python-ogre/packages_2.6/ Modified: trunk/python-ogre/code_generators/ogrepcz/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-07-29 10:25:07 UTC (rev 677) +++ trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-07-29 12:56:20 UTC (rev 678) @@ -86,7 +86,14 @@ if MAIN_NAMESPACE: main_ns = global_ns.namespace( MAIN_NAMESPACE ) else: - main_ns = global_ns + main_ns = global_ns + + includes = ['::Ogre::Portal::PORTAL_TYPE', + '::Ogre::Portal::PortalIntersectResult', +# '::Ogre::PCZone::NODE_LIST_TYPE' + ] + for i in includes: + main_ns.enum(i).include() ############################################################ ## @@ -277,9 +284,17 @@ main_ns = global_ns.namespace( MAIN_NAMESPACE ) # main_ns.include() for c in main_ns.classes(): - if c.name.startswith ('PCZ'): + if c.name.startswith ('PCZ') or c.name.startswith ('PCPlane') or c.name.startswith ('Portal'): + c.include() print "Including ", c - c.include() + + for c in ['Portal','PCPlane']: + main_ns.class_(c).include() + print "Including ", c +# for e in c.enums(allow_empty=True): +# e.include() +# for v in c.variables(allow_empty=True): +# v.include() common_utils.AutoExclude ( mb, MAIN_NAMESPACE ) ManualExclude ( mb ) Modified: trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py 2008-07-29 10:25:07 UTC (rev 677) +++ trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py 2008-07-29 12:56:20 UTC (rev 678) @@ -1,7 +1,47 @@ import os import environment +WRAPPER_DEFINITION_General = \ +""" +// The following helper functions are a start and possibly need to be extended to include +// additional scene queries.. +Ogre::PCZSceneNode * General_castAsPCZSceneNode( Ogre::SceneNode * in ){ + return (Ogre::PCZSceneNode*) in; + } +Ogre::PCZSceneManager * General_castAsPCZSceneManager( Ogre::SceneManager * in ){ + return (Ogre::PCZSceneManager*) in; + } +Ogre::PCZRaySceneQuery * General_castAsPCZRaySceneQuery( Ogre::RaySceneQuery * in ){ + return (Ogre::PCZRaySceneQuery*) in; + } + +/// TO HANDLE ?? +/* PCZAxisAlignedBoxSceneQuery : public DefaultAxisAlignedBoxSceneQuery +PCZRaySceneQuery : public DefaultRaySceneQuery +PCZSphereSceneQuery : public DefaultSphereSceneQuery +PCZPlaneBoundedVolumeListSceneQuery : public DefaultPlaneBoundedVolumeListSceneQuery +*/ + + +""" +WRAPPER_REGISTRATION_General = [ + """bp::def( "castAsPCZSceneNode", &General_castAsPCZSceneNode, + "Python-Ogre Helper Function: Casts a SceneNode as a PCZSceneNode.\\n\\ + Input: SceneNode\\n\\ + Ouput: PCZSceneNode",\ + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", + """bp::def( "castAsPCZSceneManager", &General_castAsPCZSceneManager, + "Python-Ogre Helper Function: Casts a SceneManager as a PCZSceneManager.\\n\\ + Input: SceneManager\\n\\ + Ouput: PCZSceneManager",\ + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", + """bp::def( "castAsPCZRaySceneQuery", &General_castAsPCZRaySceneQuery, + "Python-Ogre Helper Function: Casts a RaySceneQuery as a PCZRaySceneQuery.\\n\\ + Input: RaySceneQuery\\n\\ + Ouput: PCZRaySceneQuery",\ + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", +] ################################################################################################# ################################################################################################# @@ -11,5 +51,6 @@ class_.add_registration_code ( c ) def apply( mb ): - pass + mb.add_declaration_code( WRAPPER_DEFINITION_General ) + apply_reg (mb, WRAPPER_REGISTRATION_General ) \ No newline at end of file Deleted: trunk/python-ogre/demos/ogre/resources.cfg =================================================================== --- trunk/python-ogre/demos/ogre/resources.cfg 2008-07-29 10:25:07 UTC (rev 677) +++ trunk/python-ogre/demos/ogre/resources.cfg 2008-07-29 12:56:20 UTC (rev 678) @@ -1,24 +0,0 @@ -[Bootstrap] -Zip=../media/packs/OgreCore.zip - -# Resource locations to be added to the default path -[General] -FileSystem=../media -FileSystem=../media/fonts -FileSystem=../media/sounds -FileSystem=../media/Audio -FileSystem=../media/materials/programs -FileSystem=../media/materials/scripts -FileSystem=../media/materials/textures -FileSystem=../media/models -FileSystem=../media/overlays -FileSystem=../media/particle -FileSystem=../media/gui -Zip=../media/packs/cubemap.zip -Zip=../media/packs/cubemapsJS.zip -Zip=../media/packs/dragon.zip -Zip=../media/packs/fresneldemo.zip -Zip=../media/packs/ogretestmap.zip -Zip=../media/packs/skybox.zip -#Zip=../media/packs/chiropteraDM.pk3 - Added: trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py =================================================================== --- trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py (rev 0) +++ trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py 2008-07-29 12:56:20 UTC (rev 678) @@ -0,0 +1,327 @@ +# This code is in the Public Domain +# ----------------------------------------------------------------------------- +# This source file is part of Python-Ogre +# For the latest info, see http://python-ogre.org/ +# +# It is likely based on original code from OGRE and/or PyOgre +# For the latest info, see http://www.ogre3d.org/ +# +# Specialisation of OGRE's framework application to test/demo the +# Portal Connected Zone (PCZ) Scene Manager Plugin. +# +# You may use this sample code for anything you like, it is not covered by the +# LGPL. +# ----------------------------------------------------------------------------- +import sys +import os +sys.path.insert(0,'..') +import PythonOgreConfig + +## this here becase the Plug_PCZSceneManager.dll needs to be accessed by both the python module and the ogre plugins +if sys.platform == 'win32': + newpath = os.path.join ( os.path.abspath(os.path.dirname(__file__)), '../../plugins') + os.environ['PATH'] = newpath +';' + os.environ['PATH'] + +import ogre.renderer.OGRE as ogre +import SampleFramework as sf +import ogre.io.OIS as ois +import ogre.renderer.ogrepcz as pcz + +# import RoomObject + +Global_buildingNode = None #pcz.PCZSceneNode() +Global_buildingTranslate = None # ogre.Vector3() +Global_raySceneQuery = None # ogre.RaySceneQuery() +Global_targetMO = None #ogre.MovableObject() + + +# # class PCZTestFrameListener ( sf.ExampleFrameListener) +# # +# # public: +# # PCZTestFrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener( win, cam ) +# # +# # self.MoveSpeed = 15.0 +# # self.updateRay=ogre.Ray() +# # +# # +# # void moveCamera() +# # +# # # Make all the spatial changes to the camera's scene node +# # # Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW +# # #(e.g. airplane) +# # self.camera.getParentSceneNode().translate(self.translateVector, Node.TS_LOCAL) +# # self.camera.getParentSceneNode().pitch(mRotY) +# # self.camera.getParentSceneNode().yaw(mRotX, Node.TS_WORLD) +# # Global_buildingNode.translate(Global_buildingTranslate, Node.TS_LOCAL) +# # +# # +# # bool frameRenderingQueued( const FrameEvent& evt ) +# # +# # if( ExampleFrameListener.frameRenderingQueued( evt ) == False ) +# # return False +# # +# # Global_buildingTranslate = ogre.Vector3(0,0,0) +# # if( self.keyboard.isKeyDown( ois.KC_LBRACKET ) ) +# # +# # Global_buildingTranslate = ogre.Vector3(0,-10,0) +# # +# # if( self.keyboard.isKeyDown( ois.KC_RBRACKET ) ) +# # +# # Global_buildingTranslate = ogre.Vector3(0,10,0) +# # +# # +# # if( self.keyboard.isKeyDown( ois.KC_LSHIFT ) || +# # self.keyboard.isKeyDown( ois.KC_RSHIFT )) +# # +# # self.MoveSpeed = 150 +# # +# # else +# # +# # self.MoveSpeed = 15 +# # +# # +# # # test the ray scene query by showing bounding box of whatever the camera is pointing directly at +# # # (takes furthest hit) +# # self.updateRay.setOrigin(self.camera.getParentSceneNode().getPosition()) +# # self.updateRay.setDirection(self.camera.getParentSceneNode().getOrientation()*ogre.Vector3.NEGATIVE_UNIT_Z) +# # Global_raySceneQuery.setRay(updateRay) +# # zone = ((PCZSceneNode*)(self.camera.getParentSceneNode())).getHomeZone() +# # ((PCZRaySceneQuery*)Global_raySceneQuery).setStartZone(zone) +# # ((PCZRaySceneQuery*)Global_raySceneQuery).setExcludeNode(self.camera.getParentSceneNode()) +# # RaySceneQueryResult& qryResult = Global_raySceneQuery.execute() +# # RaySceneQueryResult.iterator i = qryResult.begin() +# # if (i != qryResult.end()) +# # +# # RaySceneQueryResult.reverse_iterator ri = qryResult.rbegin() +# # MovableObject * mo = ri.movable +# # if (Global_targetMO != mo) +# # +# # if (Global_targetMO != 0) +# # +# # Global_targetMO.getParentSceneNode().showBoundingBox(False) +# # +# # Global_targetMO = mo +# # Global_targetMO.getParentSceneNode().showBoundingBox(True) +# # +# # +# # +# # return True + + + +class PCZTestApplication (sf.Application): + def __del__(self): + del Global_raySceneQuery + + + def _chooseSceneManager ( self ): + + # Create the SceneManager, in this case a generic one + self.sceneManager = self.root.createSceneManager("PCZSceneManager", "PCZSceneManager") + # initialize the scene manager using terrain as default zone + zoneTypeName = "ZoneType_Default" + self.pczSM = pcz.castAsPCZSceneManager( self.sceneManager ) # store this for future reference + self.pczSM.init(zoneTypeName) + #self.sceneManager.showBoundingBoxes(True) + +# def _createFrameListener( self ): +# self.frameListener= PCZTestFrameListener(self.renderWindow, self.camera) +# self.root.addFrameListener(self.frameListener) + + def _createCamera(self): + # Create the camera + self.camera = self.sceneManager.createCamera("PlayerCam") + + # NEW: create a node for the camera and control that instead of camera directly. + # We do this because PCZSceneManager requires camera to have a node + self.cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode("PlayerCamNode") + # attach the camera to the node + self.cameraNode.attachObject(self.camera) + # fix the yaw axis of the camera + self.cameraNode.setFixedYawAxis(True) + + self.camera.setNearClipDistance(2) + self.camera.setFarClipDistance( 1000 ) + # set camera zone +# ((PCZSceneNode*)(self.cameraNode)).setHomeZone(((PCZSceneManager*)(self.sceneManager)).getDefaultZone()) + + + # utility function to create terrain zones easily + def createTerrainZone(self, zoneName, terrain_cfg): + # load terrain into the terrain zone + terrainZone = self.pczSM.createZone("ZoneType_Terrain", zoneName) + terrainZone.notifyCameraCreated(self.camera) + self.pczSM.setZoneGeometry( zoneName, pcz.castAsPCZSceneNode(self.sceneManager.getRootSceneNode()), terrain_cfg ) + + # create aab portal(s) around the terrain + corners =[] + aabb = ogre.AxisAlignedBox() + + # make portal from terrain to default + terrainZone.getAABB(aabb) + portalName = "PortalFrom"+zoneName+"ToDefault_Zone" + p = self.pczSM.createPortal(portalName, pcz.Portal.PORTAL_TYPE_AABB) + corners[0] = aabb.getMinimum() + corners[1] = aabb.getMaximum() + p.setCorner(0, corners[0]) + p.setCorner(1, corners[1]) + p.setDirection(ogre.Vector3.NEGATIVE_UNIT_Z) # this indicates an "inward" pointing normal + # associate the portal with the terrain's main node + p.setNode(terrainZone.getEnclosureNode()) + # IMPORTANT: Update the derived values of the portal + p.updateDerivedValues() + # add the portal to the zone + terrainZone._addPortal(p) + + # make portal from default to terrain + portalName = "PortalFromDefault_ZoneTo"+zoneName + p2 = self.pczSM.createPortal(portalName, pcz.Portal.PORTAL_TYPE_AABB) + corners[0] = aabb.getMinimum() + corners[1] = aabb.getMaximum() + p2.setCorner(0, corners[0]) + p2.setCorner(1, corners[1]) + p2.setDirection(ogre.Vector3.UNIT_Z) # this indicates an "outward" pointing normal + # associate the portal with the terrain's main node + p2.setNode(terrainZone.getEnclosureNode()) + # IMPORTANT: Update the derived values of the portal + p2.updateDerivedValues() + # add the portal to the zone + self.pczSM.getDefaultZone()._addPortal(p2) + + # connect the portals manually + p.setTargetPortal(p2) + p2.setTargetPortal(p) + p.setTargetZone(self.pczSM.getDefaultZone()) + p2.setTargetZone(terrainZone) + + return terrainZone + + + # Just override the mandatory create scene method + def _createScene( self ): + + # Set ambient light + self.sceneManager.setAmbientLight(ogre.ColourValue(0.25, 0.25, 0.25)) + + # Create a skybox + self.sceneManager.setSkyBox(True, "Examples/CloudyNoonSkyBox", 500 ) + # put the skybox node in the default zone +# self.pczSM.setSkyZone(None) + + # Create a light + l = self.sceneManager.createLight("MainLight") + l.setPosition(0,0,0) + l.setAttenuation(500, 0.5, 1.0, 0.0) + # Accept default settings: point light, white diffuse, just set position + # attach light to a scene node so the PCZSM can handle it properly (zone-wise) + # IMPORTANT: Lights (just like cameras) MUST be connected to a scene node! + lightNode = self.cameraNode.createChildSceneNode("light_Node") + lightNode.attachObject(l) + + # Fog + # NB it's VERY important to set this before calling setWorldGeometry + # because the vertex program picked will be different + fadeColour= ogre.ColourValue(0.101, 0.125, 0.1836) + self.sceneManager.setFog( ogre.FOG_LINEAR, fadeColour, .001, 500, 1000) + self.renderWindow.getViewport(0).setBackgroundColour(fadeColour) + + # create a terrain zone + terrain_cfg = "terrain.cfg" + zoneName ="Terrain1_Zone" + terrainZone = self.createTerrainZone(zoneName, terrain_cfg) + +# # /* # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain2_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move second terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(1500, 0, 0) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain3_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(0, 0, 1500) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain4_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(-1500, 0, 0) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain5_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(0, 0, -1500) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain6_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(1500, 0, 1500) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain7_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(-1500, 0, -1500) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain8_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(-1500, 0, 1500) +# # +# # # Create another terrain zone +# # terrain_cfg = "terrain.cfg" +# # zoneName = "Terrain9_Zone" +# # terrainZone = createTerrainZone(zoneName, terrain_cfg) +# # # move terrain next to first terrain +# # terrainZone.getEnclosureNode().setPosition(1500, 0, -1500) +# # */ + # set far clip plane to one terrain zone width (we have a LOT of terrain here, so we need to do far clipping!) + self.camera.setFarClipDistance(1500) + +# # create test buildinig +# RoomObject roomObj +# Global_buildingNode = roomObj.createTestBuilding(self.sceneManager, String("1")) +# Global_buildingNode.setPosition(500, 165, 570) +# #ogre.Radian r = Radian(3.1416/7.0) +# #Global_buildingNode.rotate(ogre.Vector3.UNIT_Y, r) +# +# # create another test buildinig +# RoomObject roomObj2 +# Global_buildingNode = roomObj2.createTestBuilding(self.sceneManager, String("2")) +# Global_buildingNode.setPosition(400, 165, 570) +# #ogre.Radian r = Radian(3.1416/7.0) +# #Global_buildingNode.rotate(ogre.Vector3.UNIT_Y, r) +# +# # Position camera in the center of the building +# self.cameraNode.setPosition(Global_buildingNode.getPosition()) +# # Look back along -Z +# self.camera.lookAt(self.cameraNode._getDerivedPosition() + ogre.Vector3(0,0,-300)) +# # Update bounds for camera +# self.cameraNode._updateBounds() +# +# # create the ray scene query +# Global_raySceneQuery = self.sceneManager.createRayQuery( +# Ray(self.camera.getParentNode().getPosition(), ogre.Vector3.NEGATIVE_UNIT_Z)) +# Global_raySceneQuery.setSortByDistance(True, 5) + + + +if __name__ == '__main__': + import exceptions,sys + try: + application = PCZTestApplication() + application.go() + except ogre.OgreException, e: + print e + Added: trunk/python-ogre/demos/ogrepcz/RoomObject.py =================================================================== --- trunk/python-ogre/demos/ogrepcz/RoomObject.py (rev 0) +++ trunk/python-ogre/demos/ogrepcz/RoomObject.py 2008-07-29 12:56:20 UTC (rev 678) @@ -0,0 +1,1009 @@ +## +## +## +## Filename : RoomObject.cpp + +# # +# # +# # class RoomObject +# # +# # private: +# # Ogre::Vector3 points[32]; +# # int mPortalCount; +# # public: + +DOOR_NONE = 0x00 +DOOR_TOP = 0x01 +DOOR_BOT = 0x02 +DOOR_FRONT = 0x04 +DOOR_BACK = 0x08 +DOOR_LEFT = 0x10 +DOOR_RIGHT = 0x20 +DOOR_ALL = 0xFF + +# # +# # +#include "Ogre.h" +#include "OgreMaterial.h" +#include "RoomObject.h" +#include "OgrePortal.h" + +using namespace Ogre +static int count = 0 + +PCZSceneNode * RoomObject.createTestBuilding(Ogre::SceneManager *scene, String & name) + + count++ + mPortalCount = 0 + Ogre.PCZSceneManager * pczSM = (Ogre::PCZSceneManager*)scene + + ## set points to building exterior size + createPoints(Vector3(60.0, 40.0, 60.0), Vector3(4.0, 10.0, 4.0)) + + ## create the building exterior + Entity *exterior = pczSM->createEntity( name + "_building_exterior", "building_exterior.mesh" ) + + ## make the enclosure a child node of the root scene node + PCZSceneNode * exteriorNode + exteriorNode = (PCZSceneNode*)scene->getRootSceneNode()->createChildSceneNode(name +"_building_exterior_node", Vector3( 0.0, 0.0f, 0.0f ) ) + exteriorNode->attachObject(exterior) + pczSM->addPCZSceneNode(exteriorNode, pczSM->getDefaultZone()) + + ## create portals for the building exterior + createPortals(scene, + exterior, + exteriorNode, + pczSM->getDefaultZone(), + DOOR_FRONT|DOOR_BACK|DOOR_LEFT|DOOR_RIGHT, + True) + + ## reset points to room size + createPoints(Vector3(20.0, 10.0, 20.0), Vector3(4.0, 10.0, 4.0)) + + ## create an interior room + Entity *room = pczSM->createEntity( name +"_room1", "room_nzpz.mesh" ) + + ## add the room as a child node to the enclosure node + PCZSceneNode * roomNode + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room1_node", Vector3( 0.0, 0.0f, 20.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + Ogre.String zoneType = "ZoneType_Default" + Ogre.String zoneName = name +"_room1_zone" + PCZone * newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_FRONT|DOOR_BACK, + False) + + ## create another interior room + room = pczSM->createEntity( name +"_room2", "room_nxpxnypynzpz.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room2_node", Vector3( 0.0, 0.0f, 0.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room2_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_FRONT|DOOR_BACK|DOOR_LEFT|DOOR_RIGHT|DOOR_TOP|DOOR_BOT, + False) + + ## create another interior room + room = pczSM->createEntity( name +"_room3", "room_nzpz.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room3_node", Vector3( 0.0, 0.0f, -20.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room3_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_FRONT|DOOR_BACK, + False) + + ## create another interior room + room = pczSM->createEntity( name +"_room4", "room_nxpx.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room4_node", Vector3( -20.0, 0.0f, 0.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room4_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_LEFT|DOOR_RIGHT, + False) + + ## create another interior room + room = pczSM->createEntity( name +"_room5", "room_nxpx.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room5_node", Vector3( 20.0, 0.0f, 0.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room5_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_LEFT|DOOR_RIGHT, + False) + + ## create another interior room + room = pczSM->createEntity( name +"_room6", "room_ny.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room6_node", Vector3( 0.0, 10.0f, 0.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room6_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_BOT, + False) + + ## create another interior room + room = pczSM->createEntity( name +"_room7", "room_py.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room7_node", Vector3( 0.0, -50.0f, 0.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room7_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_TOP, + False) + + ## reset points to tall room size + createPoints(Vector3(20.0, 40.0, 20.0), Vector3(4.0, 10.0, 4.0)) + + ## create another interior room + room = pczSM->createEntity( name +"_room8", "room_nypy_4y.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room8_node", Vector3( 0.0, -25.0f, 0.0f ) ) + roomNode->attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room8_zone" + newZone = pczSM->createZone(zoneType, zoneName) + newZone->setEnclosureNode(roomNode) + pczSM->addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + createPortals(scene, + room, + roomNode, + newZone, + DOOR_BOT|DOOR_TOP, + False) + + + ## resolve portal zone pointers + pczSM->connectPortalsToTargetZonesByLocation() + + return exteriorNode + + + +Ogre.ManualObject* RoomObject::createRoom(Ogre::SceneManager *scene, + Ogre.String &name, + short doorFlags, + bool isEnclosure, + Ogre.Vector3 dimensions, + Ogre.Vector3 doorDimensions) + + addMaterial(name, Ogre.ColourValue(1,1,1,.75), Ogre::SBT_TRANSPARENT_ALPHA) + + Ogre.ManualObject* room = scene->createManualObject(name) + + room->begin(name, Ogre.RenderOperation::OT_TRIANGLE_LIST) + + ## create points + createPoints(dimensions, doorDimensions) + + Ogre.Real fade=.5 + Ogre.Real solid=.8 + Ogre.ColourValue color = ColourValue(0, 0, solid, solid) + + ## copy to room + for (int i=0 i<32;i++) + + room->position(points[i]) + room->colour(color) + + + createWalls(room, doorFlags, isEnclosure) + + room->end() + + return room + + +void RoomObject.addMaterial( Ogre::String &mat, + Ogre.ColourValue &clr, + Ogre.SceneBlendType sbt) + + static int init=False + if(init): + return + else: + init=True + + Ogre.MaterialPtr matptr = Ogre::MaterialManager::getSingleton().create(mat, "General") + matptr->setReceiveShadows(False) + matptr->getTechnique(0)->setLightingEnabled(True) + matptr->getTechnique(0)->getPass(0)->setDiffuse(clr) + matptr->getTechnique(0)->getPass(0)->setAmbient(clr) + matptr->getTechnique(0)->getPass(0)->setSelfIllumination(clr) + matptr->getTechnique(0)->getPass(0)->setSceneBlending(sbt) + matptr->getTechnique(0)->getPass(0)->setLightingEnabled(False) + matptr->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre.TVC_DIFFUSE) + + +void RoomObject.createPoints(Ogre::Vector3 dimensions, + Ogre.Vector3 doorDimensions) + + Ogre.Real l = dimensions.x/2 + Ogre.Real h = dimensions.y/2 + Ogre.Real w = dimensions.z/2 + +## 4 7 +## *-------* +## /| /| +## / | / | y +## / 5| 3/ 6| | +## 0*---*---*---* *-- x +## | / | / / +## | / | / z +## |/ |/ +## 1*-------*2 + + points[0] = Ogre.Vector3(-l, h, w) ##0 + points[1] = Ogre.Vector3(-l, -h, w) ##1 + points[2] = Ogre.Vector3(l, -h, w) ##2 + points[3] = Ogre.Vector3(l, h, w) ##3 + + points[4] = Ogre.Vector3(-l, h, -w) ##4 + points[5] = Ogre.Vector3(-l, -h, -w) ##5 + points[6] = Ogre.Vector3(l, -h, -w) ##6 + points[7] = Ogre.Vector3(l, h, -w) ##7 + + ## doors + Ogre.Real l2 = doorDimensions.x/2 + Ogre.Real h2 = doorDimensions.y/2 + Ogre.Real w2 = doorDimensions.z/2 + + ## front door + points[8] = Ogre.Vector3(-l2, h2, w) ##8 + points[9] = Ogre.Vector3(-l2, -h2, w) ##9 + points[10] = Ogre.Vector3(l2, -h2, w) ##10 + points[11] = Ogre.Vector3(l2, h2, w) ##11 + + ## back door + points[12] = Ogre.Vector3(-l2, h2, -w) ##12 + points[13] = Ogre.Vector3(-l2, -h2, -w) ##13 + points[14] = Ogre.Vector3(l2, -h2, -w) ##14 + points[15] = Ogre.Vector3(l2, h2, -w) ##15 + + ## top door + points[16] = Ogre.Vector3(-l2, h, -w2) ##16 + points[17] = Ogre.Vector3(-l2, h, w2) ##17 + points[18] = Ogre.Vector3(l2, h, w2) ##18 + points[19] = Ogre.Vector3(l2, h, -w2) ##19 + + ## bottom door + points[20] = Ogre.Vector3(-l2, -h, -w2) ##20 + points[21] = Ogre.Vector3(-l2, -h, w2) ##21 + points[22] = Ogre.Vector3(l2, -h, w2) ##22 + points[23] = Ogre.Vector3(l2, -h, -w2) ##23 + + ## left door + points[24] = Ogre.Vector3(-l, h2, w2) ##24 + points[25] = Ogre.Vector3(-l, -h2, w2) ##25 + points[26] = Ogre.Vector3(-l, -h2, -w2) ##26 + points[27] = Ogre.Vector3(-l, h2, -w2) ##27 + + ## right door + points[28] = Ogre.Vector3(l, h2, w2) ##28 + points[29] = Ogre.Vector3(l, -h2, w2) ##29 + points[30] = Ogre.Vector3(l, -h2, -w2) ##30 + points[31] = Ogre.Vector3(l, h2, -w2) ##31 + + +void RoomObject.createWalls(Ogre::ManualObject* room, + short doorFlags, + bool isEnclosure) + + + if (isEnclosure): + + if(doorFlags & DOOR_FRONT): + + ## make front wall outward facing with door + room->quad(0, 8, 11, 3) + room->quad(1, 9, 8, 0) + room->quad(2, 10, 9, 1) + room->quad(3, 11, 10, 2) + + else: + + ## make front wall outward facing without door + room->quad(0, 1, 2, 3) + + if(doorFlags & DOOR_BACK): + + ## make back wall outward facing with door + room->quad(7, 15, 12, 4) + room->quad(6, 14, 15, 7) + room->quad(5, 13, 14, 6) + room->quad(4, 12, 13, 5) + + else: + + ## make back wall outward facing without door + room->quad(7, 6, 5, 4) + + if(doorFlags & DOOR_TOP): + + ## make top wall outward facing with door + room->quad(0, 17, 16, 4) + room->quad(4, 16, 19, 7) + room->quad(7, 19, 18, 3) + room->quad(3, 18, 17, 0) + + else: + + ## make top wall outward facing without door + room->quad(0, 3, 7, 4) + + if(doorFlags & DOOR_BOT): + + ## make bottom wall outward facing with door + room->quad(5, 20, 21, 1) + room->quad(6, 23, 20, 5) + room->quad(2, 22, 23, 6) + room->quad(1, 21, 22, 2) + + else: + + ## make bottom wall outward facing without door + room->quad(2, 1, 5, 6) + + if(doorFlags & DOOR_LEFT): + + ## make left wall outward facing with door + room->quad(0, 24, 25, 1) + room->quad(4, 27, 24, 0) + room->quad(5, 26, 27, 4) + room->quad(1, 25, 26, 5) + + else: + + ## make left side wall outward facing without door + room->quad(1, 0, 4, 5) + + if(doorFlags & DOOR_RIGHT): + + ## make right wall outward facing with door + room->quad(2, 29, 28, 3) + room->quad(6, 30, 29, 2) + room->quad(7, 31, 30, 6) + room->quad(3, 28, 31, 7) + + else: + + ## make right side wall outward facing without door + room->quad(3, 2, 6, 7) + + + else: + + ## front back + if(doorFlags & DOOR_FRONT): + + ## make front wall inward facing with door + room->quad(3, 11, 8, 0) + room->quad(0, 8, 9, 1) + room->quad(1, 9, 10, 2) + room->quad(2, 10, 11, 3) + + else: + + ## make front wall inward facing without door + room->quad(3, 2, 1, 0) + + if(doorFlags & DOOR_BACK): + + ## make back wall inward facing with door + room->quad(4, 12, 15, 7) + room->quad(7, 15, 14, 6) + room->quad(6, 14, 13, 5) + room->quad(5, 13, 12, 4) + + else: + + ## make back wall inward facing without door + room->quad(4, 5, 6, 7) + + ## top bottom + if(doorFlags & DOOR_TOP): + + ## make top wall inward facing with door + room->quad(4, 16, 17, 0) + room->quad(7, 19, 16, 4) + room->quad(3, 18, 19, 7) + room->quad(0, 17, 18, 3) + + else: + + ## make top wall inward facing without door + room->quad(4, 7, 3, 0) + + if(doorFlags & DOOR_BOT): + + ## make bottom wall inward facing with door + room->quad(1, 21, 20, 5) + room->quad(5, 20, 23, 6) + room->quad(6, 23, 22, 2) + room->quad(2, 22, 21, 1) + + else: + + ## make bottom wall inward facing without door + room->quad(6, 5, 1, 2) + + ## end caps + if(doorFlags & DOOR_LEFT): + + ## make left wall inward facing with door + room->quad(1, 25, 24, 0) + room->quad(0, 24, 27, 4) + room->quad(4, 27, 26, 5) + room->quad(5, 26, 25, 1) + + else: + + ## make left side wall inward facing without door + room->quad(5, 4, 0, 1) + + if(doorFlags & DOOR_RIGHT): + + ## make right wall inward facing with door + room->quad(3, 28, 29, 2) + room->quad(2, 29, 30, 6) + room->quad(6, 30, 31, 7) + room->quad(7, 31, 28, 3) + + else: + + ## make right side wall inward facing without door + room->quad(7, 6, 2, 3) + + + + +## Create portals for every door +void RoomObject.createPortals(Ogre::SceneManager *scene, + Ogre.ManualObject* room, + Ogre.SceneNode * roomNode, + Ogre.PCZone * zone, + short doorFlags, + bool isEnclosure) + + Ogre.String portalName + Vector3 corners[4] + + if (isEnclosure): + + if(doorFlags & DOOR_FRONT): + + ## set the corners to the front door corners + corners[0] = points[8] + corners[1] = points[9] + corners[2] = points[10] + corners[3] = points[11] + ## create the portal + portalName = room->getName() + Ogre.String("_FrontDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BACK): + + ## set the corners to the front door corners + corners[0] = points[15] + corners[1] = points[14] + corners[2] = points[13] + corners[3] = points[12] + ## create the portal + portalName = room->getName() + Ogre.String("_BackDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_TOP): + + ## set the corners to the front door corners + corners[0] = points[16] + corners[1] = points[17] + corners[2] = points[18] + corners[3] = points[19] + ## create the portal + portalName = room->getName() + Ogre.String("_TopDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BOT): + + ## set the corners to the front door corners + corners[0] = points[23] + corners[1] = points[22] + corners[2] = points[21] + corners[3] = points[20] + ## create the portal + portalName = room->getName() + Ogre.String("_BottomDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_LEFT): + + ## set the corners to the front door corners + corners[0] = points[27] + corners[1] = points[26] + corners[2] = points[25] + corners[3] = points[24] + ## create the portal + portalName = room->getName() + Ogre.String("_LeftDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_RIGHT): + + ## set the corners to the front door corners + corners[0] = points[28] + corners[1] = points[29] + corners[2] = points[30] + corners[3] = points[31] + ## create the portal + portalName = room->getName() + Ogre.String("_RightDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + + else: + + if(doorFlags & DOOR_FRONT): + + ## set the corners to the front door corners + corners[0] = points[11] + corners[1] = points[10] + corners[2] = points[9] + corners[3] = points[8] + ## create the portal + portalName = room->getName() + Ogre.String("_FrontDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BACK): + + ## set the corners to the front door corners + corners[0] = points[12] + corners[1] = points[13] + corners[2] = points[14] + corners[3] = points[15] + ## create the portal + portalName = room->getName() + Ogre.String("_BackDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_TOP): + + ## set the corners to the front door corners + corners[0] = points[19] + corners[1] = points[18] + corners[2] = points[17] + corners[3] = points[16] + ## create the portal + portalName = room->getName() + Ogre.String("_TopDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BOT): + + ## set the corners to the front door corners + corners[0] = points[20] + corners[1] = points[21] + corners[2] = points[22] + corners[3] = points[23] + ## create the portal + portalName = room->getName() + Ogre.String("_BottomDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_LEFT): + + ## set the corners to the front door corners + corners[0] = points[24] + corners[1] = points[25] + corners[2] = points[26] + corners[3] = points[27] + ## create the portal + portalName = room->getName() + Ogre.String("_LeftDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_RIGHT): + + ## set the corners to the front door corners + corners[0] = points[31] + corners[1] = points[30] + corners[2] = points[29] + corners[3] = points[28] + ## create the portal + portalName = room->getName() + Ogre.String("_RightDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + + + +## Create portals for every door +void RoomObject.createPortals(Ogre::SceneManager *scene, + Ogre.Entity* room, + Ogre.SceneNode * roomNode, + Ogre.PCZone * zone, + short doorFlags, + bool isEnclosure) + + Ogre.String portalName + Vector3 corners[4] + + if (isEnclosure): + + if(doorFlags & DOOR_FRONT): + + ## set the corners to the front door corners + corners[0] = points[8] + corners[1] = points[9] + corners[2] = points[10] + corners[3] = points[11] + ## create the portal + portalName = room->getName() + Ogre.String("_FrontDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BACK): + + ## set the corners to the front door corners + corners[0] = points[15] + corners[1] = points[14] + corners[2] = points[13] + corners[3] = points[12] + ## create the portal + portalName = room->getName() + Ogre.String("_BackDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_TOP): + + ## set the corners to the front door corners + corners[0] = points[16] + corners[1] = points[17] + corners[2] = points[18] + corners[3] = points[19] + ## create the portal + portalName = room->getName() + Ogre.String("_TopDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BOT): + + ## set the corners to the front door corners + corners[0] = points[23] + corners[1] = points[22] + corners[2] = points[21] + corners[3] = points[20] + ## create the portal + portalName = room->getName() + Ogre.String("_BottomDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_LEFT): + + ## set the corners to the front door corners + corners[0] = points[27] + corners[1] = points[26] + corners[2] = points[25] + corners[3] = points[24] + ## create the portal + portalName = room->getName() + Ogre.String("_LeftDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_RIGHT): + + ## set the corners to the front door corners + corners[0] = points[28] + corners[1] = points[29] + corners[2] = points[30] + corners[3] = points[31] + ## create the portal + portalName = room->getName() + Ogre.String("_RightDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + + else: + + if(doorFlags & DOOR_FRONT): + + ## set the corners to the front door corners + corners[0] = points[11] + corners[1] = points[10] + corners[2] = points[9] + corners[3] = points[8] + ## create the portal + portalName = room->getName() + Ogre.String("_FrontDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BACK): + + ## set the corners to the front door corners + corners[0] = points[12] + corners[1] = points[13] + corners[2] = points[14] + corners[3] = points[15] + ## create the portal + portalName = room->getName() + Ogre.String("_BackDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_TOP): + + ## set the corners to the front door corners + corners[0] = points[19] + corners[1] = points[18] + corners[2] = points[17] + corners[3] = points[16] + ## create the portal + portalName = room->getName() + Ogre.String("_TopDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_BOT): + + ## set the corners to the front door corners + corners[0] = points[20] + corners[1] = points[21] + corners[2] = points[22] + corners[3] = points[23] + ## create the portal + portalName = room->getName() + Ogre.String("_BottomDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_LEFT): + + ## set the corners to the front door corners + corners[0] = points[24] + corners[1] = points[25] + corners[2] = points[26] + corners[3] = points[27] + ## create the portal + portalName = room->getName() + Ogre.String("_LeftDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + if(doorFlags & DOOR_RIGHT): + + ## set the corners to the front door corners + corners[0] = points[31] + corners[1] = points[30] + corners[2] = points[29] + corners[3] = points[28] + ## create the portal + portalName = room->getName() + Ogre.String("_RightDoorPortal") + Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) + p->setCorners(corners) + ## associate the portal with the roomnode + p->setNode(roomNode) + ## add the portal to the zone + zone->_addPortal(p) + ## update derived values for the portal + p->updateDerivedValues() + + + Added: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg (rev 0) +++ trunk/python-ogre/demos/plugins.cfg 2008-07-29 12:56:20 UTC (rev 678) @@ -0,0 +1,21 @@ +# Defines plugins to load + +## Use this for Windows +# Define plugin folder +PluginFolder=../../plugins +#home/andy/development/root/usr/lib/OGRE +Plugin=RenderSystem_GL.dll +Plugin=RenderSystem_Direct3D9.dll +Plugin=Plugin_ParticleFX.dll +Plugin=Plugin_BSPSceneManager.dll +Plugin=Plugin_OctreeSceneManager.dll +Plugin=Plugin_CgProgramManager.dll +Plugin=Plugin_PCZSceneManager.dll + +## +## NOTE use this for MacOS or Linux +# Plugin=RenderSystem_GL +# Plugin=Plugin_ParticleFX +# Plugin=Plugin_BSPSceneManager +# Plugin=Plugin_OctreeSceneManager +# Plugin=Plugin_CgProgramManager Added: trunk/python-ogre/demos/resources.cfg =================================================================== --- trunk/python-ogre/demos/resources.cfg (rev 0) +++ trunk/python-ogre/demos/resources.cfg 2008-07-29 12:56:20 UTC (rev 678) @@ -0,0 +1,24 @@ +[Bootstrap] +Zip=../media/packs/OgreCore.zip + +# Resource locations to be added to the default path +[General] +FileSystem=../media +FileSystem=../media/fonts +FileSystem=../media/sounds +FileSystem=../media/Audio +FileSystem=../media/materials/programs +FileSystem=../media/materials/scripts +FileSystem=../media/materials/textures +FileSystem=../media/models +FileSystem=../media/overlays +FileSystem=../media/particle +FileSystem=../media/gui +Zip=../media/packs/cubemap.zip +Zip=../media/packs/cubemapsJS.zip +Zip=../media/packs/dragon.zip +Zip=../media/packs/fresneldemo.zip +Zip=../media/packs/ogretestmap.zip +Zip=../media/packs/skybox.zip +#Zip=../media/packs/chiropteraDM.pk3 + Modified: trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-07-29 10:25:07 UTC (rev 677) +++ trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-07-29 12:56:20 UTC (rev 678) @@ -9,6 +9,11 @@ # You may use this sample code for anything you like, it is not covered by the # LGPL. # ----------------------------------------------------------------------------- + +# +# 29 July 2008: Ensured that resources.cfg and plugins.cfg can exist in the parent directory +# + import ogre.renderer.OGRE as ogre import ogre.io.OIS as OIS ###import OgreRefApp @@ -20,7 +25,7 @@ import os.path paths = [os.path.join(os.getcwd(), 'plugins.cfg'), - os.path.join(os.getcwd(), '../plugins.cfg'), + os.path.join(os.getcwd(), '..','plugins.cfg'), '/etc/OGRE/plugins.cfg', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'plugins.cfg')] @@ -107,7 +112,16 @@ """This sets up Ogre's resources, which are required to be in resources.cfg.""" config = ogre.ConfigFile() - config.load('resources.cfg' ) + try: + config.load('resources.cfg') + except ogre.OgreFileNotFoundException: + try: + config.load('../resources.cfg') + except: + raise + except: + raise + seci = config.getSectionIterator() while seci.hasMoreElements(): SectionName = seci.peekNextKey() @@ -276,7 +290,9 @@ self.InputManager.destroyInputObjectJoyStick( self.Joy ) OIS.InputManager.destroyInputSystem(self.InputManager) self.InputManager=None - + + ## NOTE the in Ogre 1.6 (1.7) this is changed to frameRenderingQueued !!! + def frameStarted(self, frameEvent): if(self.renderWindow.isClosed()): return False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-07-30 04:14:08
|
Revision: 680 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=680&view=rev Author: andy_miller Date: 2008-07-30 04:14:17 +0000 (Wed, 30 Jul 2008) Log Message: ----------- Expose 'points' and 'triangles' void * variables in PhysX Modified Paths: -------------- trunk/python-ogre/code_generators/physx/generate_code.py trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py Modified: trunk/python-ogre/code_generators/physx/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/physx/generate_code.py 2008-07-29 13:49:17 UTC (rev 679) +++ trunk/python-ogre/code_generators/physx/generate_code.py 2008-07-30 04:14:17 UTC (rev 680) @@ -135,7 +135,15 @@ def ManualFixes ( mb ): global_ns = mb.global_ns - + known = ['points', 'triangles'] + for c in global_ns.classes(): + if c.name.startswith ('Nx'): + print "Checking", c + for v in c.variables(allow_empty = True ): + if v.name in known: + v.expose_address = True + print "Exposing Address: ", v.name, " of class: ", c.name + sys.exit() ############################################################ ## Modified: trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py =================================================================== --- trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py 2008-07-29 13:49:17 UTC (rev 679) +++ trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py 2008-07-30 04:14:17 UTC (rev 680) @@ -35,80 +35,84 @@ Global_targetMO = None #ogre.MovableObject() -# # class PCZTestFrameListener ( sf.ExampleFrameListener) -# # -# # public: -# # PCZTestFrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener( win, cam ) -# # -# # self.MoveSpeed = 15.0 -# # self.updateRay=ogre.Ray() -# # -# # -# # void moveCamera() -# # -# # # Make all the spatial changes to the camera's scene node -# # # Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW -# # #(e.g. airplane) -# # self.camera.getParentSceneNode().translate(self.translateVector, Node.TS_LOCAL) -# # self.camera.getParentSceneNode().pitch(mRotY) -# # self.camera.getParentSceneNode().yaw(mRotX, Node.TS_WORLD) -# # Global_buildingNode.translate(Global_buildingTranslate, Node.TS_LOCAL) -# # -# # -# # bool frameRenderingQueued( const FrameEvent& evt ) -# # -# # if( ExampleFrameListener.frameRenderingQueued( evt ) == False ) -# # return False -# # -# # Global_buildingTranslate = ogre.Vector3(0,0,0) -# # if( self.keyboard.isKeyDown( ois.KC_LBRACKET ) ) -# # -# # Global_buildingTranslate = ogre.Vector3(0,-10,0) -# # -# # if( self.keyboard.isKeyDown( ois.KC_RBRACKET ) ) -# # -# # Global_buildingTranslate = ogre.Vector3(0,10,0) -# # -# # -# # if( self.keyboard.isKeyDown( ois.KC_LSHIFT ) || -# # self.keyboard.isKeyDown( ois.KC_RSHIFT )) -# # -# # self.MoveSpeed = 150 -# # -# # else -# # -# # self.MoveSpeed = 15 -# # -# # -# # # test the ray scene query by showing bounding box of whatever the camera is pointing directly at -# # # (takes furthest hit) -# # self.updateRay.setOrigin(self.camera.getParentSceneNode().getPosition()) -# # self.updateRay.setDirection(self.camera.getParentSceneNode().getOrientation()*ogre.Vector3.NEGATIVE_UNIT_Z) -# # Global_raySceneQuery.setRay(updateRay) -# # zone = ((PCZSceneNode*)(self.camera.getParentSceneNode())).getHomeZone() -# # ((PCZRaySceneQuery*)Global_raySceneQuery).setStartZone(zone) -# # ((PCZRaySceneQuery*)Global_raySceneQuery).setExcludeNode(self.camera.getParentSceneNode()) -# # RaySceneQueryResult& qryResult = Global_raySceneQuery.execute() -# # RaySceneQueryResult.iterator i = qryResult.begin() -# # if (i != qryResult.end()) -# # -# # RaySceneQueryResult.reverse_iterator ri = qryResult.rbegin() -# # MovableObject * mo = ri.movable -# # if (Global_targetMO != mo) -# # -# # if (Global_targetMO != 0) -# # -# # Global_targetMO.getParentSceneNode().showBoundingBox(False) -# # -# # Global_targetMO = mo -# # Global_targetMO.getParentSceneNode().showBoundingBox(True) -# # -# # -# # -# # return True +class PCZTestFrameListener ( sf.ExampleFrameListener): + def __init__(self, renderWindow, camera ): + sf.FrameListener.__init__(self, renderWindow, camera) + self.moveSpeed = 15.0 + self.raySceneQueue = sceneManager.createRayQuery(ogre.Ray(camera.getPosition(), + ogre.Vector3.NEGATIVE_UNIT_Y)) + self.camera = camera + self.updateRay=ogre.Ray() + self.pczCameraParentNode = pcz.castAsPCZSceneNode(self.camera.getParentSceneNode()) + + def moveCamera( self ): + # Make all the spatial changes to the camera's scene node + # Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW + #(e.g. airplane) + self.camera.getParentSceneNode().translate(self.translateVector, ogre.Node.TS_LOCAL) + self.camera.getParentSceneNode().pitch(self.rotationY) + self.camera.getParentSceneNode().yaw(self.rotationX, ogre.Node.TS_WORLD) + + Global_buildingNode.translate(Global_buildingTranslate, ogre.Node.TS_LOCAL) + def frameRenderingQueued( self, evt ): + if sf.FrameListener.frameRenderingQueued( evt ) == False: + return False + Global_buildingTranslate = ogre.Vector3(0,0,0) + if self.keyboard.isKeyDown( ois.KC_LBRACKET ): + Global_buildingTranslate = ogre.Vector3(0,-10,0) + if self.keyboard.isKeyDown( ois.KC_RBRACKET ): + Global_buildingTranslate = ogre.Vector3(0,10,0) + if self.keyboard.isKeyDown( ois.KC_LSHIFT ) or self.keyboard.isKeyDown( ois.KC_RSHIFT ): + self.moveSpeed = 150 + else + self.moveSpeed = 15 + # test the ray scene query by showing bounding box of whatever the camera is pointing directly at + # (takes furthest hit) + self.updateRay.setOrigin(self.camera.getParentSceneNode().getPosition()) + self.updateRay.setDirection(self.camera.getParentSceneNode().getOrientation()*ogre.Vector3.NEGATIVE_UNIT_Z) + Global_raySceneQuery.setRay(updateRay) + zone = self.pczCameraParentNode.getHomeZone() + pcz.castAsPCZRaySceneQuery(Global_raySceneQuery).setStartZone(zone) + pcz.castAsPCZRaySceneQuery(Global_raySceneQuery).setExcludeNode(self.camera.getParentSceneNode()) + for queryResult in Global_raySceneQuery.execute(): + ri = qryResult.rbegin() + mo = ri.movable + if Global_targetMO != mo: + if Global_targetMO != 0: + Global_targetMO.getParentSceneNode().showBoundingBox(False) + Global_targetMO = mo + Global_targetMO.getParentSceneNode().showBoundingBox(True) + return True + +class TerrainListener(sf.FrameListener): + def __init__(self, renderWindow, camera, sceneManager): + sf.FrameListener.__init__(self, renderWindow, camera) + self.sceneManager = sceneManager + self.moveSpeed = 50.0 + + self.raySceneQuery = sceneManager.createRayQuery(ogre.Ray(camera.getPosition(), + ogre.Vector3.NEGATIVE_UNIT_Y)) + self.camera = camera + #self.camera.setPosition (self.camera.getPosition() + ogre.Vector3(0.0, 10.0, 0.0)) + + def frameStarted(self, frameEvent): + # clamp to terrain + updateRay = ogre.Ray() + updateRay.setOrigin (self.camera.getPosition() + ogre.Vector3(0.0, 10.0, 0.0)) + updateRay.setDirection (ogre.Vector3.NEGATIVE_UNIT_Y) + self.raySceneQuery.Ray = updateRay + for queryResult in self.raySceneQuery.execute(): + if queryResult.worldFragment is not None: + pos = self.camera.getPosition() + self.camera.setPosition (pos.x, pos.y - queryResult.distance + 15.0, pos.z) + break + + return sf.FrameListener.frameStarted(self, frameEvent) + + class PCZTestApplication (sf.Application): def __del__(self): del Global_raySceneQuery This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-01 15:46:39
|
Revision: 682 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=682&view=rev Author: andy_miller Date: 2008-08-01 15:46:47 +0000 (Fri, 01 Aug 2008) Log Message: ----------- Minor changes to get OgreAL and ET compiling again on Windows Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/demos/ogre/tests/Test_Camera.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/environment.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-01 03:24:34 UTC (rev 681) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-01 15:46:47 UTC (rev 682) @@ -107,7 +107,7 @@ PATH_LIB_OgreOdePrefab = os.path.join( PATH_OgreOde, 'prefab/lib/Release' ) PATH_LIB_OgreOdeLoader = os.path.join( PATH_OgreOde, 'loader/lib/Release' ) -PATH_LIB_OgreAL = os.path.join( PATH_OGREAL ) # , 'lib/Release' ) +PATH_LIB_OgreAL = os.path.join( PATH_OGREAL ) ##, 'lib/Release' ) PATH_LIB_betagui = PATH_betagui PATH_LIB_quickgui = PATH_quickgui PATH_LIB_NxOgre= os.path.join(PATH_NxOgre, 'lib') Modified: trunk/python-ogre/demos/ogre/tests/Test_Camera.py =================================================================== --- trunk/python-ogre/demos/ogre/tests/Test_Camera.py 2008-08-01 03:24:34 UTC (rev 681) +++ trunk/python-ogre/demos/ogre/tests/Test_Camera.py 2008-08-01 15:46:47 UTC (rev 682) @@ -105,8 +105,13 @@ print v + for r in self.root.getAvailableRenderers(): + print "Renderer: ",r.getName() + cap = r.getCapabilities() + if cap: ## Note the OpenGL doesn't seem to have any capabilities?? + print "Device Name: ", cap.DeviceName + print "Driver Version/release: ", cap.DriverVersion.build, cap.DriverVersion.release - sys.exit() Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-08-01 03:24:34 UTC (rev 681) +++ trunk/python-ogre/demos/plugins.cfg 2008-08-01 15:46:47 UTC (rev 682) @@ -10,9 +10,9 @@ Plugin=Plugin_BSPSceneManager.dll Plugin=Plugin_OctreeSceneManager.dll Plugin=Plugin_CgProgramManager.dll -Plugin=Plugin_PCZSceneManager.dll -Plugin=Plugin_OctreeZone.dll -Plugin=Plugin_OctreeSceneManager.dll +#Plugin=Plugin_PCZSceneManager.dll +#Plugin=Plugin_OctreeZone.dll +#Plugin=Plugin_OctreeSceneManager.dll ## Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-01 03:24:34 UTC (rev 681) +++ trunk/python-ogre/environment.py 2008-08-01 15:46:47 UTC (rev 682) @@ -871,7 +871,8 @@ CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19' ModuleName = 'CEGUI' CheckIncludes = ['boost/python.hpp', 'Ogre.h', 'CEGUI.h', 'OgreCEGUIRenderer.h'] - LINKFLAGS = "-l%s" % boost_python_index.lib + if isLinux(): + LINKFLAGS = "-l%s" % boost_python_index.lib class ode: @@ -1297,7 +1298,7 @@ libs=[boost.lib, 'OgreMain', 'ogg_static', 'vorbis_static','vorbisfile_static','vorbisenc_static', - 'OpenAL32', 'EFX-Util', 'OgreAL'] # -- going to compile OgreAL ourselves + 'OpenAL32', 'EFX-Util'] # -- going to compile OgreAL ourselves source = [ ["wget", "http://connect.creativelabs.com/openal/Downloads/OpenAL11CoreSDK.zip",downloadPath], ["wget", "http://downloads.xiph.org/releases/ogg/libogg-1.1.3.zip",downloadPath], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-01 03:24:30
|
Revision: 681 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=681&view=rev Author: andy_miller Date: 2008-08-01 03:24:34 +0000 (Fri, 01 Aug 2008) Log Message: ----------- Implemented a CTYPE scheme (thanks to Romans Py++) for exposing void *'s Upgraded ogreforests to R2483 and cadelum to R264 Support for ODE 0.10.1 Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/code_generators/caelum/generate_code.py trunk/python-ogre/code_generators/caelum/python_caelum.h trunk/python-ogre/code_generators/common_utils/__init__.py trunk/python-ogre/code_generators/ode/generate_code.py trunk/python-ogre/code_generators/ogreforests/customization_data.py trunk/python-ogre/code_generators/ogreforests/generate_code.py trunk/python-ogre/code_generators/ogreforests/hand_made_wrappers.py trunk/python-ogre/code_generators/ogreforests/python_forests.h trunk/python-ogre/code_generators/ogreforests/python_forests_aliases.h trunk/python-ogre/code_generators/ogreforests/python_forests_sizeof.h trunk/python-ogre/code_generators/physx/generate_code.py trunk/python-ogre/demos/caelum/Demo_Caelum01.py trunk/python-ogre/environment.py trunk/python-ogre/scripts/compilesource.bat Added Paths: ----------- trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp trunk/python-ogre/ThirdParty/caelum/Astronomy.h trunk/python-ogre/ThirdParty/caelum/BrightStarCatalogue.cpp trunk/python-ogre/ThirdParty/caelum/Caelum.h trunk/python-ogre/ThirdParty/caelum/CaelumExceptions.h trunk/python-ogre/ThirdParty/caelum/CaelumPrecompiled.cpp trunk/python-ogre/ThirdParty/caelum/CaelumPrecompiled.h trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h trunk/python-ogre/ThirdParty/caelum/CaelumSystem.cpp trunk/python-ogre/ThirdParty/caelum/CaelumSystem.h trunk/python-ogre/ThirdParty/caelum/CameraBoundElement.cpp trunk/python-ogre/ThirdParty/caelum/CameraBoundElement.h trunk/python-ogre/ThirdParty/caelum/CloudSystem.cpp trunk/python-ogre/ThirdParty/caelum/CloudSystem.h trunk/python-ogre/ThirdParty/caelum/FlatCloudLayer.cpp trunk/python-ogre/ThirdParty/caelum/FlatCloudLayer.h trunk/python-ogre/ThirdParty/caelum/GeometryFactory.cpp trunk/python-ogre/ThirdParty/caelum/GeometryFactory.h trunk/python-ogre/ThirdParty/caelum/GroundFog.cpp trunk/python-ogre/ThirdParty/caelum/GroundFog.h trunk/python-ogre/ThirdParty/caelum/ImageHelper.cpp trunk/python-ogre/ThirdParty/caelum/ImageHelper.h trunk/python-ogre/ThirdParty/caelum/ImageStarfield.cpp trunk/python-ogre/ThirdParty/caelum/ImageStarfield.h trunk/python-ogre/ThirdParty/caelum/Moon.cpp trunk/python-ogre/ThirdParty/caelum/Moon.h trunk/python-ogre/ThirdParty/caelum/PointStarfield.cpp trunk/python-ogre/ThirdParty/caelum/PointStarfield.h trunk/python-ogre/ThirdParty/caelum/PrecipitationController.cpp trunk/python-ogre/ThirdParty/caelum/PrecipitationController.h trunk/python-ogre/ThirdParty/caelum/SkyDome.cpp trunk/python-ogre/ThirdParty/caelum/SkyDome.h trunk/python-ogre/ThirdParty/caelum/SkyLight.cpp trunk/python-ogre/ThirdParty/caelum/SkyLight.h trunk/python-ogre/ThirdParty/caelum/Sun.cpp trunk/python-ogre/ThirdParty/caelum/Sun.h trunk/python-ogre/ThirdParty/caelum/UniversalClock.cpp trunk/python-ogre/ThirdParty/caelum/UniversalClock.h trunk/python-ogre/ThirdParty/forests/BatchPage.cpp trunk/python-ogre/ThirdParty/forests/BatchPage.h trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h trunk/python-ogre/ThirdParty/forests/GrassLoader.cpp trunk/python-ogre/ThirdParty/forests/GrassLoader.h trunk/python-ogre/ThirdParty/forests/ImpostorPage.cpp trunk/python-ogre/ThirdParty/forests/ImpostorPage.h trunk/python-ogre/ThirdParty/forests/PagedGeometry.cpp trunk/python-ogre/ThirdParty/forests/PagedGeometry.h trunk/python-ogre/ThirdParty/forests/PropertyMaps.cpp trunk/python-ogre/ThirdParty/forests/PropertyMaps.h trunk/python-ogre/ThirdParty/forests/StaticBillboardSet.cpp trunk/python-ogre/ThirdParty/forests/StaticBillboardSet.h trunk/python-ogre/ThirdParty/forests/TreeLoader2D.cpp trunk/python-ogre/ThirdParty/forests/TreeLoader2D.h trunk/python-ogre/ThirdParty/forests/TreeLoader3D.cpp trunk/python-ogre/ThirdParty/forests/TreeLoader3D.h trunk/python-ogre/ThirdParty/forests/WindBatchPage.cpp trunk/python-ogre/ThirdParty/forests/WindBatchPage.h trunk/python-ogre/ThirdParty/forests/WindBatchedGeometry.cpp trunk/python-ogre/ThirdParty/forests/WindBatchedGeometry.h trunk/python-ogre/ThirdParty/forests/orig/ Removed Paths: ------------- trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp trunk/python-ogre/ThirdParty/caelum/Astronomy.h trunk/python-ogre/ThirdParty/caelum/BrightStarCatalogue.cpp trunk/python-ogre/ThirdParty/caelum/Caelum.h trunk/python-ogre/ThirdParty/caelum/CaelumExceptions.h trunk/python-ogre/ThirdParty/caelum/CaelumPrecompiled.cpp trunk/python-ogre/ThirdParty/caelum/CaelumPrecompiled.h trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h trunk/python-ogre/ThirdParty/caelum/CaelumSystem.cpp trunk/python-ogre/ThirdParty/caelum/CaelumSystem.h trunk/python-ogre/ThirdParty/caelum/CameraBoundElement.cpp trunk/python-ogre/ThirdParty/caelum/CameraBoundElement.h trunk/python-ogre/ThirdParty/caelum/GeometryFactory.cpp trunk/python-ogre/ThirdParty/caelum/GeometryFactory.h trunk/python-ogre/ThirdParty/caelum/GroundFog.cpp trunk/python-ogre/ThirdParty/caelum/GroundFog.h trunk/python-ogre/ThirdParty/caelum/ImageHelper.cpp trunk/python-ogre/ThirdParty/caelum/ImageHelper.h trunk/python-ogre/ThirdParty/caelum/ImageStarfield.cpp trunk/python-ogre/ThirdParty/caelum/ImageStarfield.h trunk/python-ogre/ThirdParty/caelum/LayeredClouds.cpp trunk/python-ogre/ThirdParty/caelum/LayeredClouds.h trunk/python-ogre/ThirdParty/caelum/Moon.cpp trunk/python-ogre/ThirdParty/caelum/Moon.h trunk/python-ogre/ThirdParty/caelum/PointStarfield.cpp trunk/python-ogre/ThirdParty/caelum/PointStarfield.h trunk/python-ogre/ThirdParty/caelum/SkyColourModel.cpp trunk/python-ogre/ThirdParty/caelum/SkyColourModel.h trunk/python-ogre/ThirdParty/caelum/SkyDome.cpp trunk/python-ogre/ThirdParty/caelum/SkyDome.h trunk/python-ogre/ThirdParty/caelum/SkyLight.cpp trunk/python-ogre/ThirdParty/caelum/SkyLight.h trunk/python-ogre/ThirdParty/caelum/SolarSystemModel.cpp trunk/python-ogre/ThirdParty/caelum/SolarSystemModel.h trunk/python-ogre/ThirdParty/caelum/Starfield.cpp trunk/python-ogre/ThirdParty/caelum/Starfield.h trunk/python-ogre/ThirdParty/caelum/Sun.cpp trunk/python-ogre/ThirdParty/caelum/Sun.h trunk/python-ogre/ThirdParty/caelum/UniversalClock.cpp trunk/python-ogre/ThirdParty/caelum/UniversalClock.h trunk/python-ogre/ThirdParty/forests/BatchPage.cpp trunk/python-ogre/ThirdParty/forests/BatchPage.h trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h trunk/python-ogre/ThirdParty/forests/GrassLoader.cpp trunk/python-ogre/ThirdParty/forests/GrassLoader.h trunk/python-ogre/ThirdParty/forests/ImpostorPage.cpp trunk/python-ogre/ThirdParty/forests/ImpostorPage.h trunk/python-ogre/ThirdParty/forests/PagedGeometry.cpp trunk/python-ogre/ThirdParty/forests/PagedGeometry.h trunk/python-ogre/ThirdParty/forests/PropertyMaps.cpp trunk/python-ogre/ThirdParty/forests/PropertyMaps.h trunk/python-ogre/ThirdParty/forests/StaticBillboardSet.cpp trunk/python-ogre/ThirdParty/forests/StaticBillboardSet.h trunk/python-ogre/ThirdParty/forests/TreeLoader2D.cpp trunk/python-ogre/ThirdParty/forests/TreeLoader2D.h trunk/python-ogre/ThirdParty/forests/TreeLoader3D.cpp trunk/python-ogre/ThirdParty/forests/TreeLoader3D.h trunk/python-ogre/ThirdParty/forests/orig/ Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-07-30 04:14:17 UTC (rev 680) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-01 03:24:34 UTC (rev 681) @@ -43,7 +43,7 @@ PATH_OIS = os.path.join(BASE_DIR, 'ois' ) ##'ois-1.0RC1') PATH_Newton = os.path.join(BASE_DIR, 'newtonsdk','sdk') PATH_FMOD = os.path.join(BASE_DIR, 'fmod') -PATH_ODE = os.path.join(BASE_DIR, 'ode-0.9') +PATH_ODE = os.path.join(BASE_DIR, 'ode-0.10.1') PATH_OGG = os.path.join(BASE_DIR, 'ogg') PATH_VORBIS= os.path.join(BASE_DIR, 'vorbis') PATH_OPENAL= os.path.join(BASE_DIR, 'openal') @@ -100,7 +100,7 @@ PATH_LIB_Newton = os.path.join( PATH_Newton ,'dll') ##NOTE Posix platforms this lives in 'lib-mt' PATH_LIB_OIS = os.path.join( PATH_OIS, 'lib') ## NOTE Posix platforms this lives in'lib' not 'dll' PATH_LIB_CEGUI = os.path.join( PATH_CEGUI, 'lib' ) -PATH_LIB_ODE = os.path.join( PATH_ODE, 'lib/releaselib')## probable releaselib for posix +PATH_LIB_ODE = os.path.join( PATH_ODE, 'lib/ReleaseSingleLib')## probable releaselib for posix PATH_LIB_OPCODE = os.path.join( PATH_OPCODE ) PATH_LIB_OgreOde = os.path.join( PATH_OgreOde, 'lib/Release') # # PATH_LIB_OgreBullet = os.path.join( PATH_OgreBullet, 'lib/Release') Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-07-30 04:14:17 UTC (rev 680) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-08-01 03:24:34 UTC (rev 681) @@ -78,6 +78,7 @@ PATH_particleuniverse = os.path.join(PATH_Ogre, 'PlugIns', 'ParticleUniverse' ) PATH_cadunetree= os.path.join(PATH_THIRDPARTY, 'cadunetree') PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') +PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) ### @@ -117,6 +118,7 @@ PATH_LIB_navi= os.path.join(PATH_navi, 'lib') PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') PATH_LIB_opensteer = os.path.join(LOCAL_LIB) +PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') Deleted: trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp =================================================================== --- trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp 2008-07-30 04:14:17 UTC (rev 680) +++ trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp 2008-08-01 03:24:34 UTC (rev 681) @@ -1,350 +0,0 @@ -/* -This file is part of Caelum. -See http://www.ogre3d.org/wiki/index.php/Caelum - -Copyright (c) 2008 Caelum team. See Contributors.txt for details. - -Caelum is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Caelum is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with Caelum. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "CaelumPrecompiled.h" -#include "Astronomy.h" - -namespace caelum -{ - const LongReal Astronomy::PI = 3.1415926535897932384626433832795029L; - - const LongReal Astronomy::J2000 = 2451545.0; - - LongReal Astronomy::radToDeg (LongReal value) - { - return value * 180 / PI; - } - - LongReal Astronomy::degToRad (LongReal value) - { - return value * PI / 180; - } - - LongReal Astronomy::sinDeg (LongReal x) { - return std::sin (degToRad (x)); - } - - LongReal Astronomy::cosDeg (LongReal x) { - return std::cos (degToRad (x)); - } - - LongReal Astronomy::atan2Deg (LongReal y, LongReal x) { - return radToDeg(std::atan2 (y, x)); - } - - LongReal Astronomy::normalizeDegrees (LongReal value) - { - value = fmod (value, 360); - if (value < LongReal (0)) { - value += LongReal (360); - } - return value; - } - - void Astronomy::convertEclipticToEquatorialRad ( - LongReal lon, LongReal lat, - LongReal &rasc, LongReal &decl) - { - double ecl = Astronomy::degToRad(23.439281); - - double x = cos(lon) * cos(lat); - double y = cos(ecl) * sin(lon) * cos(lat) - sin(ecl) * sin(lat); - double z = sin(ecl) * sin(lon) * cos(lat) + cos(ecl) * sin(lat); - - double r = sqrt(x * x + y * y); - rasc = atan2(y, x); - decl = atan2(z, r); - } - - void Astronomy::convertRectangularToSpherical ( - LongReal x, LongReal y, LongReal z, - LongReal &rasc, LongReal &decl, LongReal &dist) - { - dist = sqrt (x * x + y * y + z * z); - rasc = atan2Deg (y, x); - decl = atan2Deg (z, sqrt (x * x + y * y)); - } - - void Astronomy::convertSphericalToRectangular ( - LongReal rasc, LongReal decl, LongReal dist, - LongReal &x, LongReal &y, LongReal &z) - { - x = dist * cosDeg (rasc) * cosDeg (decl); - y = dist * sinDeg (rasc) * cosDeg (decl); - z = dist * sinDeg (decl); - } - - void Astronomy::convertEquatorialToHorizontal ( - LongReal jday, - LongReal longitude, LongReal latitude, - LongReal rasc, LongReal decl, - LongReal &azimuth, LongReal &altitude) - { - LongReal d = jday - 2451543.5; - LongReal w = LongReal (282.9404 + 4.70935E-5 * d); - LongReal M = LongReal (356.0470 + 0.9856002585 * d); - // Sun's mean longitude - LongReal L = w + M; - // Universal time of day in degrees. - LongReal UT = LongReal(fmod(d, 1) * 360); - LongReal hourAngle = longitude + L + LongReal (180) + UT - rasc; - - LongReal x = cosDeg (hourAngle) * cosDeg (decl); - LongReal y = sinDeg (hourAngle) * cosDeg (decl); - LongReal z = sinDeg (decl); - - LongReal xhor = x * sinDeg (latitude) - z * cosDeg (latitude); - LongReal yhor = y; - LongReal zhor = x * cosDeg (latitude) + z * sinDeg (latitude); - - azimuth = atan2Deg (yhor, xhor) + LongReal (180); - altitude = atan2Deg (zhor, sqrt (xhor * xhor + yhor * yhor)); - } - - void Astronomy::getHorizontalSunPosition ( - LongReal jday, - LongReal longitude, LongReal latitude, - LongReal &azimuth, LongReal &altitude) - { - // 2451544.5 == Astronomy::getJulianDayFromGregorianDateTime(2000, 1, 1, 0, 0, 0)); - // 2451543.5 == Astronomy::getJulianDayFromGregorianDateTime(1999, 12, 31, 0, 0, 0)); - LongReal d = jday - 2451543.5; - - // Sun's Orbital elements: - // argument of perihelion - LongReal w = LongReal (282.9404 + 4.70935E-5 * d); - // eccentricity (0=circle, 0-1=ellipse, 1=parabola) - LongReal e = 0.016709 - 1.151E-9 * d; - // mean anomaly (0 at perihelion; increases uniformly with time) - LongReal M = LongReal(356.0470 + 0.9856002585 * d); - // Obliquity of the ecliptic. - //LongReal oblecl = LongReal (23.4393 - 3.563E-7 * d); - - // Eccentric anomaly - LongReal E = M + radToDeg(e * sinDeg (M) * (1 + e * cosDeg (M))); - - // Sun's Distance(R) and true longitude(L) - LongReal xv = cosDeg (E) - e; - LongReal yv = sinDeg (E) * sqrt (1 - e * e); - //LongReal r = sqrt (xv * xv + yv * yv); - LongReal lon = atan2Deg (yv, xv) + w; - LongReal lat = 0; - - LongReal lambda = degToRad(lon); - LongReal beta = degToRad(lat); - LongReal rasc, decl; - convertEclipticToEquatorialRad (lambda, beta, rasc, decl); - rasc = radToDeg(rasc); - decl = radToDeg(decl); - - // Horizontal spherical. - Astronomy::convertEquatorialToHorizontal ( - jday, longitude, latitude, rasc, decl, azimuth, altitude); - } - - void Astronomy::getHorizontalSunPosition ( - LongReal jday, - Ogre::Degree longitude, Ogre::Degree latitude, - Ogre::Degree &azimuth, Ogre::Degree &altitude) - { - LongReal az, al; - getHorizontalSunPosition(jday, longitude.valueDegrees (), latitude.valueDegrees (), az, al); - azimuth = Ogre::Degree(az); - altitude = Ogre::Degree(al); - } - - void Astronomy::getEclipticMoonPositionRad ( - LongReal jday, - LongReal &lon, LongReal &lat) - { - // Julian centuries since January 1, 2000 - double T = (jday - 2451545.0L) / 36525.0L; - double lprim = 3.8104L + 8399.7091L * T; - double mprim = 2.3554L + 8328.6911L * T; - double m = 6.2300L + 648.3019L * T; - double d = 5.1985L + 7771.3772L * T; - double f = 1.6280L + 8433.4663L * T; - lon = lprim - + 0.1098L * sin(mprim) - + 0.0222L * sin(2.0L * d - mprim) - + 0.0115L * sin(2.0L * d) - + 0.0037L * sin(2.0L * mprim) - - 0.0032L * sin(m) - - 0.0020L * sin(2.0L * f) - + 0.0010L * sin(2.0L * d - 2.0L * mprim) - + 0.0010L * sin(2.0L * d - m - mprim) - + 0.0009L * sin(2.0L * d + mprim) - + 0.0008L * sin(2.0L * d - m) - + 0.0007L * sin(mprim - m) - - 0.0006L * sin(d) - - 0.0005L * sin(m + mprim); - lat = - + 0.0895L * sin(f) - + 0.0049L * sin(mprim + f) - + 0.0048L * sin(mprim - f) - + 0.0030L * sin(2.0L * d - f) - + 0.0010L * sin(2.0L * d + f - mprim) - + 0.0008 * sin(2.0L * d - f - mprim) - + 0.0006L * sin(2.0L * d + f); - } - - void Astronomy::getHorizontalMoonPosition ( - LongReal jday, - LongReal longitude, LongReal latitude, - LongReal &azimuth, LongReal &altitude) - { - // Ecliptic spherical - LongReal lonecl, latecl; - Astronomy::getEclipticMoonPositionRad (jday, lonecl, latecl); - - // Equatorial spherical - LongReal rasc, decl; - Astronomy::convertEclipticToEquatorialRad (lonecl, latecl, rasc, decl); - - // Radians to degrees (all angles are in radians up to this point) - rasc = radToDeg(rasc); - decl = radToDeg(decl); - - // Equatorial to horizontal - Astronomy::convertEquatorialToHorizontal ( - jday, longitude, latitude, rasc, decl, azimuth, altitude); - } - - void Astronomy::getHorizontalMoonPosition ( - LongReal jday, - Ogre::Degree longitude, Ogre::Degree latitude, - Ogre::Degree &azimuth, Ogre::Degree &altitude) - { - LongReal az, al; - getHorizontalMoonPosition(jday, longitude.valueDegrees (), latitude.valueDegrees (), az, al); - azimuth = Ogre::Degree(az); - altitude = Ogre::Degree(al); - } - - int Astronomy::getJulianDayFromGregorianDate( - int year, int month, int day) - { - // Formulas from http://en.wikipedia.org/wiki/Julian_day - // These are all integer divisions, but I'm not sure it works - // correctly for negative values. - int a = (14 - month) / 12; - int y = year + 4800 - a; - int m = month + 12 * a - 3; - return day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045; - } - - LongReal Astronomy::getJulianDayFromGregorianDateTime( - int year, int month, int day, - int hour, int minute, LongReal second) - { - int fpmode = Astronomy::enterHighPrecissionFloatingPointMode (); - - int jdn = getJulianDayFromGregorianDate (year, month, day); - // These are NOT integer divisions. - LongReal jd = jdn + (hour - 12) / 24.0 + minute / 1440.0 + second / 86400.0; - - Astronomy::restoreFloatingPointMode(fpmode); - return jd; - } - - LongReal Astronomy::getJulianDayFromGregorianDateTime( - int year, int month, int day, - LongReal secondsFromMidnight) - { - int jdn = getJulianDayFromGregorianDate(year, month, day); - LongReal jd = jdn + secondsFromMidnight / 86400.0 - 0.5; - return jd; - } - - void Astronomy::getGregorianDateFromJulianDay( - int julianDay, int &year, int &month, int &day) - { - // From http://en.wikipedia.org/wiki/Julian_day - int J = julianDay; - int j = J + 32044; - int g = j / 146097; - int dg = j % 146097; - int c = (dg / 36524 + 1) * 3 / 4; - int dc = dg - c * 36524; - int b = dc / 1461; - int db = dc % 1461; - int a = (db / 365 + 1) * 3 / 4; - int da = db - a * 365; - int y = g * 400 + c * 100 + b * 4 + a; - int m = (da * 5 + 308) / 153 - 2; - int d = da - (m + 4) * 153 / 5 + 122; - year = y - 4800 + (m + 2) / 12; - month = (m + 2) % 12 + 1; - day = d + 1; - } - - void Astronomy::getGregorianDateTimeFromJulianDay( - LongReal julianDay, int &year, int &month, int &day, - int &hour, int &minute, LongReal &second) - { - // Integer julian days are at noon. - // static_cast<int)(floor( is more precise than Ogre::Math::IFloor. - // Yes, it does matter. - int ijd = static_cast<int>(floor(julianDay + 0.5)); - getGregorianDateFromJulianDay(ijd, year, month, day); - - LongReal s = (julianDay + 0.5 - ijd) * 86400.0; - hour = static_cast<int>(floor(s / 3600)); - s -= hour * 3600; - minute = static_cast<int>(floor(s / 60)); - s -= minute * 60; - second = s; - } - - void Astronomy::getGregorianDateFromJulianDay( - LongReal julianDay, int &year, int &month, int &day) - { - int hour; - int minute; - LongReal second; - getGregorianDateTimeFromJulianDay(julianDay, year, month, day, hour, minute, second); - } - -#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && (OGRE_COMPILER == OGRE_COMPILER_MSVC) - int Astronomy::enterHighPrecissionFloatingPointMode () - { - int oldMode = ::_controlfp (0, 0); - ::_controlfp (_PC_64, _MCW_PC); - return oldMode; - } - - void Astronomy::restoreFloatingPointMode (int oldMode) - { - ::_controlfp (oldMode, _MCW_PC); - } -#else - int Astronomy::enterHighPrecissionFloatingPointMode () - { - // Meaningless - return 0xC0FFEE; - } - - void Astronomy::restoreFloatingPointMode (int oldMode) - { - // Useless check. - assert(oldMode == 0xC0FFEE); - } -#endif -} Added: trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp =================================================================== --- trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/caelum/Astronomy.cpp 2008-08-01 03:24:34 UTC (rev 681) @@ -0,0 +1,350 @@ +/* +This file is part of Caelum. +See http://www.ogre3d.org/wiki/index.php/Caelum + +Copyright (c) 2008 Caelum team. See Contributors.txt for details. + +Caelum is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Caelum is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with Caelum. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "CaelumPrecompiled.h" +#include "Astronomy.h" + +namespace Caelum +{ + const LongReal Astronomy::PI = 3.1415926535897932384626433832795029L; + + const LongReal Astronomy::J2000 = 2451545.0; + + LongReal Astronomy::radToDeg (LongReal value) + { + return value * 180 / PI; + } + + LongReal Astronomy::degToRad (LongReal value) + { + return value * PI / 180; + } + + LongReal Astronomy::sinDeg (LongReal x) { + return std::sin (degToRad (x)); + } + + LongReal Astronomy::cosDeg (LongReal x) { + return std::cos (degToRad (x)); + } + + LongReal Astronomy::atan2Deg (LongReal y, LongReal x) { + return radToDeg(std::atan2 (y, x)); + } + + LongReal Astronomy::normalizeDegrees (LongReal value) + { + value = fmod (value, 360); + if (value < LongReal (0)) { + value += LongReal (360); + } + return value; + } + + void Astronomy::convertEclipticToEquatorialRad ( + LongReal lon, LongReal lat, + LongReal &rasc, LongReal &decl) + { + double ecl = Astronomy::degToRad(23.439281); + + double x = cos(lon) * cos(lat); + double y = cos(ecl) * sin(lon) * cos(lat) - sin(ecl) * sin(lat); + double z = sin(ecl) * sin(lon) * cos(lat) + cos(ecl) * sin(lat); + + double r = sqrt(x * x + y * y); + rasc = atan2(y, x); + decl = atan2(z, r); + } + + void Astronomy::convertRectangularToSpherical ( + LongReal x, LongReal y, LongReal z, + LongReal &rasc, LongReal &decl, LongReal &dist) + { + dist = sqrt (x * x + y * y + z * z); + rasc = atan2Deg (y, x); + decl = atan2Deg (z, sqrt (x * x + y * y)); + } + + void Astronomy::convertSphericalToRectangular ( + LongReal rasc, LongReal decl, LongReal dist, + LongReal &x, LongReal &y, LongReal &z) + { + x = dist * cosDeg (rasc) * cosDeg (decl); + y = dist * sinDeg (rasc) * cosDeg (decl); + z = dist * sinDeg (decl); + } + + void Astronomy::convertEquatorialToHorizontal ( + LongReal jday, + LongReal longitude, LongReal latitude, + LongReal rasc, LongReal decl, + LongReal &azimuth, LongReal &altitude) + { + LongReal d = jday - 2451543.5; + LongReal w = LongReal (282.9404 + 4.70935E-5 * d); + LongReal M = LongReal (356.0470 + 0.9856002585 * d); + // Sun's mean longitude + LongReal L = w + M; + // Universal time of day in degrees. + LongReal UT = LongReal(fmod(d, 1) * 360); + LongReal hourAngle = longitude + L + LongReal (180) + UT - rasc; + + LongReal x = cosDeg (hourAngle) * cosDeg (decl); + LongReal y = sinDeg (hourAngle) * cosDeg (decl); + LongReal z = sinDeg (decl); + + LongReal xhor = x * sinDeg (latitude) - z * cosDeg (latitude); + LongReal yhor = y; + LongReal zhor = x * cosDeg (latitude) + z * sinDeg (latitude); + + azimuth = atan2Deg (yhor, xhor) + LongReal (180); + altitude = atan2Deg (zhor, sqrt (xhor * xhor + yhor * yhor)); + } + + void Astronomy::getHorizontalSunPosition ( + LongReal jday, + LongReal longitude, LongReal latitude, + LongReal &azimuth, LongReal &altitude) + { + // 2451544.5 == Astronomy::getJulianDayFromGregorianDateTime(2000, 1, 1, 0, 0, 0)); + // 2451543.5 == Astronomy::getJulianDayFromGregorianDateTime(1999, 12, 31, 0, 0, 0)); + LongReal d = jday - 2451543.5; + + // Sun's Orbital elements: + // argument of perihelion + LongReal w = LongReal (282.9404 + 4.70935E-5 * d); + // eccentricity (0=circle, 0-1=ellipse, 1=parabola) + LongReal e = 0.016709 - 1.151E-9 * d; + // mean anomaly (0 at perihelion; increases uniformly with time) + LongReal M = LongReal(356.0470 + 0.9856002585 * d); + // Obliquity of the ecliptic. + //LongReal oblecl = LongReal (23.4393 - 3.563E-7 * d); + + // Eccentric anomaly + LongReal E = M + radToDeg(e * sinDeg (M) * (1 + e * cosDeg (M))); + + // Sun's Distance(R) and true longitude(L) + LongReal xv = cosDeg (E) - e; + LongReal yv = sinDeg (E) * sqrt (1 - e * e); + //LongReal r = sqrt (xv * xv + yv * yv); + LongReal lon = atan2Deg (yv, xv) + w; + LongReal lat = 0; + + LongReal lambda = degToRad(lon); + LongReal beta = degToRad(lat); + LongReal rasc, decl; + convertEclipticToEquatorialRad (lambda, beta, rasc, decl); + rasc = radToDeg(rasc); + decl = radToDeg(decl); + + // Horizontal spherical. + Astronomy::convertEquatorialToHorizontal ( + jday, longitude, latitude, rasc, decl, azimuth, altitude); + } + + void Astronomy::getHorizontalSunPosition ( + LongReal jday, + Ogre::Degree longitude, Ogre::Degree latitude, + Ogre::Degree &azimuth, Ogre::Degree &altitude) + { + LongReal az, al; + getHorizontalSunPosition(jday, longitude.valueDegrees (), latitude.valueDegrees (), az, al); + azimuth = Ogre::Degree(az); + altitude = Ogre::Degree(al); + } + + void Astronomy::getEclipticMoonPositionRad ( + LongReal jday, + LongReal &lon, LongReal &lat) + { + // Julian centuries since January 1, 2000 + double T = (jday - 2451545.0L) / 36525.0L; + double lprim = 3.8104L + 8399.7091L * T; + double mprim = 2.3554L + 8328.6911L * T; + double m = 6.2300L + 648.3019L * T; + double d = 5.1985L + 7771.3772L * T; + double f = 1.6280L + 8433.4663L * T; + lon = lprim + + 0.1098L * sin(mprim) + + 0.0222L * sin(2.0L * d - mprim) + + 0.0115L * sin(2.0L * d) + + 0.0037L * sin(2.0L * mprim) + - 0.0032L * sin(m) + - 0.0020L * sin(2.0L * f) + + 0.0010L * sin(2.0L * d - 2.0L * mprim) + + 0.0010L * sin(2.0L * d - m - mprim) + + 0.0009L * sin(2.0L * d + mprim) + + 0.0008L * sin(2.0L * d - m) + + 0.0007L * sin(mprim - m) + - 0.0006L * sin(d) + - 0.0005L * sin(m + mprim); + lat = + + 0.0895L * sin(f) + + 0.0049L * sin(mprim + f) + + 0.0048L * sin(mprim - f) + + 0.0030L * sin(2.0L * d - f) + + 0.0010L * sin(2.0L * d + f - mprim) + + 0.0008 * sin(2.0L * d - f - mprim) + + 0.0006L * sin(2.0L * d + f); + } + + void Astronomy::getHorizontalMoonPosition ( + LongReal jday, + LongReal longitude, LongReal latitude, + LongReal &azimuth, LongReal &altitude) + { + // Ecliptic spherical + LongReal lonecl, latecl; + Astronomy::getEclipticMoonPositionRad (jday, lonecl, latecl); + + // Equatorial spherical + LongReal rasc, decl; + Astronomy::convertEclipticToEquatorialRad (lonecl, latecl, rasc, decl); + + // Radians to degrees (all angles are in radians up to this point) + rasc = radToDeg(rasc); + decl = radToDeg(decl); + + // Equatorial to horizontal + Astronomy::convertEquatorialToHorizontal ( + jday, longitude, latitude, rasc, decl, azimuth, altitude); + } + + void Astronomy::getHorizontalMoonPosition ( + LongReal jday, + Ogre::Degree longitude, Ogre::Degree latitude, + Ogre::Degree &azimuth, Ogre::Degree &altitude) + { + LongReal az, al; + getHorizontalMoonPosition(jday, longitude.valueDegrees (), latitude.valueDegrees (), az, al); + azimuth = Ogre::Degree(az); + altitude = Ogre::Degree(al); + } + + int Astronomy::getJulianDayFromGregorianDate( + int year, int month, int day) + { + // Formulas from http://en.wikipedia.org/wiki/Julian_day + // These are all integer divisions, but I'm not sure it works + // correctly for negative values. + int a = (14 - month) / 12; + int y = year + 4800 - a; + int m = month + 12 * a - 3; + return day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045; + } + + LongReal Astronomy::getJulianDayFromGregorianDateTime( + int year, int month, int day, + int hour, int minute, LongReal second) + { + int fpmode = Astronomy::enterHighPrecissionFloatingPointMode (); + + int jdn = getJulianDayFromGregorianDate (year, month, day); + // These are NOT integer divisions. + LongReal jd = jdn + (hour - 12) / 24.0 + minute / 1440.0 + second / 86400.0; + + Astronomy::restoreFloatingPointMode(fpmode); + return jd; + } + + LongReal Astronomy::getJulianDayFromGregorianDateTime( + int year, int month, int day, + LongReal secondsFromMidnight) + { + int jdn = getJulianDayFromGregorianDate(year, month, day); + LongReal jd = jdn + secondsFromMidnight / 86400.0 - 0.5; + return jd; + } + + void Astronomy::getGregorianDateFromJulianDay( + int julianDay, int &year, int &month, int &day) + { + // From http://en.wikipedia.org/wiki/Julian_day + int J = julianDay; + int j = J + 32044; + int g = j / 146097; + int dg = j % 146097; + int c = (dg / 36524 + 1) * 3 / 4; + int dc = dg - c * 36524; + int b = dc / 1461; + int db = dc % 1461; + int a = (db / 365 + 1) * 3 / 4; + int da = db - a * 365; + int y = g * 400 + c * 100 + b * 4 + a; + int m = (da * 5 + 308) / 153 - 2; + int d = da - (m + 4) * 153 / 5 + 122; + year = y - 4800 + (m + 2) / 12; + month = (m + 2) % 12 + 1; + day = d + 1; + } + + void Astronomy::getGregorianDateTimeFromJulianDay( + LongReal julianDay, int &year, int &month, int &day, + int &hour, int &minute, LongReal &second) + { + // Integer julian days are at noon. + // static_cast<int)(floor( is more precise than Ogre::Math::IFloor. + // Yes, it does matter. + int ijd = static_cast<int>(floor(julianDay + 0.5)); + getGregorianDateFromJulianDay(ijd, year, month, day); + + LongReal s = (julianDay + 0.5 - ijd) * 86400.0; + hour = static_cast<int>(floor(s / 3600)); + s -= hour * 3600; + minute = static_cast<int>(floor(s / 60)); + s -= minute * 60; + second = s; + } + + void Astronomy::getGregorianDateFromJulianDay( + LongReal julianDay, int &year, int &month, int &day) + { + int hour; + int minute; + LongReal second; + getGregorianDateTimeFromJulianDay(julianDay, year, month, day, hour, minute, second); + } + +#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && (OGRE_COMPILER == OGRE_COMPILER_MSVC) + int Astronomy::enterHighPrecissionFloatingPointMode () + { + int oldMode = ::_controlfp (0, 0); + ::_controlfp (_PC_64, _MCW_PC); + return oldMode; + } + + void Astronomy::restoreFloatingPointMode (int oldMode) + { + ::_controlfp (oldMode, _MCW_PC); + } +#else + int Astronomy::enterHighPrecissionFloatingPointMode () + { + // Meaningless + return 0xC0FFEE; + } + + void Astronomy::restoreFloatingPointMode (int oldMode) + { + // Useless check. + assert(oldMode == 0xC0FFEE); + } +#endif +} Deleted: trunk/python-ogre/ThirdParty/caelum/Astronomy.h =================================================================== --- trunk/python-ogre/ThirdParty/caelum/Astronomy.h 2008-07-30 04:14:17 UTC (rev 680) +++ trunk/python-ogre/ThirdParty/caelum/Astronomy.h 2008-08-01 03:24:34 UTC (rev 681) @@ -1,204 +0,0 @@ -/* -This file is part of Caelum. -See http://www.ogre3d.org/wiki/index.php/Caelum - -Copyright (c) 2008 Caelum team. See Contributors.txt for details. - -Caelum is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Caelum is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with Caelum. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef ASTRONOMY_H -#define ASTRONOMY_H - -#include "CaelumPrerequisites.h" - -namespace caelum -{ - /** Static class with astronomy routines. - * This class contains various astronomical routines useful in Caelum. - * - * Most of the formulas are from http://stjarnhimlen.se/comp/ppcomp.html - * That site contains much more than was implemented here; it has code - * for determining the positions of all the planets. Only the sun and - * moon are actually useful for caelum. - * - * The formulas are isolated here in pure procedural code for easier - * testing (Tests are done as assertions in the demo). - * - * Precision is vital here, so this class uses caelum::LongReal(double) - * instead of Ogre::Real(float) for precission. All angles are in degrees - * unless otherwise mentioned. Ogre::Degree and Ogre::Radian use - * Ogre::Real and should be avoided here. - */ - class CAELUM_EXPORT Astronomy - { - private: - Astronomy() {} - - static const LongReal PI; - - /** Normalize an angle to the 0, 360 range. - * @param x The angle to normalize - */ - static LongReal normalizeDegrees (LongReal x); - - /// Convert radians to degrees. - static LongReal radToDeg (LongReal x); - - /// Convert degrees to radians. - static LongReal degToRad (LongReal x); - - static LongReal sinDeg (LongReal x); - static LongReal cosDeg (LongReal x); - static LongReal atan2Deg (LongReal y, LongReal x); - - public: - /// January 1, 2000, noon - static const LongReal J2000; - - /** Convert from ecliptic to ecuatorial spherical coordinates, in radians. - * @param lon Ecliptic longitude - * @param lat Ecliptic latitude - * @param rasc Right ascension - * @param decl Declination - * @warning: This function works in radians. - */ - static void convertEclipticToEquatorialRad ( - LongReal lon, LongReal lat, - LongReal& rasc, LongReal& decl); - - static void convertRectangularToSpherical ( - LongReal x, LongReal y, LongReal z, - LongReal &rasc, LongReal &decl, LongReal &dist); - - static void convertSphericalToRectangular ( - LongReal rasc, LongReal decl, LongReal dist, - LongReal &x, LongReal &y, LongReal &z); - - /** Convert from equatorial to horizontal coordinates. - * This function converts from angles relative to the earth's equator - * to angle relative to the horizon at a given point. - * @param jday Astronomical time as julian day. - * @param longitude Observer's longitude in degrees east. - * @param latitude Observer's latitude in degrees north. - * @param rasc Object's right ascension. - * @param decl Object's declination. - * @param azimuth Object's azimuth (clockwise degrees from true north). - * @param altitude Object's altitude (degrees above the horizon). - */ - static void convertEquatorialToHorizontal ( - LongReal jday, - LongReal longitude, LongReal latitude, - LongReal rasc, LongReal decl, - LongReal &azimuth, LongReal &altitude); - - /** Get the sun's position in the sky in, relative to the horizon. - * @param jday Astronomical time as julian day. - * @param longitude Observer longitude - * @param latitude Observer latitude - * @param azimuth Astronomical azimuth, measured clockwise from North = 0. - * @param altitude Astronomical altitude, elevation above the horizon. - */ - static void getHorizontalSunPosition ( - LongReal jday, - LongReal longitude, LongReal latitude, - LongReal &azimuth, LongReal &altitude); - - static void getHorizontalSunPosition ( - LongReal jday, - Ogre::Degree longitude, Ogre::Degree latitude, - Ogre::Degree &azimuth, Ogre::Degree &altitude); - - /// Gets the moon position at a specific time in ecliptic coordinates - /// @param lon: Ecliptic longitude, in radians. - /// @param lat: Ecliptic latitude, in radians. - static void getEclipticMoonPositionRad ( - LongReal jday, - LongReal &lon, - LongReal &lat); - - static void getHorizontalMoonPosition ( - LongReal jday, - LongReal longitude, LongReal latitude, - LongReal &azimuth, LongReal &altitude); - static void getHorizontalMoonPosition ( - LongReal jday, - Ogre::Degree longitude, Ogre::Degree latitude, - Ogre::Degree &azimuth, Ogre::Degree &altitude); - - /** Get astronomical julian day from normal gregorian calendar. - * From wikipedia: the integer number of days that have elapsed - * since the initial epoch defined as - * noon Universal Time (UT) Monday, January 1, 4713 BC - * @note this is the time at noon, not midnight. - */ - static int getJulianDayFromGregorianDate ( - int year, int month, int day); - - /** Get astronomical julian day from normal gregorian calendar. - * Calculate julian day from a day in the normal gregorian calendar. - * Time should be given as UTC. - * @see http://en.wikipedia.org/wiki/Julian_day - */ - static LongReal getJulianDayFromGregorianDateTime ( - int year, int month, int day, - int hour, int minute, LongReal second); - - /** Get astronomical julian day from normal gregorian calendar. - * @see above (I don't know the proper doxygen syntax). - */ - static LongReal getJulianDayFromGregorianDateTime ( - int year, int month, int day, - LongReal secondsFromMidnight); - - /// Get gregorian date from integer julian day. - static void getGregorianDateFromJulianDay ( - int julianDay, int &year, int &month, int &day); - - /// Get gregorian date time from floating point julian day. - static void getGregorianDateTimeFromJulianDay ( - LongReal julianDay, int &year, int &month, int &day, - int &hour, int &minute, LongReal &second); - - /// Get gregorian date from floating point julian day. - static void getGregorianDateFromJulianDay ( - LongReal julianDay, int &year, int &month, int &day); - - /** Enter high-precission floating-point mode. - * - * By default Direct3D decreases the precission of ALL floating - * point calculations, enough to stop Caelum's astronomy routines - * from working correctly. - * - * To trigger this behaviour in a standard ogre demo select the - * Direct3D render system and set "Floating-point mode" to - * "Fastest". Otherwise it's not a problem. - * - * It can be fixed by changing the precission only inside caelum's - * astronomy routines using the _controlfp function. This only works - * for MSVC on WIN32; This is a no-op on other compilers. - * - * @note: Must be paired with restoreFloatingPointMode. - * @return Value to pass to restoreFloatingModeMode. - */ - static int enterHighPrecissionFloatingPointMode (); - - /** Restore old floating point precission. - * @see enterHighPrecissionFloatingPointMode. - */ - static void restoreFloatingPointMode (int oldMode); - }; -} - -#endif // SOLARSYSTEMMODEL_H Added: trunk/python-ogre/ThirdParty/caelum/Astronomy.h =================================================================== --- trunk/python-ogre/ThirdParty/caelum/Astronomy.h (rev 0) +++ trunk/python-ogre/ThirdParty/caelum/Astronomy.h 2008-08-01 03:24:34 UTC (rev 681) @@ -0,0 +1,204 @@ +/* +This file is part of Caelum. +See http://www.ogre3d.org/wiki/index.php/Caelum + +Copyright (c) 2008 Caelum team. See Contributors.txt for details. + +Caelum is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Caelum is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with Caelum. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef ASTRONOMY_H +#define ASTRONOMY_H + +#include "CaelumPrerequisites.h" + +namespace Caelum +{ + /** Static class with astronomy routines. + * This class contains various astronomical routines useful in Caelum. + * + * Most of the formulas are from http://stjarnhimlen.se/comp/ppcomp.html + * That site contains much more than was implemented here; it has code + * for determining the positions of all the planets. Only the sun and + * moon are actually useful for caelum. + * + * The formulas are isolated here in pure procedural code for easier + * testing (Tests are done as assertions in the demo). + * + * Precision is vital here, so this class uses Caelum::LongReal(double) + * instead of Ogre::Real(float) for precission. All angles are in degrees + * unless otherwise mentioned. Ogre::Degree and Ogre::Radian use + * Ogre::Real and should be avoided here. + */ + class CAELUM_EXPORT Astronomy + { + private: + Astronomy() {} + + static const LongReal PI; + + /** Normalize an angle to the 0, 360 range. + * @param x The angle to normalize + */ + static LongReal normalizeDegrees (LongReal x); + + /// Convert radians to degrees. + static LongReal radToDeg (LongReal x); + + /// Convert degrees to radians. + static LongReal degToRad (LongReal x); + + static LongReal sinDeg (LongReal x); + static LongReal cosDeg (LongReal x); + static LongReal atan2Deg (LongReal y, LongReal x); + + public: + /// January 1, 2000, noon + static const LongReal J2000; + + /** Convert from ecliptic to ecuatorial spherical coordinates, in radians. + * @param lon Ecliptic longitude + * @param lat Ecliptic latitude + * @param rasc Right ascension + * @param decl Declination + * @warning: This function works in radians. + */ + static void convertEclipticToEquatorialRad ( + LongReal lon, LongReal lat, + LongReal& rasc, LongReal& decl); + + static void convertRectangularToSpherical ( + LongReal x, LongReal y, LongReal z, + LongReal &rasc, LongReal &decl, LongReal &dist); + + static void convertSphericalToRectangular ( + LongReal rasc, LongReal decl, LongReal dist, + LongReal &x, LongReal &y, LongReal &z); + + /** Convert from equatorial to horizontal coordinates. + * This function converts from angles relative to the earth's equator + * to angle relative to the horizon at a given point. + * @param jday Astronomical time as julian day. + * @param longitude Observer's longitude in degrees east. + * @param latitude Observer's latitude in degrees north. + * @param rasc Object's right ascension. + * @param decl Object's declination. + * @param azimuth Object's azimuth (clockwise degrees from true north). + * @param altitude Object's altitude (degrees above the horizon). + */ + static void convertEquatorialToHorizontal ( + LongReal jday, + LongReal longitude, LongReal latitude, + LongReal rasc, LongReal decl, + LongReal &azimuth, LongReal &altitude); + + /** Get the sun's position in the sky in, relative to the horizon. + * @param jday Astronomical time as julian day. + * @param longitude Observer longitude + * @param latitude Observer latitude + * @param azimuth Astronomical azimuth, measured clockwise from North = 0. + * @param altitude Astronomical altitude, elevation above the horizon. + */ + static void getHorizontalSunPosition ( + LongReal jday, + LongReal longitude, LongReal latitude, + LongReal &azimuth, LongReal &altitude); + + static void getHorizontalSunPosition ( + LongReal jday, + Ogre::Degree longitude, Ogre::Degree latitude, + Ogre::Degree &azimuth, Ogre::Degree &altitude); + + /// Gets the moon position at a specific time in ecliptic coordinates + /// @param lon: Ecliptic longitude, in radians. + /// @param lat: Ecliptic latitude, in radians. + static void getEclipticMoonPositionRad ( + LongReal jday, + LongReal &lon, + LongReal &lat); + + static void getHorizontalMoonPosition ( + LongReal jday, + LongReal longitude, LongReal latitude, + LongReal &azimuth, LongReal &altitude); + static void getHorizontalMoonPosition ( + LongReal jday, + Ogre::Degree longitude, Ogre::Degree latitude, + Ogre::Degree &azimuth, Ogre::Degree &altitude); + + /** Get astronomical julian day from normal gregorian calendar. + * From wikipedia: the integer number of days that have elapsed + * since the initial epoch defined as + * noon Universal Time (UT) Monday, January 1, 4713 BC + * @note this is the time at noon, not midnight. + */ + static int getJulianDayFromGregorianDate ( + int year, int month, int day); + + /** Get astronomical julian day from normal gregorian calendar. + * Calculate julian day from a day in the normal gregorian calendar. + * Time should be given as UTC. + * @see http://en.wikipedia.org/wiki/Julian_day + */ + static LongReal getJulianDayFromGregorianDateTime ( + int year, int month, int day, + int hour, int minute, LongReal second); + + /** Get astronomical julian day from normal gregorian calendar. + * @see above (I don't know the proper doxygen syntax). + */ + static LongReal getJulianDayFromGregorianDateTime ( + int year, int month, int day, + LongReal secondsFromMidnight); + + /// Get gregorian date from integer julian day. + static void getGregorianDateFromJulianDay ( + int julianDay, int &year, int &month, int &day); + + /// Get gregorian date time from floating point julian day. + static void getGregorianDateTimeFromJulianDay ( + LongReal julianDay, int &year, int &month, int &day, + int &hour, int &minute, LongReal &second); + + /// Get gregorian date from floating point julian day. + static void getGregorianDateFromJulianDay ( + LongReal julianDay, int &year, int &month, int &day); + + /** Enter high-precission floating-point mode. + * + * By default Direct3D decreases the precission of ALL floating + * point calculations, enough to stop Caelum's astronomy routines + * from working correctly. + * + * To trigger this behaviour in a standard ogre demo select the + * Direct3D render system and set "Floating-point mode" to + * "Fastest". Otherwise it's not a problem. + * + * It can be fixed by changing the precission only inside caelum's + * astronomy routines using the _controlfp function. This only works + * for MSVC on WIN32; This is a no-op on other compilers. + * + * @note: Must be paired with restoreFloatingPointMode. + * @return Value to pass to restoreFloatingModeMode. + */ + static int enterHighPrecissionFloatingPointMode (); + + /** Restore old floating point precission. + * @see enterHighPrecissionFloatingPointMode. + */ + static void restoreFloatingPointMode (int oldMode); + }; +} + +#endif // SOLARSYSTEMMODEL_H Deleted: trunk/python-ogre/ThirdParty/caelum/BrightStarCatalogue.cpp =================================================================== --- trunk/python-ogre/ThirdParty/caelum/BrightStarCatalogue.cpp 2008-07-30 04:14:17 UTC (rev 680) +++ trunk/python-ogre/ThirdParty/caelum/BrightStarCatalogue.cpp 2008-08-01 03:24:34 UTC (rev 681) @@ -1,9140 +0,0 @@ -/* -This file is part of Caelum. -See http://www.ogre3d.org/wiki/index.php/Caelum - -Copyright (c) 2008 Caelum team. See Contributors.txt for details. - -Caelum is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Caelum is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with Caelum. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "CaelumPrecompiled.h" -#include "PointStarfield.h" - -// Data from http://heasarc.gsfc.nasa.gov/W3Browse/star-catalog/bsc5p.html -// Converted using the following MSVS regexps: -// ^\|0*{:d+} 0*{:d+} 0*{[0-9.]+}\|{[+\-]}0*{:d+} 0*{:d+} 0*{[0-9.]+}\|{.*}\|$ -// { \(2,1), \(2,2), \(5,3), \4\(2,5), \(2,6), \(4,7),\(5, 8) }, -const caelum::BrightStarCatalogueEntry caelum::BrightStarCatalogue[BrightStarCatalogueSize] = { - { 21, 8, 46.20, -88, 57, 23.0, 5.47 }, - { 22, 45, 28.61, -88, 49, 5.9, 6.57 }, - { 15, 28, 19.10, -88, 7, 59.2, 6.48 }, - { 18, 54, 46.90, -87, 36, 20.9, 5.28 }, - { 17, 15, 59.30, -87, 33, 59.0, 6.57 }, - { 23, 28, 3.70, -87, 28, 55.9, 5.49 }, - { 6, 46, 58.70, -87, 1, 30.0, 6.47 }, - { 17, 0, 58.49, -86, 21, 51.8, 6.04 }, - { 12, 25, 37.49, -86, 9, 2.2, 6.33 }, - { 22, 31, 37.39, -85, 58, 1.9, 5.77 }, - { 13, 40, 55.49, -85, 47, 10.0, 5.58 }, - { 8, 56, 41.09, -85, 39, 47.2, 5.42 }, - { 12, 2, 20.11, -85, 37, 54.1, 6.05 }, - { 3, 42, 32.11, -85, 15, 43.9, 6.41 }, - { 18, 1, 34.10, -85, 12, 52.9, 6.45 }, - { 12, 54, 58.61, -85, 7, 23.9, 5.46 }, - { 0, 13, 19.39, -84, 59, 39.1, 5.77 }, - { 21, 32, 4.20, -84, 48, 36.0, 6.45 }, - { 15, 11, 8.30, -84, 47, 15.0, 5.91 }, - { 5, 30, 13.90, -84, 47, 6.0, 6.20 }, - { 1, 37, 28.01, -84, 46, 10.9, 5.69 }, - { 10, 59, 13.80, -84, 35, 38.0, 6.19 }, - { 15, 43, 16.80, -84, 27, 55.1, 5.57 }, - { 14, 26, 54.89, -83, 40, 4.1, 4.32 }, - { 18, 51, 57.89, -83, 18, 59.0, 7.16 }, - { 20, 24, 54.41, -83, 18, 38.2, 6.17 }, - { 16, 45, 53.59, -83, 14, 20.0, 6.57 }, - { 15, 1, 50.81, -83, 13, 40.1, 5.65 }, - { 11, 41, 1.20, -83, 6, .0, 6.33 }, - { 15, 4, 46.70, -83, 2, 17.9, 5.65 }, - { 1, 37, 55.61, -82, 58, 30.0, 5.87 }, - { 4, 22, 50.90, -82, 53, 57.1, 6.76 }, - { 14, 24, 23.30, -82, 50, 55.0, 6.42 }, - { 21, 50, 54.31, -82, 43, 9.1, 5.29 }, - { 21, 33, 54.41, -82, 40, 59.2, 6.38 }, - { 13, 55, 38.71, -82, 39, 58.0, 5.95 }, - { 4, 58, 50.90, -82, 28, 14.2, 5.85 }, - { 0, 10, 2.09, -82, 13, 26.0, 5.28 }, - { 10, 0, 43.70, -82, 12, 52.9, 5.52 }, - { 23, 57, 32.71, -82, 10, 12.0, 5.73 }, - { 23, 52, 6.41, -82, 1, 8.0, 5.11 }, - { 10, 31, 51.00, -81, 55, 16.0, 7.07 }, - { 18, 42, 14.09, -81, 48, 28.1, 6.27 }, - { 4, 20, 57.89, -81, 34, 48.0, 5.79 }, - { 10, 4, 7.61, -81, 33, 56.9, 6.60 }, - { 10, 59, 12.91, -81, 33, 22.0, 6.71 }, - { 5, 12, 25.70, -81, 32, 30.1, 6.51 }, - { 18, 5, 26.69, -81, 29, 11.0, 6.35 }, - { 22, 46, 3.31, -81, 22, 54.1, 4.15 }, - { 19, 56, 1.51, -81, 20, 58.9, 6.39 }, - { 20, 38, 18.60, -81, 17, 20.0, 5.91 }, - { 14, 18, 13.80, -81, 0, 28.1, 4.91 }, - { 20, 33, 17.50, -80, 57, 54.0, 5.77 }, - { 9, 33, 53.21, -80, 56, 29.0, 5.11 }, - { 8, 24, 19.80, -80, 54, 51.1, 5.69 }, - { 23, 12, 12.00, -80, 54, 46.1, 6.41 }, - { 17, 31, 27.29, -80, 51, 33.1, 5.88 }, - { 6, 40, 2.71, -80, 48, 49.0, 5.64 }, - { 9, 24, 9.10, -80, 47, 12.8, 5.36 }, - { 10, 45, 46.80, -80, 32, 25.1, 4.45 }, - { 10, 45, 15.70, -80, 28, 10.9, 5.47 }, - { 5, 37, 9.79, -80, 28, 9.1, 5.65 }, - { 22, 20, 1.51, -80, 26, 22.9, 5.10 }, - { 18, 29, 19.49, -80, 13, 58.1, 5.95 }, - { 4, 17, 59.09, -80, 12, 50.0, 5.69 }, - { 1, 47, 46.51, -80, 10, 36.1, 6.06 }, - { 22, 50, 22.90, -80, 7, 27.1, 5.35 }, - { 14, 22, 22.70, -80, 6, 32.0, 5.06 }, - { 21, 33, 20.59, -80, 2, 21.1, 6.47 }, - { 10, 41, 51.29, -79, 46, 59.9, 5.97 }, - { 11, 18, 34.30, -79, 40, 7.0, 6.35 }, - { 10, 52, 27.50, -79, 33, 33.8, 6.33 }, - { 8, 45, 55.20, -79, 30, 15.8, 5.79 }, - { 23, 8, 23.71, -79, 28, 50.9, 6.12 }, - { 23, 19, 8.11, -79, 28, 22.1, 6.33 }, - { 21, 38, 56.21, -79, 26, 33.0, 6.18 }, - { 6, 56, 34.39, -79, 25, 13.1, 5.45 }, - { 5, 50, 16.70, -79, 21, 41.0, 5.47 }, - { 12, 18, 20.69, -79, 18, 43.9, 4.26 }, - { 11, 42, 55.39, -79, 18, 23.0, 6.39 }, - { 1, 41, 21.31, -79, 8, 53.9, 6.33 }, - { 2, 31, 40.51, -79, 6, 33.8, 5.28 }, - { 7, 25, 37.99, -79, 5, 39.1, 5.53 }, - { 8, 43, 12.41, -79, 4, 10.9, 6.05 }, - { 14, 47, 51.60, -79, 2, 40.9, 3.83 }, - { 3, 7, 31.99, -78, 59, 21.8, 5.57 }, - { 8, 41, 19.51, -78, 57, 47.9, 5.47 }, - { 16, 33, 27.00, -78, 53, 49.9, 3.89 }, - { 5, 35, 36.31, -78, 49, 14.9, 6.05 }, - { 23, 44, 40.70, -78, 47, 29.0, 5.75 }, - { 0, 16, 49.01, -78, 46, 50.2, 6.77 }, - { 22, 35, 26.40, -78, 46, 18.1, 6.15 }, - { 16, 20, 20.81, -78, 41, 44.9, 4.68 }, - { 16, 20, 26.81, -78, 40, 1.9, 5.27 }, - { 10, 35, 28.10, -78, 36, 28.1, 4.11 }, - { 14, 0, 32.81, -78, 35, 24.0, 6.09 }, - { 12, 13, 55.70, -78, 34, 25.0, 6.35 }, - { 1, 33, 39.19, -78, 30, 16.9, 6.11 }, - { 13, 14, 17.21, -78, 26, 49.9, 5.85 }, - { 3, 29, 58.80, -78, 21, 6.8, 5.70 }, - { 1, 55, 50.50, -78, 20, 53.9, 6.16 }, - { 3, 36, 30.00, -78, 19, 23.2, 6.29 }, - { 5, 0, 13.20, -78, 18, 1.1, 6.29 }, - { 11, 59, 37.30, -78, 13, 18.8, 4.91 }, - { 15, 39, 18.29, -77, 55, 5.2, 6.18 }, - { 18, 47, 49.39, -77, 52, 1.9, 6.39 }, - { 14, 16, 54.89, -77, 39, 50.0, 6.47 }, - { 22, 1, 52.10, -77, 39, 45.0, 6.41 }, - { 4, 38, 21.70, -77, 39, 22.0, 6.05 }, - { 7, 36, 4.20, -77, 38, 3.1, 6.18 }, - { 11, 21, 57.10, -77, 36, 29.9, 6.43 }, - { 13, 33, 14.81, -77, 34, 5.9, 6.48 }, - { 16, 43, 4.61, -77, 31, 3.0, 4.24 }, - { 22, 17, 50.50, -77, 30, 42.1, 5.51 }, - { 8, 20, 38.50, -77, 29, 3.8, 4.35 }, - { 0, 21, 28.61, -77, 25, 36.8, 5.97 }, - { 21, 41, 28.49, -77, 23, 24.0, 3.76 }, - { 3, 15, 57.60, -77, 23, 17.9, 5.52 }, - { 23, 33, 19.49, -77, 23, 7.1, 5.81 }, - { 0, 25, 45.10, -77, 15, 15.1, 2.80 }, - { 15, 0, 11.81, -77, 9, 37.1, 5.93 }, - { 0, 1, 35.71, -77, 3, 56.9, 4.78 }, - { 22, 49, 40.90, -77, 3, 2.2, 6.73 }, - { 21, 4, 43.01, -77, 1, 26.0, 5.15 }, - { 8, 18, 31.61, -76, 55, 10.9, 4.07 }, - { 23, 38, 24.10, -76, 52, 12.0, 6.00 }, - { 14, 5, 19.80, -76, 47, 48.1, 5.50 }, - { 9, 46, 20.59, -76, 46, 34.0, 5.45 }, - { 14, 29, 36.79, -76, 43, 45.1, 6.07 }, - { 9, 12, 12.31, -76, 39, 47.2, 6.14 }, - { 14, 57, 52.90, -76, 39, 46.1, 5.34 }, - { 12, 4, 46.51, -76, 31, 9.1, 5.04 }, - { 5, 31, 52.90, -76, 20, 28.0, 5.19 }, - { 10, 35, 24.79, -76, 18, 33.1, 6.30 }, - { 21, 8, 47.90, -76, 12, 45.0, 6.58 }, - { 20, 42, 2.90, -76, 10, 50.2, 6.00 }, - { 17, 57, 41.81, -76, 10, 39.0, 6.07 }, - { 22, 3, 3.79, -76, 7, 7.0, 5.95 }, - { 22, 11, 55.30, -76, 6, 58.0, 6.15 }, - { 15, 41, 54.60, -76, 4, 54.8, 5.95 }, - { 0, 15, 55.20, -75, 54, 41.0, 6.49 }, - { 11, 37, 15.60, -75, 53, 48.1, 5.65 }, - { 18, 11, 15.70, -75, 53, 29.0, 5.86 }, - { 22, 10, 42.50, -75, 52, 50.2, 6.55 }, - { 13, 39, 11.90, -75, 41, 2.0, 6.34 }, - { 12, 39, 14.50, -75, 22, 9.8, 6.49 }, - { 12, 7, 49.80, -75, 22, .8, 5.18 }, - { 20, 41, 43.70, -75, 21, 2.2, 6.55 }, - { 21, 18, 16.10, -75, 20, 48.1, 6.63 }, - { 11, 19, 36.29, -75, 8, 33.0, 6.27 }, - { 10, 57, 15.70, -75, 5, 58.9, 6.13 }, - { 2, 50, 28.51, -75, 4, .8, 4.75 }, - { 18, 23, 36.10, -75, 2, 39.1, 5.47 }, - { 14, 59, 55.99, -75, 1, 57.0, 6.20 }, - { 22, 25, 51.00, -75, 0, 56.2, 6.04 }, - { 4, 55, 11.21, -74, 56, 12.8, 5.47 }, - { 0, 48, 35.40, -74, 55, 23.9, 5.07 }, - { 9, 17, 25.39, -74, 53, 39.8, 5.29 }, - { 13, 25, 7.10, -74, 53, 16.1, 5.05 }, - { 14, 8, 27.10, -74, 51, 1.1, 6.02 }, - { 6, 10, 14.40, -74, 45, 11.2, 5.09 }, - { 9, 17, 27.41, -74, 44, 4.9, 5.86 }, - { 13, 27, 18.29, -74, 41, 30.8, 6.63 }, - { 17, 16, 35.59, -74, 31, 59.2, 6.25 }, - { 10, 39, 16.61, -74, 29, 37.0, 6.07 }, - { 7, 35, 21.79, -74, 16, 32.2, 7.26 }, - { 7, 35, 21.70, -74, 16, 32.2, 7.16 }, - { 3, 47, 14.30, -74, 14, 20.0, 3.24 }, - { 12, 3, 44.30, -74, 12, 50.0, 6.44 }, - { 10, 24, 23.71, -74, 1, 54.1, 4.00 }, - { 10, 24, 44.30, -73, 58, 18.1, 6.19 }, - { 18, 32, 55.30, -73, 57, 56.2, 5.89 }, - { 5, 34, 44.69, -73, 44, 29.0, 5.78 }, - { 18, 12, 34.49, -73, 40, 18.1, 5.85 }, - { 2, 22, 52.30, -73, 38, 44.9, 5.01 }, - { 23, 8, 35.69, -73, 35, 11.0, 6.15 }, - { 15, 40, 21.19, -73, 26, 48.1, 5.65 }, - { 8, 22, 4.39, -73, 24, .0, 5.29 }, - { 15, 31, 30.79, -73, 23, 21.8, 5.49 }, - { 8, 32, 42.19, -73, 21, 24.1, 6.12 }, - { 7, 59, 16.10, -73, 14, 40.9, 6.34 }, - { 0, 10, 38.59, -73, 13, 27.8, 6.64 }, - { 10, 31, 1.99, -73, 13, 18.1, 4.93 }, - { 14, 53, 13.70, -73, 11, 24.0, 5.60 }, - { 21, 9, 22.30, -73, 10, 23.2, 5.68 }, - { 0, 38, 40.80, -73, 8, 13.9, 6.85 }, - { 6, 43, 36.79, -73, 7, 5.2, 6.37 }, - { 9, 31, 36.29, -73, 4, 50.9, 5.47 }, - { 5, 6, 9.29, -73, 2, 16.1, 6.27 }, - { 12, 32, 10.01, -73, 0, 6.1, 5.88 }, - { 18, 49, 43.49, -72, 59, 40.9, 6.06 }, - { 20, 0, 35.50, -72, 54, 38.2, 3.96 }, - { 0, 4, 30.70, -72, 53, 52.1, 7.31 }, - { 15, 12, 33.79, -72, 46, 13.1, 6.01 }, - { 5, 47, 48.10, -72, 42, 7.9, 6.53 }, - { 12, 16, 23.50, -72, 36, 52.9, 6.22 }, - { 7, 41, 49.20, -72, 36, 22.0, 3.95 }, - { 9, 5, 8.81, -72, 36, 10.1, 4.48 }, - { 8, 49, 50.30, -72, 33, 2.9, 6.11 }, - { 21, 11, 20.69, -72, 32, 39.1, 6.20 }, - { 19, 49, 25.30, -72, 30, 11.9, 5.41 }, - { 11, 28, 18.19, -72, 28, 27.8, 6.09 }, - { 10, 44, 26.50, -72, 26, 38.0, 6.27 }, - { 4, 53, 5.50, -72, 24, 27.0, 6.28 }, - { 16, 5, 55.80, -72, 24, 2.9, 5.70 }, - { 11, 24, 11.09, -72, 15, 24.1, 5.59 }, - { 22, 24, 36.79, -72, 15, 20.2, 5.29 }, - { 17, 44, 19.70, -72, 13, 14.9, 6.49 }, - { 12, 56, 31.51, -72, 11, 7.1, 5.93 }, - { 13, 22, 52.61, -72, 8, 48.1, 6.05 }, - { 12, 32, 28.01, -72, 7, 59.2, 3.87 }, - { 0, 24, 5.80, -72, 4, 52.0, }, - { 13, 19, 18.91, -72, 2, 8.2, 6.04 }, - { 11, 20, 3.91, -71, 59, 39.8, 6.41 }, - { 10, 30, 20.11, -71, 59, 35.2, 4.74 }, - { 12, 49, 44.90, -71, 59, 11.0, 5.55 }, - { 15, 7, 8.71, -71, 54, 19.1, 6.52 }, - { 3, 2, 15.41, -71, 54, 9.0, 5.53 }, - { 21, 25, 18.10, -71, 47, 57.8, 6.09 }, - { 6, 40, 57.79, -71, 46, 32.2, 6.51 }, - { 6, 15, 5.90, -71, 42, 10.1, 6.64 }, - { 9, 27, 6.41, -71, 36, 7.9, 5.47 }, - { 13, 2, 16.20, -71, 32, 56.0, 3.62 }, - { 8, 19, 49.01, -71, 30, 54.0, 5.37 }, - { 8, 20, .70, -71, 30, 19.1, 5.65 }, - { 12, 2, 28.61, -71, 29, 20.0, 6.42 }, - { 13, 3, 5.21, -71, 28, 34.0, 6.03 }, - { 0, 4, 41.30, -71, 26, 12.8, 5.59 }, - { 11, 11, 29.50, -71, 26, 11.0, 6.35 }, - { 18, 43, 2.11, -71, 25, 41.2, 4.01 }, - { 9, 56, 9.70, -71, 23, 21.8, 6.35 }, - { 5, 2, 43.01, -71, 18, 51.8, 5.31 }, - { 0, 33, 23.30, -71, 15, 58.0, 6.13 }, - { 21, 45, 28.80, -71, 0, 32.0, 6.01 }, - { 16, 34, 19.30, -70, 59, 17.2, 5.50 }, - { 6, 51, 27.00, -70, 57, 47.9, 5.40 }, - { 4, 43, 3.91, -70, 55, 52.0, 5.54 }, - { 11, 6, 49.90, -70, 52, 41.2, 5.57 }, - { 10, 44, 19.39, -70, 51, 36.0, 6.26 }, - { 10, 44, 32.09, -70, 51, 18.0, 6.46 }, - { 13, 40, .60, -70, 47, 17.9, 6.59 }, - { 18, 14, 24.10, -70, 45, 5.0, 6.73 }, - { 17, 12, 19.80, -70, 43, 16.0, 6.22 }, - { 10, 53, 42.00, -70, 43, 13.1, 5.99 }, - { 13, 25, 50.11, -70, 37, 39.0, 5.67 }, - { 9, 5, 38.30, -70, 32, 20.0, 4.71 }, - { 7, 8, 44.90, -70, 29, 56.0, 3.78 }, - { 7, 8, 42.19, -70, 29, 49.9, 5.69 }, - { 23, 44, 25.39, -70, 29, 25.1, 6.07 }, - { 13, 38, 45.70, -70, 26, 42.0, 6.10 }, - { 6, 44, 56.09, -70, 26, 2.0, 6.11 }, - { 22, 25, 10.51, -70, 25, 54.1, 5.78 }, - { 8, 39, 5.21, -70, 23, 12.8, 5.20 }, - { 22, 49, 17.40, -70, 20, 52.1, 6.34 }, - { 14, 10, 30.91, -70, 18, 20.2, 6.05 }, - { 15, 40, 11.50, -70, 13, 40.1, 6.44 }, - { 11, 49, 56.59, -70, 13, 32.9, 4.97 }, - { 12, 12, 46.80, -70, 9, 6.8, 6.17 }, - { 21, 13, 20.50, -70, 7, 35.0, 5.02 }, - { 17, 22, 5.90, -70, 7, 23.9, 5.41 }, - { 8, 27, 16.90, -70, 5, 35.9, 5.53 }, - { 16, 28, 28.10, -70, 5, 3.8, 4.91 }, - { 15, 14, 19.10, -70, 4, 45.8, 5.81 }, - { 22, 54, 39.41, -70, 4, 25.0, 6.05 }, - { 17, 20, 12.79, -70, 2, 44.2, 6.53 }, - { 10, 13, 44.21, -70, 2, 17.2, 3.32 }, - { 6, 22, 38.21, -69, 59, 3.1, 5.56 }, - { 13, 11, 51.60, -69, 56, 30.8, 5.91 }, - { 7, 44, 13.01, -69, 49, 17.0, 6.18 }, - { 21, 24, 16.70, -69, 44, 3.1, 6.41 }, - { 14, 11, 1.90, -69, 43, 10.9, 6.06 }, - { 9, 13, 12.00, -69, 43, 1.9, 1.68 }, - { 6, 25, 28.61, -69, 41, 25.1, 5.38 }, - { 13, 15, 25.70, -69, 40, 46.9, 6.37 }, - { 21, 50, 47.11, -69, 37, 45.8, 5.53 }, - { 13, 28, 46.39, -69, 37, 41.2, 6.20 }, - { 0, 20, 39.00, -69, 37, 30.0, 5.51 }, - { 3, 24, 2.50, -69, 37, 28.9, 6.15 }, - { 20, 35, 51.70, -69, 36, 40.0, 6.11 }, - { 0, 55, .31, -69, 31, 36.8, 5.45 }, - { 21, 28, 44.90, -69, 30, 19.1, 5.34 }, - { 0, 52, 24.29, -69, 30, 15.8, 6.22 }, - { 12, 42, 5.11, -69, 24, 27.0, 6.33 }, - { 13, 51, 47.40, -69, 24, 5.0, 5.75 }, - { 3, 25, 36.19, -69, 20, 11.0, 5.96 }, - { 16, 59, 33.79, -69, 16, 5.9, 5.79 }, - { 3, 7, 49.20, -69, 15, 56.2, 6.15 }, - { 12, 2, 37.70, -69, 11, 31.9, 5.89 }, - { 19, 16, 28.49, -69, 11, 26.2, 6.27 }, - { 19, 58, 41.30, -69, 9, 50.0, 5.75 }, - { 12, 37, 10.99, -69, 8, 8.2, 2.69 }, - { 9, 56, 59.69, -69, 6, 6.8, 6.20 }, - { 16, 48, 39.89, -69, 1, 40.1, 1.92 }, - { 1, 15, 46.10, -68, 52, 34.0, 4.86 }, - { 6, 8, 44.21, -68, 50, 35.9, 5.06 }, - { 7, 6, 14.09, -68, 50, 13.9, 6.47 }, - { 12, 45, 1.70, -68, 49, 52.0, 6.16 }, - { 23, 4, 52.20, -68, 49, 13.1, 5.52 }, - { 20, 49, 18.10, -68, 46, 35.0, 5.41 }, - { 19, 58, 52.99, -68, 45, 43.9, 6.39 }, - { 19, 3, 29.69, -68, 45, 19.1, 5.88 }, - { 9, 17, 17.21, -68, 41, 21.8, 5.39 }, - { 9, 1, 8.50, -68, 41, 2.0, 5.88 }, - { 10, 9, 30.50, -68, 40, 59.9, 5.81 }, - { 15, 18, 54.60, -68, 40, 45.8, 2.89 }, - { 2, 21, 44.90, -68, 39, 33.8, 4.09 }, - { 12, 6, 19.80, -68, 39, 2.9, 6.23 }, - { 5, 27, .00, -68, 37, 22.1, 6.03 }, - { 8, 7, 55.80, -68, 37, 1.9, 4.35 }, - { 15, 55, 29.59, -68, 36, 11.2, 5.09 }, - { 19, 31, 10.90, -68, 26, 2.0, 5.96 }, - { 19, 9, 52.70, -68, 25, 28.9, 5.33 }, - { 23, 47, 23.30, -68, 23, 39.1, 6.89 }, - { 19, 24, 5.40, -68, 22, 16.0, 6.34 }, - { 12, 4, 38.71, -68, 19, 45.1, 5.35 }, - { 15, 26, 14.69, -68, 18, 33.1, 5.89 }, - { 12, 22, 11.90, -68, 18, 27.0, 5.74 }, - { 16, 41, 23.30, -68, 17, 46.0, 5.91 }, - { 2, 39, 35.40, -68, 16, .8, 4.11 }, - { 18, 18, .91, -68, 13, 45.1, 6.33 }, - { 8, 43, 54.31, -68, 12, 42.1, 6.32 }, - { 21, 1, 28.10, -68, 12, 34.9, 6.37 }, - { 14, 25, 6.29, -68, 11, 43.1, 5.61 }, - { 12, 46, 16.90, -68, 6, 29.2, 3.05 }, - { 12, 17, 34.10, -67, 57, 38.9, 4.11 }, - { 7, 16, 49.80, -67, 57, 25.9, 3.98 }, - { 16, 17, 5.50, -67, 56, 29.0, 5.75 }, - { 14, 37, 46.30, -67, 55, 55.9, 6.04 }, - { 6, 59, 50.50, -67, 54, 58.0, 5.17 }, - { 13, 15, 14.90, -67, 53, 39.8, 4.80 }, - { 2, 14, 14.69, -67, 50, 30.1, 5.55 }, - { 11, 17, 19.01, -67, 49, 25.0, 6.06 }, - { 17, 21, 59.40, -67, 46, 14.2, 4.78 }, - { 2, 15, 28.51, -67, 44, 47.0, 5.69 }, - { 14, 31, 16.51, -67, 43, 1.9, 5.83 }, - { 16, 52, 17.40, -67, 40, 54.8, 6.32 }, - { 13, 54, 48.91, -67, 39, 9.0, 5.71 }, - { 1, 54, 56.09, -67, 38, 49.9, 4.69 }, - { 12, 23, 13.80, -67, 37, 54.1, 6.36 }, - { 11, 37, 48.41, -67, 37, 13.1, 5.96 }, - { 2, 45, 32.59, -67, 37, .1, 4.84 }, - { 12, 22, 7.30, -67, 31, 18.8, 5.15 }, - { 22, 28, 37.70, -67, 29, 21.1, 5.55 }, - { 15, 20, 40.70, -67, 28, 53.0, 6.28 }, - { 23, 18, 19.99, -67, 28, 16.0, 6.13 }, - { 16, 43, 22.10, -67, 25, 57.0, 6.03 }, - { 20, 5, 32.81, -67, 19, 14.9, 6.07 }, - { 18, 56, 57.00, -67, 14, 1.0, 4.44 }, - { 17, 13, 17.50, -67, 11, 48.1, 5.89 }, - { 12, 38, 52.51, -67, 11, 35.2, 6.25 }, - { 5, 13, 45.41, -67, 11, 7.1, 4.83 }, - { 16, 46, 40.01, -67, 6, 34.9, 5.13 }, - { 15, 9, 29.90, -67, 5, 3.1, 5.76 }, - { 9, 17, 51.70, -67, 3, 2.9, 6.11 }, - { 10, 30, 8.71, -66, 59, 6.0, 6.19 }, - { 11, 32, 19.90, -66, 57, 43.9, 5.90 }, - { 20, 0, 22.99, -66, 56, 57.8, 5.76 }, - { 20, 1, 52.39, -66, 56, 39.1, 5.31 }, - { 3, 17, 58.99, -66, 55, 36.8, 6.05 }, - { 10, 22, 58.10, -66, 54, 6.1, 4.99 }, - { 5, 49, 53.59, -66, 54, 4.0, 5.11 }, - { 23, 10, 11.69, -66, 51, 27.0, 6.47 }, - { 11, 48, 14.30, -66, 48, 52.9, 4.72 }, - { 19, 49, 53.30, -66, 48, 46.1, 6.45 }, - { 8, 50, 34.80, -66, 47, 35.2, 5.35 }, - { 13, 17, 13.01, -66, 47, 1.0, 4.87 }, - { 20, 41, 57.10, -66, 45, 38.9, 5.15 }, - { 11, 45, 36.41, -66, 43, 43.0, 3.64 }, - { 9, 31, 32.90, -66, 43, 9.8, 6.27 }, - { 2, 43, 26.59, -66, 42, 51.8, 6.26 }, - { 9, 28, 30.60, -66, 42, 6.8, 5.91 }, - { 19, 39, 52.10, -66, 41, 8.2, 6.39 }, - { 4, 53, 30.50, -66, 40, 32.2, 6.41 }, - { 19, 17, 12.00, -66, 39, 41.0, 5.53 }, - { 19, 0, 3.50, -66, 39, 11.9, 6.01 }, - { 14, 48, 44.40, -66, 35, 38.0, 5.91 }, - { 14, 16, 38.59, -66, 35, 16.1, 5.75 }, - { 23, 27, 7.20, -66, 34, 52.0, 6.45 }, - { 5, 36, 54.70, -66, 33, 37.1, 6.31 }, - { 12, 39, 55.61, -66, 30, 42.1, 6.26 }, - { 2, 25, 26.30, -66, 29, 40.9, 6.41 }, - { 3, 30, 51.60, -66, 29, 22.9, 5.83 }, - { 1, 17, 3.60, -66, 23, 53.2, 6.24 }, - { 9, 2, 26.81, -66, 23, 46.0, 4.00 }, - { 10, 13, 30.60, -66, 22, 23.2, 5.16 }, - { 20, 8, 20.50, -66, 21, 16.9, 6.45 }, - { 15, 36, 43.20, -66, 19, .8, 4.11 }, - { 14, 0, 52.20, -66, 16, 7.0, 5.97 }, - { 13, 12, 48.91, -66, 13, 36.8, 5.90 }, - { 20, 44, 57.50, -66, 12, 11.2, 3.42 }, - { 7, 49, 40.99, -66, 11, 44.9, 5.79 }, - { 20, 8, 43.61, -66, 10, 54.8, 3.56 }, - { 14, 25, 39.50, -66, 10, 23.9, 6.36 }, - { 8, 25, 44.21, -66, 8, 12.8, 3.77 }, - { 7, 44, 43.90, -66, 4, 18.8, 6.38 }, - { 1, 59, 41.09, -66, 3, 59.0, 6.10 }, - { 6, 6, 9.41, -66, 2, 22.9, 5.71 }, - { 14, 54, 42.41, -65, 59, 29.0, 6.09 }, - { 19, 41, 37.49, -65, 51, 15.1, 6.09 }, - { 12, 20, 28.01, -65, 50, 34.1, 6.21 }, - { 8, 44, 30.00, -65, 49, 32.2, 6.05 }, - { 14, 27, 7.10, -65, 49, 18.1, 5.85 }, - { 10, 8, 42.60, -65, 48, 55.1, 5.28 }, - { 13, 58, 31.20, -65, 48, 2.2, 6.20 }, - { 12, 25, 17.30, -65, 46, 14.2, 6.30 }, - { 3, 34, 24.70, -65, 45, 51.8, 6.75 }, - { 5, 44, 46.39, -65, 44, 8.2, 4.35 }, - { 12, 6, 23.11, -65, 42, 33.1, 6.06 }, - { 10, 27, 25.30, -65, 42, 16.9, 6.01 }, - { 12, 17, 6.00, -65, 41, 34.1, 6.06 }, - { 13, 33, 35.69, -65, 37, 57.0, 6.37 }, - { 8, 18, 18.91, -65, 36, 47.9, 5.07 }, - { 15, 36, 17.40, -65, 36, 47.9, 6.51 }, - { 19, 51, 1.30, -65, 36, 18.0, 6.05 }, - { 6, 11, 15.00, -65, 35, 21.8, 5.01 }, - { 23, 59, 55.01, -65, 34, 37.9, 4.50 }, - { 6, 30, 3.00, -65, 34, 5.9, 6.29 }, - { 12, 5, 53.21, -65, 32, 49.9, 6.33 }, - { 16, 35, 44.81, -65, 29, 43.1, 5.52 }, - { 17, 53, 18.41, -65, 29, 21.1, 6.49 }, - { 0, 42, 28.39, -65, 28, 5.2, 5.39 }, - { 1, 2, 42.91, -65, 27, 22.0, 6.21 }, - { 15, 47, 53.71, -65, 26, 33.0, 6.39 }, - { 15, 47, 53.59, -65, 26, 33.0, 6.18 }, - { 1, 57, 53.59, -65, 25, 28.9, 6.37 }, - { 11, 39, 29.40, -65, 23, 52.1, 5.17 }, - { 16, 51, 53.90, -65, 22, 32.2, 6.13 }, - { 21, 26, 26.59, -65, 21, 58.0, 4.22 }, - { 13, 8, 7.01, -65, 18, 23.0, 5.51 }, - { 15, 7, 56.81, -65, 16, 32.2, 6.17 }, - { 11, 51, 51.19, -65, 12, 22.0, 4.90 }, - { 15, 52, 56.71, -65, 9, 9.0, 6.54 }, - { 13, 16, 44.81, -65, 8, 17.9, 6.07 }, - { 0, 36, 37.39, -65, 7, 28.9, 6.42 }, - { 10, 40, 11.30, -65, 6, 2.2, 5.52 }, - { 18, 48, 37.80, -65, 4, 40.1, 5.73 }, - { 9, 47, 6.70, -65, 4, 21.0, 6.26 }, - { 9, 47, 6.10, -65, 4, 18.8, 3.01 }, - { 15, 58, 58.10, -65, 2, 16.1, 5.75 }, - { 14, 42, 30.41, -64, 58, 31.1, 3.19 }, - { 22, 27, 19.99, -64, 57, 59.0, 4.48 }, - { 11, 23, 21.79, -64, 57, 18.0, 5.11 }, - { 9, 36, 5.11, -64, 57, 2.2, 6.56 }, - { 9, 26, 44.21, -64, 55, 46.9, 6.05 }, - { 0, 20, 4.30, -64, 52, 28.9, 4.23 }, - { 18, 45, 26.90, -64, 52, 17.0, 4.79 }, - { 11, 6, 24.19, -64, 50, 22.9, 6.41 }, - { 21, 38, 2.90, -64, 49, 27.1, 6.20 }, - { 3, 44, 12.00, -64, 48, 24.8, 3.85 }, - { 17, 45, 43.99, -64, 43, 26.0, 3.62 }, - { 21, 50, .10, -64, 42, 45.0, 5.62 }, - { 23, 35, 12.70, -64, 41, 21.8, 7.40 }, - { 21, 18, .31, -64, 40, 54.1, 6.31 }, - { 10, 19, 4.80, -64, 40, 35.0, 5.67 }, - { 13, 29, 7.61, -64, 40, 32.9, 6.11 }, - { 18, 42, 22.51, -64, 38, 35.2, 6.37 }, - { 12, 6, 52.90, -64, 36, 49.0, 4.15 }, - { 8, 25, 51.60, -64, 36, 2.9, 5.97 }, - { 11, 19, 16.51, -64, 34, 57.0, 5.99 }, - { 13, 40, 10.90, -64, 34, 36.8, 5.79 }, - { 18, 43, 37.20, -64, 33, 4.0, 5.78 }, - { 18, 7, 48.31, -64, 33, .0, 6.41 }, - { 13, 24, .50, -64, 32, 8.9, 4.53 }, - { 15, 27, 33.10, -64, 31, 53.0, 5.71 }, - { 10, 46, 16.51, -64, 30, 54.0, 5.34 }, - { 7, 28, 51.31, -64, 30, 36.0, 6.39 }, - { 9, 6, 7.61, -64, 29, 58.9, 6.37 }, - { 9, 57, 15.19, -64, 29, 21.8, 6.58 }, - { 13, 25, 13.90, -64, 29, 7.1, 5.31 }, - { 5, 54, 11.90, -64, 28, 55.9, 6.63 }, - { 10, 42, 13.99, -64, 27, 59.0, 4.82 }, - { 2, 54, 20.90, -64, 26, 8.2, 6.56 }, - { 12, 14, 16.80, -64, 24, 31.0, 6.22 }, - { 23, 44, 12.00, -64, 24, 15.8, 5.72 }, - { 10, 42, 57.41, -64, 23, 39.8, 2.76 }, - { 10, 46, 51.19, -64, 22, 59.9, 4.85 }, - { 1, 25, 5.30, -64, 22, 9.8, 5.93 }, - { 12, 28, 18.91, -64, 20, 29.0, 6.04 }, - { 11, 58, 47.69, -64, 20, 21.1, 5.61 }, - { 2, 28, 4.39, -64, 17, 58.9, 6.37 }, - { 23, 57, 35.21, -64, 17, 53.9, 5.00 }, - { 2, 39, 31.70, -64, 16, 54.8, 6.55 }, - { 10, 46, 29.69, -64, 15, 47.9, 5.23 }, - { 10, 43, 51.19, -64, 14, 56.0, 5.77 }, - { 5, 32, 59.59, -64, 13, 39.0, 5.34 }, - { 4, 7, 21.60, -64, 13, 21.0, 6.38 }, - { 10, 28, 52.61, -64, 10, 19.9, 5.29 }, - { 11, 12, 45.19, -64, 10, 10.9, 5.23 }, - { 8, 21, 7.70, -64, 6, 22.0, 6.12 }, - { 2, 58, 47.81, -64, 4, 17.0, 4.99 }, - { 16, 27, 57.31, -64, 3, 29.2, 5.27 }, - { 5, 51, 22.99, -64, 2, 1.0, 6.36 }, - { 15, 4, 48.19, -64, 1, 54.1, 5.17 }, - { 12, 18, 26.09, -64, 0, 11.2, 4.04 }, - { 11, 25, 43.20, -63, 58, 22.1, 5.17 }, - { 10, 44, 6.89, -63, 57, 40.0, 4.82 }, - { 21, 8, 32.90, -63, 55, 44.0, 5.76 }, - { 5, 30, 15.91, -63, 55, 40.1, 6.19 }, - { 18, 19, 40.20, -63, 53, 12.8, 6.18 }, - { 6, 24, 55.61, -63, 49, 40.1, 6.27 }, - { 14, 52, 34.99, -63, 48, 36.0, 5.87 }, - { 8, 8, 24.50, -63, 48, 4.0, 6.28 }, - { 12, 27, 24.60, -63, 47, 21.1, 6.00 }, - { 11, 49, 41.09, -63, 47, 17.9, 4.32 }, - { 16, 1, 10.70, -63, 46, 36.1, 6.41 }, - { 2, 45, 27.50, -63, 42, 15.8, 5.74 }, - { 18, 14, 16.20, -63, 41, 21.8, 6.47 }, - { 13, 57, 38.90, -63, 41, 12.1, 4.71 }, - { 16, 15, 26.30, -63, 41, 8.2, 3.85 }, - { 6, 23, 1.30, -63, 40, 59.2, 6.27 }, - { 18, 8, 34.80, -63, 40, 5.9, 4.35 }, - { 15, 9, 25.49, -63, 38, 34.1, 6.28 }, - { 15, 17, 38.90, -63, 36, 38.2, 4.86 }, - { 8, 0, 19.99, -63, 34, 3.0, 4.82 }, - { 12, 31, 55.80, -63, 30, 22.0, 5.95 }, - { 3, 56, 4.01, -63, 27, 49.0, 6.14 }, - { 15, 55, 8.50, -63, 25, 50.2, 2.85 }, - { 6, 24, 26.30, -63, 25, 44.0, 6.46 }, - { 20, 14, 26.90, -63, 24, 56.9, 6.09 }, - { 5, 7, 34.01, -63, 23, 58.9, 5.20 }, - { 4, 21, 53.30, -63, 23, 11.0, 5.24 }, - { 12, 3, 1.51, -63, 18, 46.1, 4.33 }, - { 13, 11, 53.11, -63, 18, 10.1, 6.33 }, - { 7, 57, 12.50, -63, 17, 48.8, 6.14 }, - { 11, 54, 59.81, -63, 16, 44.0, 5.91 }, - { 16, 55, 24.70, -63, 16, 10.9, 6.02 }, - { 4, 17, 40.20, -63, 15, 20.2, 5.87 }, - { 20, 19, 3.00, -63, 13, 52.0, 6.27 }, - { 4, 44, 57.89, -63, 13, 46.9, 6.46 }, - { 14, 8, 14.30, -63, 12, 29.2, 6.40 }, - { 7, 12, 1.99, -63, 11, 24.0, 6.02 }, - { 22, 52, 9.91, -63, 11, 19.0, 6.12 }, - { 12, 4, 19.20, -63, 9, 56.2, 4.72 }, - { 16, 25, 22.01, -63, 7, 28.9, 6.15 }, - { 12, 26, 30.91, -63, 7, 21.0, 4.86 }, - { 23, 29, 1.01, -63, 6, 38.9, 5.68 }, - { 12, 26, 36.50, -63, 5, 57.8, 1.73 }, - { 12, 26, 35.90, -63, 5, 57.1, 1.33 }, - { 5, 54, 6.10, -63, 5, 24.0, 4.65 }, - { 12, 42, 50.30, -63, 3, 31.0, 5.31 }, - { 18, 15, 40.90, -63, 3, 20.2, 5.60 }, - { 17, 28, 7.70, -63, 2, 11.0, 6.24 }, - { 0, 32, 43.80, -63, 1, 52.0, 5.09 }, - { 18, 25, 31.51, -63, 1, 17.0, 6.14 }, - { 11, 35, 46.80, -63, 1, 10.9, 3.13 }, - { 0, 31, 33.60, -62, 57, 56.9, 4.54 }, - { 0, 31, 32.71, -62, 57, 29.2, 4.37 }, - { 23, 57, 19.90, -62, 57, 23.0, 5.97 }, - { 12, 12, 22.01, -62, 57, 2.9, 5.92 }, - { 3, 29, 22.70, -62, 56, 15.0, 4.72 }, - { 8, 15, 15.91, -62, 54, 56.9, 5.16 }, - { 2, 52, 19.20, -62, 54, 34.9, 6.03 }, - { 20, 39, 51.41, -62, 54, 28.1, 6.22 }, - { 11, 43, 52.90, -62, 52, 41.9, 6.10 }, - { 14, 45, 17.30, -62, 52, 32.9, 5.36 }, - { 0, 53, 37.90, -62, 52, 17.0, 5.70 }, - { 17, 24, 1.10, -62, 51, 51.1, 5.70 }, - { 8, 37, 18.79, -62, 51, 13.0, 5.47 }, - { 23, 49, 44.69, -62, 50, 21.8, 6.59 }, - { 8, 4, 42.89, -62, 50, 10.0, 6.30 }, - { 4, 33, 34.01, -62, 49, 25.0, 5.79 }, - { 2, 49, 1.49, -62, 48, 24.1, 5.26 }, - { 18, 56, 54.70, -62, 48, 4.0, 6.48 }, - { 9, 32, 14.59, -62, 47, 20.0, 6.10 }, - { 14, 56, 43.99, -62, 46, 50.9, 5.11 }, - { 9, 50, 55.70, -62, 44, 43.1, 5.57 }, - { 23, 14, 6.60, -62, 42, .0, 6.12 }, - { 11, 50, 27.19, -62, 38, 57.8, 5.70 }, - { 15, 53, 22.80, -62, 36, 24.8, 6.19 }, - { 13, 47, 10.70, -62, 35, 24.0, 6.51 }, - { 2, 33, 33.60, -62, 35, 12.8, 6.77 }, - { 3, 17, 46.20, -62, 34, 31.1, 5.54 }, - { 16, 2, 52.39, -62, 32, 30.1, 6.25 }, - { 4, 27, 45.91, -62, 31, 14.9, 5.75 }, - { 9, 45, 14.81, -62, 30, 28.1, 3.69 }, - { 3, 18, 12.89, -62, 30, 23.0, 5.24 }, - { 0, 44, 32.30, -62, 29, 52.1, 6.07 }, - { 5, 33, 37.49, -62, 29, 22.9, 3.76 }, - { 11, 43, 31.20, -62, 29, 21.8, 5.03 }, - { 4, 14, 25.51, -62, 28, 26.0, 3.35 }, - { 11, 57, 40.10, -62, 26, 56.0, 5.57 }, - { 20, 51, 38.30, -62, 25, 45.1, 6.28 }, - { 20, 51, 38.81, -62, 25, 45.1, 6.59 }, - { 11, 6, 32.40, -62, 25, 27.1, 4.61 }, - { 9, 20, 56.81, -62, 24, 16.9, 4.81 }, - { 9, 11, 16.61, -62, 19, 1.9, 3.97 }, - { 5, 29, 17.40, -62, 18, 51.8, 6.59 }, - { 18, 31, 22.39, -62, 16, 41.9, 4.64 }, - { 9, 28, 46.99, -62, 16, 23.2, 5.92 }, - { 4, 14, 48.70, -62, 11, 30.8, 5.45 }, - { 18, 52, 13.01, -62, 11, 15.0, 4.22 }, - { 4, 0, 53.81, -62, 9, 33.8, 4.51 }, - { 10, 2, 49.39, -62, 9, 23.0, 6.42 }, - { 6, 7, 3.41, -62, 9, 16.9, 5.05 }, - { 11, 40, 53.59, -62, 5, 24.0, 4.94 }, - { 4, 36, 45.60, -62, 4, 39.0, 5.40 }, - { 18, 10, 26.11, -62, 0, 7.9, 5.49 }, - { 23, 16, 57.70, -62, 0, 4.0, 5.66 }, - { 22, 33, .10, -61, 58, 55.9, 4.81 }, - { 9, 25, 27.10, -61, 57, 1.1, 5.77 }, - { 11, 8, 34.01, -61, 56, 49.9, 5.13 }, - { 6, 48, 11.40, -61, 56, 29.0, 3.27 }, - { 21, 55, 11.50, -61, 53, 11.0, 5.90 }, - { 10, 3, 34.30, -61, 53, 2.0, 6.14 }, - { 6, 31, 10.61, -61, 52, 46.9, 6.15 }, - { 12, 35, 28.99, -61, 50, 30.8, 6.22 }, - { 10, 54, 29.59, -61, 49, 36.1, 5.93 }, - { 11, 38, 7.30, -61, 49, 35.0, 5.15 }, - { 12, 28, 25.49, -61, 47, 43.1, 6.22 }, - { 1, 7, 18.70, -61, 46, 31.1, 5.37 }, - { 15, 13, 1.01, -61, 44, 38.0, 6.32 }, - { 13, 37, 12.19, -61, 41, 30.8, 5.63 }, - { 10, 32, 1.39, -61, 41, 7.1, 3.32 }, - { 22, 48, 21.41, -61, 41, 3.1, 6.37 }, - { 17, 10, 6.29, -61, 40, 32.2, 6.39 }, - { 10, 13, 21.19, -61, 39, 32.0, 6.41 }, - { 9, 24, 5.69, -61, 38, 56.0, 5.99 }, - { 16, 30, 49.39, -61, 38, 1.0, 5.20 }, - { 1, 58, 46.20, -61, 34, 10.9, 2.86 }, - { 10, 9, 21.89, -61, 32, 57.1, 5.60 }, - { 6, 38, .60, -61, 31, 59.2, 6.18 }, - { 20, 37, 35.30, -61, 31, 48.0, 4.88 }, - { 18, 23, 13.61, -61, 29, 38.0, 4.36 }, - { 14, 0, 17.30, -61, 28, 53.0, 6.49 }, - { 15, 10, 44.59, -61, 25, 21.0, 6.30 }, - { 3, 58, 44.69, -61, 24, 1.1, 4.56 }, - { 10, 30, 39.19, -61, 21, 22.0, 6.43 }, - { 10, 17, 4.99, -61, 19, 55.9, 3.40 }, - { 9, 39, 21.00, -61, 19, 41.2, 4.52 }, - { 10, 59, 13.99, -61, 19, 13.1, 6.16 }, - { 8, 9, .70, -61, 18, 9.0, 4.76 }, - { 11, 37, .60, -61, 16, 59.9, 5.15 }, - { 11, 31, 15.00, -61, 16, 41.9, 6.38 }, - { 12, 11, 4.90, -61, 16, 39.0, 6.08 }, - { 14, 19, 51.50, -61, 16, 23.2, 5.23 }, - { 4, 25, 5.30, -61, 14, 17.9, 5.94 }, - { 11, 46, 30.79, -61, 10, 41.9, 4.11 }, - { 5, 34, 57.60, -61, 10, 32.9, 6.32 }, - { 19, 54, 40.39, -61, 10, 14.9, 6.24 }, - { 11, 26, 35.30, -61, 6, 55.1, 5.30 }, - { 18, 45, 11.50, -61, 5, 42.0, 6.04 }, - { 4, 1, 18.19, -61, 4, 44.0, 4.97 }, - { 19, 50, 21.70, -61, 3, 41.0, 6.21 }, - { 11, 36, 22.30, -61, 3, 7.9, 5.83 }, - { 3, 32, 51.60, -61, 1, .8, 6.41 }, - { 16, 38, 52.70, -60, 59, 25.1, 6.18 }, - { 13, 22, 37.90, -60, 59, 17.9, 4.53 }, - { 10, 34, 12.91, -60, 59, 16.1, 6.23 }, - { 12, 45, 37.90, -60, 58, 52.0, 4.69 }, - { 13, 22, 35.69, -60, 58, 19.9, 6.18 }, - { 12, 4, 57.10, -60, 58, 9.1, 5.96 }, - { 9, 0, 45.70, -60, 57, 50.0, 5.79 }, - { 15, 16, 56.71, -60, 57, 27.0, 5.09 }, - { 4, 16, 21.10, -60, 56, 55.0, 6.37 }, - { 15, 16, 36.41, -60, 54, 14.0, 5.73 }, - { 1, 55, 46.39, -60, 51, 41.0, 6.06 }, - { 12, 8, 24.60, -60, 50, 49.9, 6.22 }, - { 14, 39, 36.10, -60, 50, 8.2, 1.33 }, - { 14, 39, 35.90, -60, 50, 7.1,-0.01 }, - { 7, 58, 50.50, -60, 49, 27.8, 5.81 }, - { 1, 41, 48.00, -60, 47, 21.8, 5.71 }, - { 15, 54, 52.61, -60, 44, 35.9, 6.15 }, - { 0, 58, 22.39, -60, 41, 47.0, 6.23 }, - { 17, 31, 5.90, -60, 41, 2.0, 3.62 }, - { 17, 24, 18.70, -60, 40, 25.0, 5.77 }, - { 15, 23, 10.39, -60, 39, 24.8, 5.67 }, - { 8, 55, 2.81, -60, 38, 40.9, 3.84 }, - { 10, 46, 16.80, -60, 36, 11.9, 6.25 }, - { 7, 59, 37.61, -60, 35, 12.8, 5.17 }, - { 20, 35, 34.80, -60, 34, 54.1, 4.76 }, - { 10, 43, 32.09, -60, 34, .1, 4.57 }, - { 20, 40, 2.59, -60, 32, 56.0, 5.12 }, - { 7, 56, 18.60, -60, 31, 35.0, 5.74 }, - { 10, 55, 17.21, -60, 31, .8, 5.92 }, - { 22, 44, 16.51, -60, 29, 57.8, 6.30 }, - { 15, 18, 48.91, -60, 29, 47.0, 5.46 }, - { 15, 56, 6.00, -60, 28, 58.1, 5.76 }, - { 16, 40, 50.50, -60, 26, 46.0, 6.18 }, - { 10, 2, .00, -60, 25, 14.9, 5.94 }, - { 12, 21, 21.60, -60, 24, 4.0, 3.59 }, - { 12, 50, 12.00, -60, 24, 2.9, 6.75 }, - { 12, 53, 49.10, -60, 22, 36.8, 5.90 }, - { 14, 3, 49.39, -60, 22, 23.2, 0.61 }, - { 8, 53, 48.70, -60, 21, 15.1, 5.78 }, - { 12, 51, 17.81, -60, 19, 46.9, 5.72 }, - { 12, 53, 21.79, -60, 19, 43.0, 5.76 }, - { 11, 12, 36.00, -60, 19, 3.0, 4.60 }, - { 8, 39, 13.20, -60, 19, 1.9, 6.36 }, - { 2, 24, 53.90, -60, 18, 42.8, 5.35 }, - { 7, 57, 46.90, -60, 18, 11.9, 5.60 }, - { 9, 23, 27.41, -60, 18, 9.0, 6.30 }, - { 15, 43, 55.10, -60, 17, 13.9, 6.48 }, - { 7, 49, 12.89, -60, 17, 1.0, 5.78 }, - { 6, 24, 13.70, -60, 16, 52.0, 5.80 }, - { 0, 42, 41.81, -60, 15, 45.0, 5.98 }, - { 22, 18, 30.10, -60, 15, 34.9, 2.86 }, - { 6, 50, 1.10, -60, 14, 57.1, 6.11 }, - { 7, 59, 40.20, -60, 12, 27.0, 6.33 }, - { 18, 58, 36.41, -60, 12, 2.2, 5.14 }, - { 10, 2, 59.90, -60, 10, 43.0, 6.19 }, - { 15, 55, 32.30, -60, 10, 40.1, 5.77 }, - { 17, 51, 35.50, -60, 9, 51.8, 5.78 }, - { 14, 55, 34.61, -60, 6, 51.1, 5.20 }, - { 6, 2, 9.19, -60, 5, 48.8, 6.45 }, - { 23, 22, 56.90, -60, 3, 20.9, 6.09 }, - { 7, 49, 54.79, -60, 3, 4.0, 6.72 }, - { 14, 35, 17.21, -60, 0, 56.9, 6.40 }, - { 13, 12, 17.40, -59, 55, 14.9, 4.60 }, - { 10, 48, 5.40, -59, 55, 9.1, 6.00 }, - { 10, 13, 1.30, -59, 55, 5.2, 6.10 }, - { 14, 16, 34.20, -59, 54, 50.0, 6.39 }, - { 15, 39, 56.50, -59, 54, 29.9, 5.95 }, - { 10, 16, 3.10, -59, 54, 11.9, 6.22 }, - { 22, 51, 44.90, -59, 52, 53.0, 6.46 }, - { 13, 7, 24.19, -59, 51, 38.2, 5.99 }, - { 17, 35, 34.90, -59, 50, 46.0, 6.28 }, - { 13, 12, 55.99, -59, 49, .1, 6.16 }, - { 13, 20, 34.90, -59, 46, 23.9, 6.18 }, - { 8, 40, 37.01, -59, 45, 40.0, 4.33 }, - { 3, 3, 36.79, -59, 44, 16.1, 5.11 }, - { 4, 44, 21.10, -59, 43, 58.1, 5.27 }, - { 10, 57, 48.41, -59, 43, 54.8, 6.11 }, - { 14, 6, 25.10, -59, 42, 56.2, 6.42 }, - { 17, 19, 12.41, -59, 41, 39.8, 5.91 }, - { 12, 47, 43.20, -59, 41, 19.0, 1.25 }, - { 12, 41, 56.59, -59, 41, 8.9, 4.93 }, - { 10, 45, 3.60, -59, 41, 3.1, 6.21 }, - { 10, 41, 17.59, -59, 40, 36.8, 6.42 }, - { 22, 5, 50.90, -59, 38, 10.0, 5.62 }, - { 11, 13, 30.79, -59, 37, 9.8, 5.74 }, - { 10, 36, 20.30, -59, 33, 52.9, 5.08 }, - { 11, 31, 48.79, -59, 30, 56.9, 5.15 }, - { 8, 22, 30.79, -59, 30, 34.9, 1.86 }, - { 0, 40, 26.40, -59, 27, 15.8, 5.89 }, - { 11, 31, 46.10, -59, 26, 31.9, 5.13 }, - { 9, 51, 12.10, -59, 25, 32.9, 5.79 }, - { 12, 31, 40.30, -59, 25, 26.0, 5.48 }, - { 9, 12, 55.61, -59, 24, 51.8, 5.54 }, - { 20, 1, 44.69, -59, 22, 34.0, 5.13 }, - { 6, 52, 45.41, -59, 20, 28.0, 6.41 }, - { 10, 49, 24.10, -59, 19, 25.0, 5.91 }, - { 15, 23, 22.70, -59, 19, 14.9, 4.51 }, - { 4, 16, 28.90, -59, 18, 6.8, 4.44 }, - { 14, 8, 56.30, -59, 16, 36.1, 6.34 }, - { 9, 17, 5.40, -59, 16, 31.1, 2.25 }, - { 9, 34, 26.71, -59, 13, 45.8, 4.08 }, - { 8, 56, 58.39, -59, 13, 45.8, 4.92 }, - { 10, 42, 40.61, -59, 12, 56.9, 5.38 }, - { 6, 16, 18.50, -59, 12, 49.0, 6.43 }, - { 14, 28, 43.49, -59, 11, 52.1, 6.45 }, - { 19, 50, 44.81, -59, 11, 35.2, 5.42 }, - { 10, 38, 45.10, -59, 10, 59.2, 4.66 }, - { 7, 3, 15.60, -59, 10, 41.2, 5.50 }, - { 8, 17, 55.80, -59, 10, .8, 6.42 }, - { 12, 54, 39.19, -59, 8, 48.1, 4.62 }, - { 7, 56, 50.71, -59, 7, 35.0, 6.25 }, - { 13, 14, 14.81, -59, 6, 11.9, 4.92 }, - { 8, 59, 24.10, -59, 5, 1.0, 5.16 }, - { 16, 49, 47.09, -59, 2, 29.0, 3.76 }, - { 18, 9, 57.60, -59, 2, 24.0, 6.38 }, - { 21, 58, 30.10, -59, 0, 43.9, 6.12 }, - { 12, 27, 28.70, -58, 59, 30.8, 5.50 }, - { 11, 8, 35.40, -58, 58, 30.0, 3.91 }, - { 9, 10, 58.01, -58, 58, .8, 3.44 }, - { 17, 1, 47.40, -58, 57, 29.9, 6.11 }, - { 4, 40, 18.29, -58, 56, 37.0, 6.53 }, - { 7, 1, 5.09, -58, 56, 24.0, 6.02 }, - { 5, 26, 19.30, -58, 54, 45.0, 5.14 }, - { 12, 43, 28.20, -58, 54, 11.2, 6.40 }, - { 19, 57, 6.19, -58, 54, 5.0, 5.26 }, - { 5, 35, 2.40, -58, 52, 16.0, 6.75 }, - { 10, 53, 29.59, -58, 51, 11.9, 3.78 }, - { 10, 11, 35.21, -58, 49, 41.2, 6.40 }, - { 10, 38, 59.40, -58, 49, .8, 5.92 }, - { 15, 17, 30.79, -58, 48, 4.0, 4.07 }, - { 9, 45, 55.39, -58, 47, 39.1, 6.22 }, - { 13, 42, 1.10, -58, 47, 13.9, 5.38 }, - { 6, 31, 58.39, -58, 45, 15.1, 5.70 }, - { 12, 15, 8.71, -58, 44, 56.0, 2.80 }, - { 10, 27, 52.70, -58, 44, 21.8, 3.82 }, - { 10, 37, 26.81, -58, 43, 59.9, 5.45 }, - { 8, 45, 5.30, -58, 43, 30.0, 6.21 }, - { 18, 33, 29.50, -58, 42, 33.1, 6.44 }, - { 13, 14, 12.10, -58, 41, 2.0, 5.89 }, - { 11, 6, 29.30, -58, 40, 31.1, 6.02 }, - { 10, 32, 47.59, -58, 40, .8, 6.00 }, - { 7, 42, 10.20, -58, 37, 50.9, 6.43 }, - { 14, 41, 55.70, -58, 36, 58.0, 6.22 }, - { 16, 28, 15.19, -58, 35, 58.9, 5.69 }, - { 10, 24, 59.40, -58, 34, 35.0, 5.95 }, - { 4, 54, 52.99, -58, 32, 49.9, 6.12 }, - { 6, 23, 46.90, -58, 32, 38.0, 6.48 }, - { 16, 46, 21.19, -58, 30, 13.0, 5.74 }, - { 14, 44, 55.49, -58, 28, 40.1, 6.11 }, - { 23, 27, 15.00, -58, 28, 34.0, 5.63 }, - { 14, 22, 37.01, -58, 27, 33.8, 4.92 }, - { 11, 10, 54.70, -58, 27, 19.1, 6.88 }, - { 20, 54, 48.60, -58, 27, 15.1, 3.65 }, - { 12, 54, 22.01, -58, 25, 50.2, 6.58 }, - { 13, 38, 7.61, -58, 24, 54.0, 6.42 }, - { 9, 15, 17.50, -58, 23, 19.0, 6.02 }, - { 9, 30, 23.40, -58, 21, 42.1, 5.88 }, - { 16, 47, 19.51, -58, 20, 29.0, 5.58 }, - { 1, 36, 44.81, -58, 16, 14.9, 6.18 }, - { 8, 54, 54.00, -58, 14, 24.0, 6.38 }, - { 23, 17, 25.80, -58, 14, 8.9, 3.99 }, - { 7, 42, 53.30, -58, 13, 48.0, 6.21 }, - { 8, 35, 15.41, -58, 13, 30.0, 5.26 }, - { 10, 33, 25.30, -58, 11, 25.1, 6.14 }, - { 1, 35, 15.19, -58, 8, 21.8, 6.01 }, - { 10, 11, 46.51, -58, 3, 38.2, 5.72 }, - { 17, 22, 55.01, -58, 0, 37.1, 5.88 }, - { 8, 35, 19.61, -58, 0, 33.1, 4.86 }, - { 6, 27, 4.01, -58, 0, 7.9, 5.82 }, - { 9, 40, 42.50, -57, 59, 1.0, 5.32 }, - { 19, 38, 25.90, -57, 58, 59.9, 6.18 }, - { 8, 21, 12.00, -57, 58, 23.2, 5.97 }, - { 10, 23, 50.90, -57, 57, 14.0, 6.35 }, - { 16, 9, 18.60, -57, 56, 3.8, 5.57 }, - { 19, 56, 57.70, -57, 55, 32.2, 6.53 }, - { 16, 15, 49.70, -57, 54, 43.9, 5.63 }, - { 16, 54, .50, -57, 54, 33.8, 5.94 }, - { 16, 18, 51.89, -57, 53, 58.9, 6.49 }, - { 21, 56, 13.99, -57, 53, 57.8, 6.19 }, - { 22, 35, 52.90, -57, 53, 1.0, 6.23 }, - { 9, 4, 48.00, -57, 51, 9.0, 6.44 }, - { 22, 24, 56.40, -57, 47, 49.9, 5.32 }, - { 16, 3, 31.90, -57, 46, 31.1, 4.63 }, - { 16, 29, 45.00, -57, 45, 20.9, 6.06 }, - { 17, 4, 24.70, -57, 42, 43.9, 5.73 }, - { 11, 47, 19.10, -57, 41, 47.0, 5.41 }, - { 1, 10, 7.39, -57, 41, 39.8, 6.41 }, - { 12, 22, 49.30, -57, 40, 34.0, 5.39 }, - { 10, 27, 24.41, -57, 38, 20.0, 4.66 }, - { 8, 51, 36.60, -57, 38, 1.0, 5.59 }, - { 13, 38, 49.10, -57, 37, 23.2, 6.01 }, - { 9, 15, 34.99, -57, 34, 41.2, 6.32 }, - { 10, 35, 35.30, -57, 33, 28.1, 4.45 }, - { 17, 44, 55.80, -57, 32, 43.1, 6.01 }, - { 8, 40, 43.61, -57, 32, 43.1, 6.34 }, - { 9, 16, 12.19, -57, 32, 29.0, 4.34 }, - { 20, 11, 7.20, -57, 31, 26.0, 6.37 }, - { 18, 29, 56.69, -57, 31, 23.2, 5.76 }, - { 22, 20, 36.19, -57, 30, 36.0, 6.34 }, - { 12, 1, 28.99, -57, 30, 13.0, 6.16 }, - { 5, 5, 30.60, -57, 28, 22.1, 4.72 }, - { 10, 47, 38.71, -57, 28, 4.1, 6.36 }, - { 0, 43, 21.19, -57, 27, 47.2, 4.36 }, - { 22, 40, 48.89, -57, 25, 19.9, 5.97 }, - { 11, 54, 11.50, -57, 24, 36.0, 6.06 }, - { 10, 1, 58.01, -57, 20, 58.9, 6.20 }, - { 3, 12, 33.19, -57, 19, 18.1, 5.74 }, - { 7, 54, 53.21, -57, 18, 11.2, 5.63 }, - { 9, 41, 2.21, -57, 15, 34.9, 5.80 }, - { 10, 38, 2.50, -57, 15, 23.0, 5.91 }, - { 10, 52, 30.91, -57, 14, 26.2, 5.25 }, - { 1, 37, 42.89, -57, 14, 12.1, 0.46 }, - { 9, 45, 40.49, -57, 11, 8.2, 6.46 }, - { 12, 54, 35.59, -57, 10, 40.1, 4.03 }, - { 12, 54, 36.79, -57, 10, 5.9, 5.17 }, - { 5, 52, 20.30, -57, 9, 22.0, 5.94 }, - { 12, 31, 9.89, -57, 6, 47.9, 1.63 }, - { 3, 58, 42.89, -57, 6, 9.0, 6.05 }, - { 14, 14, 57.00, -57, 5, 8.9, 5.07 }, - { 12, 31, 16.70, -57, 4, 52.0, 6.42 }, - { 4, 24, 12.19, -57, 4, 17.0, 6.29 }, - { 9, 31, 13.30, -57, 2, 3.8, 3.13 }, - { 1, 2, 1.80, -57, 0, 9.0, 6.11 }, - { 11, 52, 10.10, -56, 59, 16.1, 5.57 }, - { 10, 0, 34.39, -56, 56, 48.1, 6.52 }, - { 17, 31, 22.99, -56, 55, 14.2, 5.95 }, - { 17, 14, 13.20, -56, 53, 17.9, 6.09 }, - { 14, 32, 32.90, -56, 53, 16.1, 6.93 }, - { 18, 45, 23.71, -56, 52, 54.1, 6.22 }, - { 6, 29, 28.51, -56, 51, 10.1, 5.22 }, - { 23, 25, 19.39, -56, 50, 57.1, 5.59 }, - { 12, 55, 57.00, -56, 50, 10.0, 5.32 }, - { 22, 3, 21.60, -56, 47, 10.0, 4.69 }, - { 11, 23, 8.11, -56, 46, 45.8, 5.79 }, - { 8, 46, 42.50, -56, 46, 10.9, 4.49 }, - { 13, 42, 56.09, -56, 46, 5.2, 6.00 }, - { 10, 46, 57.50, -56, 45, 25.9, 5.23 }, - { 7, 4, 18.29, -56, 44, 58.9, 5.17 }, - { 20, 25, 38.90, -56, 44, 6.0, 1.94 }, - { 7, 45, 35.59, -56, 43, 21.0, 6.12 }, - { 14, 49, 6.89, -56, 40, 4.1, 6.23 }, - { 8, 53, 3.79, -56, 38, 57.8, 6.03 }, - { 17, 23, 6.89, -56, 31, 31.1, 5.80 }, - { 12, 29, 53.90, -56, 31, 28.9, 5.80 }, - { 0, 41, 46.39, -56, 30, 6.1, 5.70 }, - { 12, 46, 22.70, -56, 29, 20.0, 4.65 }, - { 7, 48, 19.20, -56, 28, 16.0, 6.33 }, - { 14, 40, 32.81, -56, 26, 26.9, 6.30 }, - { 9, 48, 40.01, -56, 24, 42.8, 6.06 }, - { 7, 49, 6.70, -56, 24, 38.2, 5.59 }, - { 12, 28, 33.41, -56, 24, 28.1, 6.15 }, - { 6, 58, 36.19, -56, 23, 40.9, 6.45 }, - { 14, 20, 19.51, -56, 23, 12.1, 4.33 }, - { 17, 25, 23.59, -56, 22, 39.0, 3.34 }, - { 12, 21, 57.50, -56, 22, 28.9, 5.92 }, - { 6, 22, 55.80, -56, 22, 12.0, 5.61 }, - { 19, 48, 1.20, -56, 21, 45.0, 5.35 }, - { 11, 58, 15.19, -56, 19, 1.9, 5.44 }, - { 14, 3, 26.21, -56, 12, 49.0, 5.92 }, - { 1, 39, 47.40, -56, 11, 53.2, 5.87 }, - { 1, 39, 47.81, -56, 11, 40.9, 5.76 }, - { 16, 7, 24.00, -56, 11, 29.0, 6.16 }, - { 12, 43, 9.10, -56, 10, 34.0, 6.00 }, - { 5, 49, 49.70, -56, 10, .1, 4.51 }, - { 5, 22, 22.10, -56, 8, 3.8, 6.11 }, - { 10, 18, 37.61, -56, 6, 36.0, 5.81 }, - { 8, 9, 33.60, -56, 5, 8.2, 5.66 }, - { 10, 20, 54.79, -56, 2, 35.2, 4.50 }, - { 18, 17, 7.49, -56, 1, 23.9, 5.33 }, - { 16, 58, 37.20, -55, 59, 25.1, 3.13 }, - { 12, 42, 49.61, -55, 56, 49.9, 6.08 }, - { 2, 19, 54.29, -55, 56, 40.9, 5.81 }, - { 7, 36, 1.70, -55, 53, 15.0, 6.39 }, - { 22, 0, 24.10, -55, 52, 58.1, 6.01 }, - { 9, 6, 34.01, -55, 48, 11.9, 6.11 }, - { 13, 20, 48.29, -55, 48, 2.2, 6.02 }, - { 8, 42, 20.90, -55, 46, 27.1, 6.29 }, - { 21, 40, 33.60, -55, 44, 15.0, 6.33 }, - { 6, 58, 39.60, -55, 43, 45.8, 6.27 }, - { 19, 8, 52.10, -55, 43, 13.1, 6.49 }, - { 10, 39, 18.41, -55, 36, 11.9, 4.28 }, - { 14, 45, 10.90, -55, 36, 6.8, 6.10 }, - { 9, 14, 18.00, -55, 34, 10.9, 5.27 }, - { 16, 13, 22.61, -55, 32, 26.9, 5.81 }, - { 6, 47, 18.70, -55, 32, 24.0, 5.61 }, - { 17, 25, 18.00, -55, 31, 48.0, 2.85 }, - { 9, 21, 49.99, -55, 30, 54.0, 5.63 }, - { 8, 1, 31.49, -55, 27, 18.0, 6.28 }, - { 19, 29, 52.61, -55, 26, 29.0, 6.13 }, - { 17, 48, 38.11, -55, 24, 6.1, 6.11 }, - { 9, 53, .00, -55, 22, 23.9, 6.48 }, - { 15, 11, 16.01, -55, 20, 46.0, 5.54 }, - { 1, 8, 23.11, -55, 14, 44.9, 3.92 }, - { 9, 41, 47.81, -55, 12, 51.1, 6.00 }, - { 8, 29, 36.31, -55, 11, 28.0, 6.36 }, - { 9, 19, 32.59, -55, 11, 12.1, 6.28 }, - { 17, 28, 38.71, -55, 10, 10.9, 5.94 }, - { 12, 18, 59.69, -55, 8, 35.2, 5.00 }, - { 16, 20, 25.20, -55, 8, 24.0, 5.77 }, - { 19, 30, 34.49, -55, 6, 36.0, 6.30 }, - { 15, 51, 6.79, -55, 3, 20.9, 5.73 }, - { 20, 20, 32.30, -55, 3, 2.9, 6.27 }, - { 4, 33, 59.81, -55, 2, 42.0, 3.27 }, - { 10, 19, 36.79, -55, 1, 45.8, 4.57 }, - { 20, 7, 35.09, -55, 0, 59.0, 6.26 }, - { 8, 27, 27.41, -55, 0, 42.1, 6.53 }, - { 9, 22, 6.79, -55, 0, 38.9, 2.50 }, - { 14, 33, 32.40, -54, 59, 53.9, 5.87 }, - { 21, 57, 55.10, -54, 59, 33.0, 4.40 }, - { 19, 52, 39.00, -54, 58, 36.1, 6.50 }, - { 10, 15, 16.61, -54, 58, 27.1, 6.16 }, - { 19, 52, 37.61, -54, 58, 16.0, 5.74 }, - { 6, 10, 17.90, -54, 58, 7.0, 4.81 }, - { 8, 55, 11.90, -54, 57, 56.2, 5.71 }, - { 12, 53, 3.91, -54, 57, 9.0, 5.93 }, - { 5, 33, 44.40, -54, 54, 7.9, 6.43 }, - { 10, 26, 49.01, -54, 52, 39.0, 5.58 }, - { 0, 35, 33.41, -54, 49, 18.8, 6.06 }, - { 21, 5, 14.21, -54, 43, 37.9, 5.16 }, - { 8, 44, 42.19, -54, 42, 29.9, 1.96 }, - { 13, 56, 33.00, -54, 42, 15.8, 6.00 }, - { 6, 46, 41.50, -54, 41, 40.9, 6.46 }, - { 14, 5, 46.51, -54, 40, 9.8, 6.17 }, - { 21, 26, 15.41, -54, 39, 38.2, 6.12 }, - { 16, 13, 28.70, -54, 37, 50.2, 4.94 }, - { 14, 13, 39.89, -54, 37, 32.9, 6.11 }, - { 17, 0, 6.19, -54, 35, 48.8, 5.65 }, - { 16, 1, 6.41, -54, 34, 40.1, 6.13 }, - { 9, 56, 51.79, -54, 34, 4.1, 3.54 }, - { 13, 41, 44.69, -54, 33, 36.0, 5.01 }, - { 2, 40, 39.60, -54, 33, .0, 5.21 }, - { 8, 1, 22.90, -54, 30, 54.0, 6.10 }, - { 17, 38, 5.59, -54, 30, 1.1, 5.25 }, - { 9, 17, 42.31, -54, 29, 43.1, 6.33 }, - { 11, 21, .41, -54, 29, 28.0, 3.89 }, - { 19, 22, 51.10, -54, 25, 25.0, 5.05 }, - { 19, 40, 18.31, -54, 25, 3.0, 6.26 }, - { 5, 5, .60, -54, 24, 27.0, 6.27 }, - { 7, 30, 30.91, -54, 23, 57.8, 5.96 }, - { 8, 31, 29.59, -54, 23, 39.1, 6.34 }, - { 0, 37, 18.10, -54, 23, 39.1, 6.41 }, - { 7, 52, 29.69, -54, 22, 1.9, 5.70 }, - { 5, 47, 13.01, -54, 21, 38.9, 6.18 }, - { 19, 27, 48.10, -54, 19, 31.1, 5.69 }, - { 3, 44, 33.79, -54, 16, 26.0, 6.30 }, - { 11, 34, 45.70, -54, 15, 51.1, 4.62 }, - { 8, 0, 49.90, -54, 9, 5.0, 5.87 }, - { 13, 56, 19.80, -54, 7, 54.8, 6.14 }, - { 6, 52, 46.90, -54, 5, 24.0, 6.57 }, - { 15, 59, 54.00, -54, 1, 16.0, 6.10 }, - { 0, 9, 2.40, -54, 0, 6.8, 6.33 }, - { 11, 40, 42.60, -53, 58, 7.0, 5.96 }, - { 23, 4, 39.60, -53, 57, 54.0, 5.37 }, - { 9, 43, 42.19, -53, 53, 30.1, 5.56 }, - { 12, 52, 24.60, -53, 49, 45.8, 6.24 }, - { 16, 16, 43.10, -53, 48, 40.0, 5.44 }, - { 23, 23, 54.31, -53, 48, 29.9, 6.15 }, - { 1, 42, 29.30, -53, 44, 26.2, 5.52 }, - { 10, 31, 21.79, -53, 42, 56.2, 4.89 }, - { 0, 45, .00, -53, 42, 54.0, 6.15 }, - { 21, 29, .31, -53, 42, 20.9, 6.39 }, - { 16, 13, 16.80, -53, 40, 18.1, 5.83 }, - { 9, 37, 12.31, -53, 40, 7.0, 5.45 }, - { 14, 13, 16.39, -53, 39, 56.9, 5.56 }, - { 22, 18, 15.60, -53, 37, 40.1, 5.37 }, - { 6, 49, 51.31, -53, 37, 19.9, 4.40 }, - { 17, 50, 28.20, -53, 36, 43.9, 5.92 }, - { 9, 3, 5.21, -53, 32, 58.9, 6.40 }, - { 1, 46, 6.31, -53, 31, 18.8, 5.04 }, - { 14, 15, 21.19, -53, 30, 34.9, 6.39 }, - { 22, 45, 37.90, -53, 30, 1.1, 4.85 }, - { 13, 39, 53.21, -53, 27, 59.0, 2.30 }, - { 4, 50, 55.20, -53, 27, 41.0, 5.61 }, - { 13, 7, 38.30, -53, 27, 34.9, 5.71 }, - { 4, 50, 56.30, -53, 27, 34.9, 6.42 }, - { 21, 19, 52.01, -53, 26, 58.9, 4.39 }, - { 8, 39, 23.81, -53, 26, 22.9, 5.48 }, - { 14, 9, 54.79, -53, 26, 21.1, 4.75 }, - { 1, 38, 48.19, -53, 26, 20.0, 6.84 }, - { 5, 57, 14.40, -53, 25, 34.0, 6.45 }, - { 19, 18, 9.41, -53, 23, 12.1, 6.38 }, - { 9, 26, 18.10, -53, 22, 45.1, 5.11 }, - { 13, 53, 43.10, -53, 22, 25.0, 5.89 }, - { 10, 1, 40.49, -53, 21, 51.8, 6.20 }, - { 17, 35, 19.99, -53, 21, 10.1, 6.10 }, - { 7, 39, .41, -53, 16, 23.9, 6.06 }, - { 21, 15, 45.91, -53, 15, 47.2, 5.75 }, - { 17, 3, 8.81, -53, 14, 12.8, 5.29 }, - { 11, 13, 39.31, -53, 13, 54.1, 5.76 }, - { 8, 32, 4.80, -53, 12, 43.9, 5.69 }, - { 15, 50, 6.89, -53, 12, 33.8, 5.77 }, - { 19, 32, 53.81, -53, 11, 8.9, 5.75 }, - { 14, 23, 48.41, -53, 10, 36.1, 6.00 }, - { 16, 59, 35.11, -53, 9, 38.2, 4.06 }, - { 11, 26, 47.30, -53, 9, 36.0, 5.81 }, - { 16, 44, 39.79, -53, 9, 9.0, 5.96 }, - { 17, 51, 10.99, -53, 7, 50.2, 6.09 }, - { 8, 42, 25.49, -53, 6, 50.0, 4.86 }, - { 8, 5, 4.01, -53, 6, 29.2, 5.53 }, - { 8, 42, 18.91, -53, 6, .0, 5.52 }, - { 8, 38, 44.90, -53, 5, 26.2, 6.47 }, - { 8, 27, 36.50, -53, 5, 19.0, 5.09 }, - { 16, 17, 20.90, -53, 5, 12.1, 6.33 }, - { 8, 39, 57.60, -53, 3, 18.0, 5.19 }, - { 8, 40, 17.40, -53, 0, 55.1, 5.61 }, - { 7, 56, 46.70, -52, 58, 55.9, 3.47 }, - { 6, 34, 58.61, -52, 58, 32.2, 4.39 }, - { 9, 36, 46.30, -52, 56, 39.1, 6.19 }, - { 18, 58, 27.70, -52, 56, 19.0, 4.87 }, - { 8, 40, 17.59, -52, 55, 18.8, 3.62 }, - { 18, 34, 31.20, -52, 53, 30.8, 6.22 }, - { 19, 48, 55.10, -52, 53, 17.2, 6.25 }, - { 20, 7, 23.21, -52, 52, 50.9, 4.94 }, - { 4, 18, 40.01, -52, 51, 36.0, 6.09 }, - { 8, 48, .19, -52, 51, 2.2, 6.30 }, - { 13, 52, 4.80, -52, 48, 42.1, 5.25 }, - { 14, 56, 17.30, -52, 48, 34.9, 5.38 }, - { 8, 26, 25.20, -52, 48, 27.0, 6.05 }, - { 6, 24, 48.19, -52, 48, 23.0, 6.51 }, - { 12, 50, 57.91, -52, 47, 15.0, 5.73 }, - { 5, 50, 28.61, -52, 46, 4.1, 6.35 }, - { 23, 0, 52.80, -52, 45, 15.1, 4.12 }, - { 13, 20, 37.80, -52, 44, 53.2, 5.48 }, - { 23, 58, 55.80, -52, 44, 44.9, 5.13 }, - { 21, 33, 17.71, -52, 44, 15.0, 6.41 }, - { 6, 17, 51.70, -52, 43, 59.2, 6.41 }, - { 8, 56, 19.39, -52, 43, 25.0, 4.69 }, - { 23, 26, 36.60, -52, 43, 18.1, 5.52 }, - { 6, 23, 57.10, -52, 41, 44.9,-0.72 }, - { 22, 39, 8.40, -52, 41, 31.9, 6.65 }, - { 3, 54, 34.01, -52, 41, 26.2, 6.46 }, - { 14, 33, 29.90, -52, 40, 48.0, 5.87 }, - { 7, 29, 59.59, -52, 39, 4.0, 5.87 }, - { 9, 57, 10.90, -52, 38, 20.0, 6.12 }, - { 5, 54, 50.21, -52, 38, 7.1, 5.29 }, - { 7, 55, .50, -52, 34, 59.2, 6.38 }, - { 2, 44, 10.70, -52, 34, 14.2, 6.15 }, - { 13, 10, 58.39, -52, 34, .8, 6.06 }, - { 2, 37, 24.41, -52, 32, 35.2, 5.31 }, - { 7, 35, 39.70, -52, 32, 2.0, 4.94 }, - { 7, 15, 21.00, -52, 29, 58.9, 5.97 }, - { 20, 14, 19.01, -52, 26, 44.2, 5.65 }, - { 15, 48, 50.30, -52, 26, 17.2, 6.07 }, - { 6, 45, 53.69, -52, 24, 36.0, 5.80 }, - { 14, 47, 1.30, -52, 23, 1.0, 5.21 }, - { 0, 34, 27.79, -52, 22, 23.2, 5.57 }, - { 15, 38, 49.51, -52, 22, 22.1, 5.44 }, - { 12, 11, 39.10, -52, 22, 7.0, 3.96 }, - { 21, 39, 59.69, -52, 21, 33.1, 6.21 }, - { 19, 6, 19.90, -52, 20, 26.9, 5.16 }, - { 6, 33, 26.09, -52, 19, 44.0, 6.19 }, - { 5, 24, 46.20, -52, 18, 59.0, 6.27 }, - { 7, 20, 21.41, -52, 18, 42.1, 6.05 }, - { 7, 20, 21.70, -52, 18, 34.9, 6.60 }, - { 17, 27, 57.60, -52, 17, 49.9, 5.75 }, - { 16, 56, 28.70, -52, 17, 2.0, 5.94 }, - { 14, 47, 12.31, -52, 12, 20.2, 6.07 }, - { 6, 45, 26.09, -52, 12, 4.0, 6.57 }, - { 9, 1, 44.59, -52, 11, 17.9, 5.23 }, - { 10, 6, 7.10, -52, 11, 17.2, 6.52 }, - { 13, 22, 16.20, -52, 10, 59.2, 5.83 }, - { 5, 15, 38.90, -52, 10, 54.8, 6.49 }, - { 6, 23, 37.70, -52, 10, 52.0, 5.98 }, - { 10, 12, 22.99, -52, 9, 47.9, 6.16 }, - { 13, 55, 12.19, -52, 9, 40.0, 5.71 }, - { 8, 52, 40.80, -52, 7, 45.1, 6.39 }, - { 8, 22, 55.20, -52, 7, 26.0, 5.85 }, - { 13, 5, 30.79, -52, 6, 54.0, 6.43 }, - { 5, 50, 53.21, -52, 6, 32.0, 5.17 }, - { 18, 52, 39.60, -52, 6, 27.0, 5.17 }, - { 15, 12, 17.09, -52, 5, 57.1, 3.41 }, - { 7, 20, 38.69, -52, 5, 10.0, 5.39 }, - { 5, 13, 53.30, -52, 1, 52.0, 6.05 }, - { 7, 7, 13.30, -51, 58, 4.1, 5.96 }, - { 17, 26, 56.30, -51, 56, 57.1, 6.19 }, - { 18, 53, 12.10, -51, 55, 52.0, 6.31 }, - { 20, 44, 2.30, -51, 55, 16.0, 4.51 }, - { 23, 24, 13.10, -51, 53, 29.0, 5.75 }, - { 17, 44, 8.71, -51, 50, 3.1, 5.15 }, - { 6, 31, 18.29, -51, 49, 34.0, 5.60 }, - { 11, 0, 8.59, -51, 49, 4.1, 6.15 }, - { 10, 8, 56.30, -51, 48, 40.0, 4.86 }, - { 1, 57, .10, -51, 45, 58.0, 6.10 }, - { 10, 13, 28.01, -51, 45, 22.0, 5.78 }, - { 9, 23, 59.50, -51, 44, 13.9, 6.08 }, - { 8, 25, 31.01, -51, 43, 41.2, 5.17 }, - { 11, 59, 10.90, -51, 41, 48.1, 6.05 }, - { 4, 39, 4.30, -51, 40, 22.1, 6.44 }, - { 1, 55, 57.50, -51, 36, 32.0, 3.70 }, - { 20, 51, 30.10, -51, 36, 29.9, 5.05 }, - { 15, 28, 27.19, -51, 35, 51.0, 6.10 }, - { 4, 0, 15.70, -51, 33, 52.9, 6.51 }, - { 9, 18, 42.19, -51, 33, 38.2, 5.87 }, - { 9, 30, 5.21, -51, 31, 1.9, 5.45 }, - { 2, 16, 30.60, -51, 30, 43.9, 3.56 }, - { 14, 9, 34.99, -51, 30, 16.9, 6.00 }, - { 4, 16, 1.61, -51, 29, 12.1, 4.25 }, - { 7, 34, 39.50, -51, 28, 28.9, 6.28 }, - { 12, 26, 31.61, -51, 27, 2.9, 4.82 }, - { 7, 58, 21.41, -51, 26, 55.0, 6.44 }, - { 14, 57, 1.39, -51, 26, 48.8, 6.64 }, - { 13, 46, 39.31, -51, 25, 58.1, 4.65 }, - { 7, 0, 51.50, -51, 24, 9.0, 5.14 }, - { 12, 11, 31.39, -51, 21, 33.8, 6.23 }, - { 9, 56, 21.89, -51, 20, 10.0, 6.37 }, - { 22, 48, 33.31, -51, 19, .8, 3.49 }, - { 13, 18, 34.61, -51, 17, 10.0, 6.19 }, - { 6, 46, 52.80, -51, 15, 56.9, 5.40 }, - { 21, 0, 21.50, -51, 15, 55.1, 5.76 }, - { 9, 34, 8.81, -51, 15, 19.1, 5.01 }, - { 10, 13, 22.80, -51, 13, 59.9, 5.28 }, - { 9, 43, 27.50, -51, 13, 41.9, 6.15 }, - { 6, 0, 49.20, -51, 12, 59.0, 5.67 }, - { 11, 6, 5.81, -51, 12, 45.0, 6.30 }, - { 9, 7, 14.69, -51, 12, 42.8, 6.73 }, - { 10, 16, 40.20, -51, 12, 18.0, 6.30 }, - { 12, 57, 4.39, -51, 11, 55.0, 5.16 }, - { 13, 29, 25.20, -51, 9, 55.1, 5.06 }, - { 9, 53, 50.21, -51, 8, 48.8, 5.93 }, - { 17, 1, 46.10, -51, 7, 50.9, 6.45 }, - { 2, 33, 54.60, -51, 5, 37.0, 6.24 }, - { 2, 22, 54.60, -51, 5, 31.9, 5.92 }, - { 18, 17, .91, -51, 4, 5.9, 6.06 }, - { 5, 47, 17.11, -51, 3, 59.0, 3.85 }, - { 9, 18, 5.81, -51, 3, 4.0, 5.26 }, - { 19, 3, 57.41, -51, 1, 7.0, 5.93 }, - { 7, 26, 21.89, -51, 1, 5.9, 5.10 }, - { 13, 44, 15.91, -51, 0, 47.2, 6.47 }, - { 0, 50, 41.21, -50, 59, 12.8, 5.22 }, - { 8, 35, 52.10, -50, 58, 12.0, 5.80 }, - { 11, 6, 27.41, -50, 57, 24.1, 6.32 }, - { 23, 1, 7.49, -50, 57, .0, 5.68 }, - { 2, 54, 6.50, -50, 52, 17.0, 6.21 }, - { 2, 10, 25.61, -50, 49, 27.8, 6.12 }, - { 1, 46, 5.81, -50, 48, 59.0, 5.49 }, - { 2, 42, 33.50, -50, 48, 1.1, 5.41 }, - { 13, 42, 54.60, -50, 47, 26.2, 6.41 }, - { 14, 23, 20.30, -50, 46, 19.9, 6.02 }, - { 10, 57, 7.90, -50, 45, 54.0, 5.91 }, - { 12, 8, 4.80, -50, 45, 47.9, 6.37 }, - { 20, 54, 34.99, -50, 43, 40.1, 6.24 }, - { 12, 8, 21.50, -50, 43, 21.0, 2.60 }, - { 13, 13, 23.50, -50, 42, .0, 5.89 }, - { 23, 7, 14.69, -50, 41, 11.0, 5.83 }, - { 16, 56, 8.90, -50, 40, 30.0, 6.33 }, - { 12, 8, 5.21, -50, 39, 41.0, 4.47 }, - { 16, 58, 18.00, -50, 38, 28.0, 5.55 }, - { 17, 26, .00, -50, 38, 1.0, 5.23 }, - { 17, 27, 12.41, -50, 37, 49.1, 5.92 }, - { 15, 52, 51.50, -50, 36, 55.1, 6.60 }, - { 6, 49, 56.21, -50, 36, 52.9, 2.93 }, - { 6, 54, 2.30, -50, 36, 42.1, 6.26 }, - { 5, 19, 22.10, -50, 36, 22.0, 5.45 }, - { 8, 4, 42.41, -50, 35, 26.2, 5.95 }, - { 0, 28, 43.10, -50, 31, 58.1, 6.26 }, - { 17, 42, 3.89, -50, 30, 38.2, 6.24 }, - { 7, 50, 23.90, -50, 30, 34.9, 5.91 }, - { 19, 12, 46.10, -50, 29, 11.0, 6.13 }, - { 4, 42, 46.39, -50, 28, 53.0, 5.31 }, - { 14, 32, 36.89, -50, 27, 24.8, 4.42 }, - { 8, 15, 23.30, -50, 26, 57.8, 6.44 }, - { 3, 32, 34.80, -50, 22, 43.0, 5.68 }, - { 13, 59, 17.30, -50, 22, 12.0, 5.91 }, - { 5, 54, 10.70, -50, 21, 42.8, 6.52 }, - { 7, 5, 16.49, -50, 21, 37.1, 6.46 }, - { 6, 18, 46.80, -50, 21, 33.1, 7.04 }, - { 0, 1, 19.99, -50, 20, 13.9, 5.53 }, - { 13, 47, 38.40, -50, 19, 16.0, 5.45 }, - { 23, 20, 49.99, -50, 18, 24.1, 6.05 }, - { 13, 47, 27.60, -50, 14, 57.8, 5.91 }, - { 9, 54, 51.29, -50, 14, 38.0, 5.72 }, - { 6, 29, 49.10, -50, 14, 21.1, 5.27 }, - { 12, 28, 2.40, -50, 13, 50.2, 3.91 }, - { 23, 47, 16.01, -50, 13, 36.1, 5.18 }, - { 1, 50, 54.50, -50, 12, 22.0, 5.94 }, - { 8, 13, 34.10, -50, 11, 46.0, 5.51 }, - { 23, 27, 9.10, -50, 9, 25.9, 6.20 }, - { 16, 19, 50.40, -50, 9, 20.2, 4.02 }, - { 18, 46, 59.09, -50, 5, 39.8, 6.54 }, @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-05 03:02:09
|
Revision: 684 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=684&view=rev Author: andy_miller Date: 2008-08-05 03:02:16 +0000 (Tue, 05 Aug 2008) Log Message: ----------- Further Updates for the PCZ Portal SceneManager Support Also changed paths in the CEGUI package to ensure the right dll's are loaded first Modified Paths: -------------- trunk/python-ogre/code_generators/ogrepcz/generate_code.py trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py trunk/python-ogre/demos/ogrepcz/RoomObject.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/packages_2.5/ogre/gui/CEGUI/__init__.py trunk/python-ogre/packages_2.5/ogre/gui/navi/__init__.py Modified: trunk/python-ogre/code_generators/ogrepcz/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-08-05 03:02:16 UTC (rev 684) @@ -63,18 +63,27 @@ excludes=['::Ogre::PCZSceneManagerFactory::initMetaData', '::Ogre::PCZSceneManagerFactory::createInstance', - '::Ogre::PCZSceneManagerFactory::destroyInstance' + '::Ogre::PCZSceneManagerFactory::destroyInstance', + '::Ogre::Portal::setCorners' # hand wrapped.. ] for e in excludes: main_ns.member_functions(e).exclude() - print "Excluded Member Function:", e + print "Excluded Member Function(s):", e excludes=['::Ogre::PCZSceneManagerFactory::FACTORY_TYPE_NAME' ] for e in excludes: main_ns.variable(e).exclude() print "Excluded Variable:", e - + +# std_ns = global_ns.namespace('std') +# for c in std_ns.classes(): +# if 'map' in c.decl_string or 'Ogre' in c.decl_string: +# print c.name, c.decl_string +# std_ns.class_('::std::vector<Ogre::Plane, std::allocator<Ogre::Plane> >') +# # std_ns.class_('::std::map<std::string, std::allocator<std::string> >') + + ############################################################ ## ## And there are things that manually need to be INCLUDED @@ -93,8 +102,29 @@ # '::Ogre::PCZone::NODE_LIST_TYPE' ] for i in includes: - main_ns.enum(i).include() - + main_ns.enum(i).include() + for c in main_ns.classes(): + if "Singleton" in c.decl_string: + print c, c.name, c.decl_string + includes = ['::Ogre::Singleton<Ogre::PCZoneFactoryManager>', + 'Ogre::Singleton<Ogre::PCZoneFactoryManager>', + '::Ogre::Singleton<::Ogre::PCZoneFactoryManager>', + 'Singleton<PCZoneFactoryManager>' + ] + for i in includes: + try: + main_ns.class_(i).include() + print "Forced Include:", i + except: + pass + + main_ns.class_('RaySceneQuery').include(already_exposed=True) + main_ns.class_('DefaultRaySceneQuery').include(already_exposed=True) + main_ns.class_('SceneQuery').include(already_exposed=True) + main_ns.class_('RaySceneQueryListener').include(already_exposed=True) + + + ############################################################ ## ## And things that need manual fixes, but not necessarly hand wrapped @@ -106,26 +136,24 @@ main_ns = global_ns.namespace( MAIN_NAMESPACE ) else: main_ns = global_ns + + includes_already = ['::std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >', + '::std::vector<Ogre::Plane, std::allocator<Ogre::Plane> >', + '::std::map<std:string' + ] + includes = ['::Ogre::Singleton<Ogre::PCZoneFactoryManager>' + ] for c in global_ns.classes(): - if c.decl_string.startswith("::std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >"): - print "Excluding:", c - c.include(already_exposed=True) - try: - global_ns.namespace("std").class_('vector<Ogre::PlaneBoundedVolume>, std::allocator<Ogre::BoundedVolume> >').exclude() - print "OK1" - except: - print "FAIL1" - try: - main_ns.class_("std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >").exclude() - print "OK2" - except: - print "FAIL2" - try: - main_ns.class_("::std::vector<Ogre::PlaneBoundedVolume, std::allocator<Ogre::PlaneBoundedVolume> >").exclude() - print "OK3" - except: - print "FAIL3" + for i in includes_already: + if c.decl_string.startswith(i): + print "Including Special(already Exposed):", c + c.include(already_exposed=True) + for i in includes: + if c.decl_string.startswith(i): + print "Including Special:", c + c.include() + ############################################################ ## ## And things that need to have their argument and call values fixed. @@ -216,30 +244,30 @@ # the 'main'function # def generate_code(): - messages.disable( -# Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X - messages.W1020 - , messages.W1021 - , messages.W1022 - , messages.W1023 - , messages.W1024 - , messages.W1025 - , messages.W1026 - , messages.W1027 - , messages.W1028 - , messages.W1029 - , messages.W1030 - , messages.W1031 - , messages.W1035 - , messages.W1040 - , messages.W1038 - , messages.W1041 - , messages.W1036 # pointer to Python immutable member - , messages.W1033 # unnamed variables - , messages.W1018 # expose unnamed classes - , messages.W1049 # returns reference to local variable - , messages.W1014 # unsupported '=' operator - ) +# messages.disable( +# # Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X +# messages.W1020 +# , messages.W1021 +# , messages.W1022 +# , messages.W1023 +# , messages.W1024 +# , messages.W1025 +# , messages.W1026 +# , messages.W1027 +# , messages.W1028 +# , messages.W1029 +# , messages.W1030 +# , messages.W1031 +# , messages.W1035 +# , messages.W1040 +# , messages.W1038 +# , messages.W1041 +# , messages.W1036 # pointer to Python immutable member +# , messages.W1033 # unnamed variables +# , messages.W1018 # expose unnamed classes +# , messages.W1049 # returns reference to local variable +# , messages.W1014 # unsupported '=' operator +# ) # # Use GCCXML to create the controlling XML file. # If the cache file (../cache/*.xml) doesn't exist it gets created, otherwise it just gets loaded @@ -279,22 +307,25 @@ global_ns = mb.global_ns global_ns.exclude() +# # +# # I'm assuming that any 'std' classes etc we need will have already been exposed by the Ogre library +# # +# std_ns = global_ns.namespace('std') +# std_ns.include(already_exposed=True) + # We don't include all of MAIN_NAMESPACE otherwise we get the same full wrapper # so instead we include classes with names that start with PCZ main_ns = global_ns.namespace( MAIN_NAMESPACE ) -# main_ns.include() +# # main_ns.include( already_exposed = True ) ## force the ogre class to be exposed as well... + for c in main_ns.classes(): if c.name.startswith ('PCZ') or c.name.startswith ('PCPlane') or c.name.startswith ('Portal'): c.include() - print "Including ", c + print "Including ", c, c.already_exposed for c in ['Portal','PCPlane']: main_ns.class_(c).include() print "Including ", c -# for e in c.enums(allow_empty=True): -# e.include() -# for v in c.variables(allow_empty=True): -# v.include() common_utils.AutoExclude ( mb, MAIN_NAMESPACE ) ManualExclude ( mb ) Modified: trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/code_generators/ogrepcz/hand_made_wrappers.py 2008-08-05 03:02:16 UTC (rev 684) @@ -1,6 +1,13 @@ import os import environment + +# +# these casting calls (in General) shouldn't be needed as by default Python/Boost understands that the objects +# are 'PCZ' ones and it all works.. +# +# However adding casting functions to each class to make them into their Ogre parent types just in case +# WRAPPER_DEFINITION_General = \ """ // The following helper functions are a start and possibly need to be extended to include @@ -21,28 +28,126 @@ PCZSphereSceneQuery : public DefaultSphereSceneQuery PCZPlaneBoundedVolumeListSceneQuery : public DefaultPlaneBoundedVolumeListSceneQuery */ - - """ WRAPPER_REGISTRATION_General = [ - """bp::def( "castAsPCZSceneNode", &General_castAsPCZSceneNode, + """def( "castAsPCZSceneNode", &General_castAsPCZSceneNode, "Python-Ogre Helper Function: Casts a SceneNode as a PCZSceneNode.\\n\\ Input: SceneNode\\n\\ Ouput: PCZSceneNode",\ bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", - """bp::def( "castAsPCZSceneManager", &General_castAsPCZSceneManager, + """def( "castAsPCZSceneManager", &General_castAsPCZSceneManager, "Python-Ogre Helper Function: Casts a SceneManager as a PCZSceneManager.\\n\\ Input: SceneManager\\n\\ Ouput: PCZSceneManager",\ bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", - """bp::def( "castAsPCZRaySceneQuery", &General_castAsPCZRaySceneQuery, + """def( "castAsPCZRaySceneQuery", &General_castAsPCZRaySceneQuery, "Python-Ogre Helper Function: Casts a RaySceneQuery as a PCZRaySceneQuery.\\n\\ Input: RaySceneQuery\\n\\ Ouput: PCZRaySceneQuery",\ bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", ] + +WRAPPER_DEFINITION_PCZSceneNode = \ +""" +Ogre::SceneNode * PCZSceneNode_castAsSceneNode( Ogre::PCZSceneNode * me ){ + return ((Ogre::SceneNode*) me); + } +""" +WRAPPER_REGISTRATION_PCZSceneNode = [ + """def( "castAsSceneNode", &PCZSceneNode_castAsSceneNode, + "Python-Ogre Helper Function: Casts a PCZSceneNode as a SceneNode.\\n\\ + Input: None\\n\\ + Ouput: SceneNode",\ + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""" + ] + + + +WRAPPER_DEFINITION_PCZSceneManager = \ +""" +Ogre::SceneManager * PCZSceneManager_castAsSceneManager( Ogre::PCZSceneManager * me ){ + return ((Ogre::SceneManager*) me); + } +""" +WRAPPER_REGISTRATION_PCZSceneManager = [ + """def( "castAsSceneManager", &PCZSceneManager_castAsSceneManager, + "Python-Ogre Helper Function: Casts a PCZSceneManager as a SceneManager.\\n\\ + Input: None\\n\\ + Ouput: SceneManager",\ + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""" + ] + + +WRAPPER_DEFINITION_PCZRaySceneQuery = \ +""" +Ogre::RaySceneQuery * PCZRaySceneQuery_castAsRaySceneQuery( Ogre::PCZRaySceneQuery * me ){ + return ( ( Ogre::RaySceneQuery* ) me ); + } +Ogre::RaySceneQueryResult& PCZRaySceneQuery_execute( Ogre::PCZRaySceneQuery * me ){ + return ((Ogre::RaySceneQuery*) me)->execute(); + } + +""" +WRAPPER_REGISTRATION_PCZRaySceneQuery = [ + """def( "castAsRaySceneQuery", &PCZRaySceneQuery_castAsRaySceneQuery, + "Python-Ogre Helper Function: Casts a PCZRaySceneQuery as a RaySceneQuery.\\n\\ + Input: None\\n\\ + Ouput: RaySceneQuery",\ + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""", + """def( "execute", &PCZRaySceneQuery_execute, + "Python-Ogre Helper Function: Executes a query.\\n\\ + Input: None\\n\\ + Ouput: RaySceneQueryResult",\ + bp::return_value_policy< bp::default_call_policies >());""" + ] + + +WRAPPER_DEFINITION_PCZAxisAlignedBoxSceneQuery = \ +""" +Ogre::AxisAlignedBoxSceneQuery * General_castAsAxisAlignedBoxSceneQuery( Ogre::PCZAxisAlignedBoxSceneQuery * me ){ + return (Ogre::AxisAlignedBoxSceneQuery*) me; + } +""" + +WRAPPER_DEFINITION_PCZSphereSceneQuery = \ +""" +Ogre::SphereSceneQuery * General_castAsSphereSceneQuery( Ogre::PCZSphereSceneQuery * me ){ + return (Ogre::SphereSceneQuery*) me; + } +""" + +WRAPPER_DEFINITION_PCZAxisAlignedBoxSceneQuery = \ +""" +Ogre::PlaneBoundedVolumeListSceneQuery * General_castAsPlaneBoundedVolumeListSceneQuery( Ogre::PCZPlaneBoundedVolumeListSceneQuery * me ){ + return (Ogre::PlaneBoundedVolumeListSceneQuery*) me; + } +""" + + + + + +WRAPPER_DEFINITION_Portal = """ +void Portal_setCorners( ::Ogre::Portal & me, boost::python::list listin ) +{ + Ogre::Vector3 corners[4]; + size_t maxlen = len ( listin ); + if (maxlen > 4) maxlen = 4; // can only handle upto 4 'corners' + size_t counter = 0; + for (counter=0;counter < maxlen; counter ++ ) + corners[counter] = boost::python::extract<Ogre::Vector3> (listin[counter]); + me.setCorners ( corners); +} +""" +WRAPPER_REGISTRATION_Portal = [ + """def( "setCorners", &::Portal_setCorners,\\ + "Python-Ogre Helper Function: Sets the corners of a portal.\\n\\ + Input: List of Vector3's - either 2 or 4 depending on portal type\\n\\ + Output: None");""" + ] + ################################################################################################# ################################################################################################# @@ -51,6 +156,20 @@ class_.add_registration_code ( c ) def apply( mb ): + rt = mb.class_( 'Portal' ) + rt.add_declaration_code( WRAPPER_DEFINITION_Portal ) + apply_reg (rt, WRAPPER_REGISTRATION_Portal ) + + rt = mb.class_( 'PCZSceneNode' ) + rt.add_declaration_code( WRAPPER_DEFINITION_PCZSceneNode ) + apply_reg (rt, WRAPPER_REGISTRATION_PCZSceneNode ) + rt = mb.class_( 'PCZSceneManager' ) + rt.add_declaration_code( WRAPPER_DEFINITION_PCZSceneManager ) + apply_reg (rt, WRAPPER_REGISTRATION_PCZSceneManager ) + rt = mb.class_( 'PCZRaySceneQuery' ) + rt.add_declaration_code( WRAPPER_DEFINITION_PCZRaySceneQuery ) + apply_reg (rt, WRAPPER_REGISTRATION_PCZRaySceneQuery ) + mb.add_declaration_code( WRAPPER_DEFINITION_General ) apply_reg (mb, WRAPPER_REGISTRATION_General ) \ No newline at end of file Modified: trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/code_generators/ogrepcz/python_ogrepcz_sizeof.h 2008-08-05 03:02:16 UTC (rev 684) @@ -1 +1,5 @@ // sizeof ( variable ); +sizeof( PCZCamera ); +sizeof ( ZoneData ); +sizeof ( Ogre::Singleton<Ogre::PCZoneFactoryManager> ); + Modified: trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py =================================================================== --- trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/demos/ogrepcz/Demo_PCZ01.py 2008-08-05 03:02:16 UTC (rev 684) @@ -27,22 +27,24 @@ import ogre.io.OIS as ois import ogre.renderer.ogrepcz as pcz -# import RoomObject +import RoomObject Global_buildingNode = None #pcz.PCZSceneNode() -Global_buildingTranslate = None # ogre.Vector3() -Global_raySceneQuery = None # ogre.RaySceneQuery() -Global_targetMO = None #ogre.MovableObject() -class PCZTestFrameListener ( sf.ExampleFrameListener): - def __init__(self, renderWindow, camera ): +class PCZTestFrameListener ( sf.FrameListener): + def __init__(self, renderWindow, sceneManager,camera ): sf.FrameListener.__init__(self, renderWindow, camera) self.moveSpeed = 15.0 - self.raySceneQueue = sceneManager.createRayQuery(ogre.Ray(camera.getPosition(), + self.targetMO =0 + self.buildingTranslate = ogre.Vector3() + + print "\n\n** :", sceneManager + self.raySceneQuery= sceneManager.createRayQuery(ogre.Ray(camera.getPosition(), ogre.Vector3.NEGATIVE_UNIT_Y)) + + print "\n\n** :", sceneManager, "\n", self.raySceneQuery self.camera = camera - self.updateRay=ogre.Ray() self.pczCameraParentNode = pcz.castAsPCZSceneNode(self.camera.getParentSceneNode()) def moveCamera( self ): @@ -53,84 +55,87 @@ self.camera.getParentSceneNode().pitch(self.rotationY) self.camera.getParentSceneNode().yaw(self.rotationX, ogre.Node.TS_WORLD) - Global_buildingNode.translate(Global_buildingTranslate, ogre.Node.TS_LOCAL) + Global_buildingNode.translate(self.buildingTranslate, ogre.Node.TS_LOCAL) def frameRenderingQueued( self, evt ): - if sf.FrameListener.frameRenderingQueued( evt ) == False: + if sf.FrameListener.frameRenderingQueued( self, evt ) == False: return False - Global_buildingTranslate = ogre.Vector3(0,0,0) - if self.keyboard.isKeyDown( ois.KC_LBRACKET ): - Global_buildingTranslate = ogre.Vector3(0,-10,0) - if self.keyboard.isKeyDown( ois.KC_RBRACKET ): - Global_buildingTranslate = ogre.Vector3(0,10,0) - if self.keyboard.isKeyDown( ois.KC_LSHIFT ) or self.keyboard.isKeyDown( ois.KC_RSHIFT ): + self.buildingTranslate = ogre.Vector3(0,0,0) + if self.Keyboard.isKeyDown( ois.KC_LBRACKET ): + self.buildingTranslate = ogre.Vector3(0,-10,0) + if self.Keyboard.isKeyDown( ois.KC_RBRACKET ): + self.buildingTranslate = ogre.Vector3(0,10,0) + if self.Keyboard.isKeyDown( ois.KC_LSHIFT ) or self.Keyboard.isKeyDown( ois.KC_RSHIFT ): self.moveSpeed = 150 - else + else: self.moveSpeed = 15 # test the ray scene query by showing bounding box of whatever the camera is pointing directly at # (takes furthest hit) - self.updateRay.setOrigin(self.camera.getParentSceneNode().getPosition()) - self.updateRay.setDirection(self.camera.getParentSceneNode().getOrientation()*ogre.Vector3.NEGATIVE_UNIT_Z) - Global_raySceneQuery.setRay(updateRay) + updateRay = ogre.Ray() + updateRay.setOrigin(self.camera.getParentSceneNode().getPosition()) + updateRay.setDirection(self.camera.getParentSceneNode().getOrientation()*ogre.Vector3.NEGATIVE_UNIT_Z) + self.raySceneQuery.setRay(updateRay) zone = self.pczCameraParentNode.getHomeZone() - pcz.castAsPCZRaySceneQuery(Global_raySceneQuery).setStartZone(zone) - pcz.castAsPCZRaySceneQuery(Global_raySceneQuery).setExcludeNode(self.camera.getParentSceneNode()) - for queryResult in Global_raySceneQuery.execute(): - ri = qryResult.rbegin() - mo = ri.movable - if Global_targetMO != mo: - if Global_targetMO != 0: - Global_targetMO.getParentSceneNode().showBoundingBox(False) - Global_targetMO = mo - Global_targetMO.getParentSceneNode().showBoundingBox(True) + pcz.castAsPCZRaySceneQuery(self.raySceneQuery).setStartZone(zone) + pcz.castAsPCZRaySceneQuery(self.raySceneQuery).setExcludeNode(self.camera.getParentSceneNode()) + rq = self.raySceneQuery.castAsRaySceneQuery() +# print "RAYQUERY", rq + for queryResult in self.raySceneQuery.execute(): # + mo = queryResult.movable + if self.targetMO != mo: + if self.targetMO != 0: + self.targetMO.getParentSceneNode().showBoundingBox(False) + self.targetMO = mo + self.targetMO.getParentSceneNode().showBoundingBox(True) return True -class TerrainListener(sf.FrameListener): - def __init__(self, renderWindow, camera, sceneManager): - sf.FrameListener.__init__(self, renderWindow, camera) - self.sceneManager = sceneManager - self.moveSpeed = 50.0 - - self.raySceneQuery = sceneManager.createRayQuery(ogre.Ray(camera.getPosition(), - ogre.Vector3.NEGATIVE_UNIT_Y)) - self.camera = camera - #self.camera.setPosition (self.camera.getPosition() + ogre.Vector3(0.0, 10.0, 0.0)) +# class TerrainListener(sf.FrameListener): +# def __init__(self, renderWindow, camera, sceneManager): +# sf.FrameListener.__init__(self, renderWindow, camera) +# self.sceneManager = sceneManager +# self.moveSpeed = 50.0 +# +# self.raySceneQuery = sceneManager.createRayQuery(ogre.Ray(camera.getPosition(), +# ogre.Vector3.NEGATIVE_UNIT_Y)) +# self.camera = camera +# #self.camera.setPosition (self.camera.getPosition() + ogre.Vector3(0.0, 10.0, 0.0)) +# +# def frameStarted(self, frameEvent): +# # clamp to terrain +# updateRay = ogre.Ray() +# updateRay.setOrigin (self.camera.getPosition() + ogre.Vector3(0.0, 10.0, 0.0)) +# updateRay.setDirection (ogre.Vector3.NEGATIVE_UNIT_Y) +# self.raySceneQuery.Ray = updateRay +# for queryResult in self.raySceneQuery.execute(): +# if queryResult.worldFragment is not None: +# pos = self.camera.getPosition() +# self.camera.setPosition (pos.x, pos.y - queryResult.distance + 15.0, pos.z) +# break +# +# return sf.FrameListener.frameStarted(self, frameEvent) - def frameStarted(self, frameEvent): - # clamp to terrain - updateRay = ogre.Ray() - updateRay.setOrigin (self.camera.getPosition() + ogre.Vector3(0.0, 10.0, 0.0)) - updateRay.setDirection (ogre.Vector3.NEGATIVE_UNIT_Y) - self.raySceneQuery.Ray = updateRay - for queryResult in self.raySceneQuery.execute(): - if queryResult.worldFragment is not None: - pos = self.camera.getPosition() - self.camera.setPosition (pos.x, pos.y - queryResult.distance + 15.0, pos.z) - break - return sf.FrameListener.frameStarted(self, frameEvent) - - class PCZTestApplication (sf.Application): def __del__(self): - del Global_raySceneQuery + del self.raySceneQuery def _chooseSceneManager ( self ): # Create the SceneManager, in this case a generic one self.sceneManager = self.root.createSceneManager("PCZSceneManager", "PCZSceneManager") + print "\n****:", self.sceneManager # initialize the scene manager using terrain as default zone zoneTypeName = "ZoneType_Default" self.pczSM = pcz.castAsPCZSceneManager( self.sceneManager ) # store this for future reference self.pczSM.init(zoneTypeName) #self.sceneManager.showBoundingBoxes(True) -# def _createFrameListener( self ): -# self.frameListener= PCZTestFrameListener(self.renderWindow, self.camera) -# self.root.addFrameListener(self.frameListener) + def _createFrameListener( self ): + self.frameListener= PCZTestFrameListener(self.renderWindow, self.sceneManager,self.camera) + self.root.addFrameListener(self.frameListener) def _createCamera(self): # Create the camera @@ -210,7 +215,7 @@ # Create a skybox self.sceneManager.setSkyBox(True, "Examples/CloudyNoonSkyBox", 500 ) # put the skybox node in the default zone -# self.pczSM.setSkyZone(None) + self.pczSM.setSkyZone(None) # Create a light l = self.sceneManager.createLight("MainLight") @@ -293,31 +298,31 @@ # set far clip plane to one terrain zone width (we have a LOT of terrain here, so we need to do far clipping!) self.camera.setFarClipDistance(1500) -# # create test buildinig -# RoomObject roomObj -# Global_buildingNode = roomObj.createTestBuilding(self.sceneManager, String("1")) -# Global_buildingNode.setPosition(500, 165, 570) -# #ogre.Radian r = Radian(3.1416/7.0) -# #Global_buildingNode.rotate(ogre.Vector3.UNIT_Y, r) -# + # create test buildinig + roomObj = RoomObject.RoomObject() + Global_buildingNode = roomObj.createTestBuilding(self.sceneManager, "1") + Global_buildingNode.setPosition(500, 165, 570) + #ogre.Radian r = Radian(3.1416/7.0) + #Global_buildingNode.rotate(ogre.Vector3.UNIT_Y, r) + # # create another test buildinig -# RoomObject roomObj2 +# roomObj2 = RoomObject.RoomObject() # Global_buildingNode = roomObj2.createTestBuilding(self.sceneManager, String("2")) # Global_buildingNode.setPosition(400, 165, 570) -# #ogre.Radian r = Radian(3.1416/7.0) -# #Global_buildingNode.rotate(ogre.Vector3.UNIT_Y, r) -# -# # Position camera in the center of the building -# self.cameraNode.setPosition(Global_buildingNode.getPosition()) -# # Look back along -Z -# self.camera.lookAt(self.cameraNode._getDerivedPosition() + ogre.Vector3(0,0,-300)) -# # Update bounds for camera -# self.cameraNode._updateBounds() -# + #ogre.Radian r = Radian(3.1416/7.0) + #Global_buildingNode.rotate(ogre.Vector3.UNIT_Y, r) + + # Position camera in the center of the building + self.cameraNode.setPosition(Global_buildingNode.getPosition()) + # Look back along -Z + self.camera.lookAt(self.cameraNode._getDerivedPosition() + ogre.Vector3(0,0,-300)) + # Update bounds for camera + self.cameraNode._updateBounds() + # # create the ray scene query -# Global_raySceneQuery = self.sceneManager.createRayQuery( +# self.raySceneQuery = self.sceneManager.createRayQuery( # Ray(self.camera.getParentNode().getPosition(), ogre.Vector3.NEGATIVE_UNIT_Z)) -# Global_raySceneQuery.setSortByDistance(True, 5) +# self.raySceneQuery.setSortByDistance(True, 5) Modified: trunk/python-ogre/demos/ogrepcz/RoomObject.py =================================================================== --- trunk/python-ogre/demos/ogrepcz/RoomObject.py 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/demos/ogrepcz/RoomObject.py 2008-08-05 03:02:16 UTC (rev 684) @@ -1,1009 +1,684 @@ ## +## Filename : RoomObject.py +## based on C++ demo in Ogre ## -## -## Filename : RoomObject.cpp -# # -# # -# # class RoomObject -# # -# # private: -# # Ogre::Vector3 points[32]; -# # int mPortalCount; -# # public: +import sys +import os +sys.path.insert(0,'..') +import PythonOgreConfig -DOOR_NONE = 0x00 -DOOR_TOP = 0x01 -DOOR_BOT = 0x02 -DOOR_FRONT = 0x04 -DOOR_BACK = 0x08 -DOOR_LEFT = 0x10 -DOOR_RIGHT = 0x20 -DOOR_ALL = 0xFF +## this here becase the Plug_PCZSceneManager.dll needs to be accessed by both the python module and the ogre plugins +if sys.platform == 'win32': + newpath = os.path.join ( os.path.abspath(os.path.dirname(__file__)), '../../plugins') + os.environ['PATH'] = newpath +';' + os.environ['PATH'] -# # -# # -#include "Ogre.h" -#include "OgreMaterial.h" -#include "RoomObject.h" -#include "OgrePortal.h" +import ogre.renderer.OGRE as ogre +import ogre.renderer.ogrepcz as pcz -using namespace Ogre -static int count = 0 +DOOR_NONE = 0x00 +DOOR_TOP = 0x01 +DOOR_BOT = 0x02 +DOOR_FRONT = 0x04 +DOOR_BACK = 0x08 +DOOR_LEFT = 0x10 +DOOR_RIGHT = 0x20 +DOOR_ALL = 0xFF -PCZSceneNode * RoomObject.createTestBuilding(Ogre::SceneManager *scene, String & name) +class RoomObject: + def __init__ ( self ): + self.initMaterial=False + self.count = 0 + self.points =[ogre.Vector3]*32 - count++ - mPortalCount = 0 - Ogre.PCZSceneManager * pczSM = (Ogre::PCZSceneManager*)scene + def createTestBuilding(self, scene,name): + self.count+=1 + pczSM = pcz.castAsPCZSceneManager(scene ) + + ## set points to building exterior size + self.createPoints(ogre.Vector3(60.0, 40.0, 60.0), ogre.Vector3(4.0, 10.0, 4.0)) + + ## create the building exterior + exterior = pczSM.createEntity( name + "_building_exterior", "building_exterior.mesh" ) + + ## make the enclosure a child node of the root scene node + exteriorNode = pcz.castAsPCZSceneNode(scene.getRootSceneNode()).createChildSceneNode(name +"_building_exterior_node", ogre.Vector3( 0, 0, 0 ) ) + exteriorNode.attachObject(exterior) + pczSM.addPCZSceneNode(exteriorNode, pczSM.getDefaultZone()) + + ## create portals for the building exterior + self.createPortals(scene, + exterior, + exteriorNode, + pczSM.getDefaultZone(), + DOOR_FRONT|DOOR_BACK|DOOR_LEFT|DOOR_RIGHT, + True) + + ## reset points to room size + self.createPoints(ogre.Vector3(20.0, 10.0, 20.0), ogre.Vector3(4.0, 10.0, 4.0)) + + ## create an interior room + room = pczSM.createEntity( name +"_room1", "room_nzpz.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room1_node", ogre.Vector3( 0.0, 0.0, 20.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneType = "ZoneType_Default" + zoneName = name +"_room1_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_FRONT|DOOR_BACK, + False) + + ## create another interior room + room = pczSM.createEntity( name +"_room2", "room_nxpxnypynzpz.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room2_node", ogre.Vector3( 0.0, 0.0, 0.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room2_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_FRONT|DOOR_BACK|DOOR_LEFT|DOOR_RIGHT|DOOR_TOP|DOOR_BOT, + False) + + ## create another interior room + room = pczSM.createEntity( name +"_room3", "room_nzpz.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room3_node", ogre.Vector3( 0.0, 0.0, -20.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room3_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_FRONT|DOOR_BACK, + False) + + ## create another interior room + room = pczSM.createEntity( name +"_room4", "room_nxpx.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room4_node", ogre.Vector3( -20.0, 0.0, 0.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room4_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_LEFT|DOOR_RIGHT, + False) + + ## create another interior room + room = pczSM.createEntity( name +"_room5", "room_nxpx.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room5_node", ogre.Vector3( 20.0, 0.0, 0.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room5_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_LEFT|DOOR_RIGHT, + False) + + ## create another interior room + room = pczSM.createEntity( name +"_room6", "room_ny.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room6_node", ogre.Vector3( 0.0, 10.0, 0.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room6_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_BOT, + False) + + ## create another interior room + room = pczSM.createEntity( name +"_room7", "room_py.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room7_node", ogre.Vector3( 0.0, -50.0, 0.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room7_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_TOP, + False) + + ## reset points to tall room size + self.createPoints(ogre.Vector3(20.0, 40.0, 20.0), ogre.Vector3(4.0, 10.0, 4.0)) + + ## create another interior room + room = pczSM.createEntity( name +"_room8", "room_nypy_4y.mesh" ) + + ## add the room as a child node to the enclosure node + roomNode = pcz.castAsPCZSceneNode(exteriorNode).createChildSceneNode( name +"_room8_node", ogre.Vector3( 0.0, -25.0, 0.0 ) ) + roomNode.attachObject(room) + + ## room needs it's own zone + zoneName = name +"_room8_zone" + newZone = pczSM.createZone(zoneType, zoneName) + newZone.setEnclosureNode(roomNode) + pczSM.addPCZSceneNode(roomNode, newZone) + + ## create portals for the room + self.createPortals(scene, + room, + roomNode, + newZone, + DOOR_BOT|DOOR_TOP, + False) + + + ## resolve portal zone pointers + pczSM.connectPortalsToTargetZonesByLocation() + + return exteriorNode - ## set points to building exterior size - createPoints(Vector3(60.0, 40.0, 60.0), Vector3(4.0, 10.0, 4.0)) - ## create the building exterior - Entity *exterior = pczSM->createEntity( name + "_building_exterior", "building_exterior.mesh" ) - ## make the enclosure a child node of the root scene node - PCZSceneNode * exteriorNode - exteriorNode = (PCZSceneNode*)scene->getRootSceneNode()->createChildSceneNode(name +"_building_exterior_node", Vector3( 0.0, 0.0f, 0.0f ) ) - exteriorNode->attachObject(exterior) - pczSM->addPCZSceneNode(exteriorNode, pczSM->getDefaultZone()) + def createRoom(self, scene, name, doorFlags, isEnclosure, dimensions, doorDimensions): + self.addMaterial(name, ogre.ColourValue(1,1,1,.75), Ogre.SBT_TRANSPARENT_ALPHA) + room = scene.createManualObject(name) + room.begin(name, ogre.RenderOperation.OT_TRIANGLE_LIST) + + ## create points + self.createPoints(dimensions, doorDimensions) + + fade=0.5 + solid=0.8 + color = ogre.ColourValue(0, 0, solid, solid) + + ## copy to room + for i in range(32): + room.position(self.self.points[i]) + room.colour(color) + + self.createWalls(room, doorFlags, isEnclosure) + room.end() + return room - ## create portals for the building exterior - createPortals(scene, - exterior, - exteriorNode, - pczSM->getDefaultZone(), - DOOR_FRONT|DOOR_BACK|DOOR_LEFT|DOOR_RIGHT, - True) - ## reset points to room size - createPoints(Vector3(20.0, 10.0, 20.0), Vector3(4.0, 10.0, 4.0)) + def addMaterial( self, mat, clr, sbt): + if(self.initMaterial): + return + else: + self.initMaterial=True + + matptr = ogre.MaterialManager.getSingleton().create(mat, "General") + matptr.setReceiveShadows(False) + matptr.getTechnique(0).setLightingEnabled(True) + matptr.getTechnique(0).getPass(0).setDiffuse(clr) + matptr.getTechnique(0).getPass(0).setAmbient(clr) + matptr.getTechnique(0).getPass(0).setSelfIllumination(clr) + matptr.getTechnique(0).getPass(0).setSceneBlending(sbt) + matptr.getTechnique(0).getPass(0).setLightingEnabled(False) + matptr.getTechnique(0).getPass(0).setVertexColourTracking(Ogre.TVC_DIFFUSE) - ## create an interior room - Entity *room = pczSM->createEntity( name +"_room1", "room_nzpz.mesh" ) - ## add the room as a child node to the enclosure node - PCZSceneNode * roomNode - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room1_node", Vector3( 0.0, 0.0f, 20.0f ) ) - roomNode->attachObject(room) + def createPoints(self, dimensions, doorDimensions): - ## room needs it's own zone - Ogre.String zoneType = "ZoneType_Default" - Ogre.String zoneName = name +"_room1_zone" - PCZone * newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) + l = dimensions.x/2 + h = dimensions.y/2 + w = dimensions.z/2 + + ## 4 7 + ## *-------* + ## /| /| + ## / | / | y + ## / 5| 3/ 6| | + ## 0*---*---*---* *-- x + ## | / | / / + ## | / | / z + ## |/ |/ + ## 1*-------*2 + + self.points[0] = ogre.Vector3(-l, h, w) ##0 + self.points[1] = ogre.Vector3(-l, -h, w) ##1 + self.points[2] = ogre.Vector3(l, -h, w) ##2 + self.points[3] = ogre.Vector3(l, h, w) ##3 + + self.points[4] = ogre.Vector3(-l, h, -w) ##4 + self.points[5] = ogre.Vector3(-l, -h, -w) ##5 + self.points[6] = ogre.Vector3(l, -h, -w) ##6 + self.points[7] = ogre.Vector3(l, h, -w) ##7 + + ## doors + l2 = doorDimensions.x/2 + h2 = doorDimensions.y/2 + w2 = doorDimensions.z/2 + + ## front door + self.points[8] = ogre.Vector3(-l2, h2, w) ##8 + self.points[9] = ogre.Vector3(-l2, -h2, w) ##9 + self.points[10] = ogre.Vector3(l2, -h2, w) ##10 + self.points[11] = ogre.Vector3(l2, h2, w) ##11 + + ## back door + self.points[12] = ogre.Vector3(-l2, h2, -w) ##12 + self.points[13] = ogre.Vector3(-l2, -h2, -w) ##13 + self.points[14] = ogre.Vector3(l2, -h2, -w) ##14 + self.points[15] = ogre.Vector3(l2, h2, -w) ##15 + + ## top door + self.points[16] = ogre.Vector3(-l2, h, -w2) ##16 + self.points[17] = ogre.Vector3(-l2, h, w2) ##17 + self.points[18] = ogre.Vector3(l2, h, w2) ##18 + self.points[19] = ogre.Vector3(l2, h, -w2) ##19 + + ## bottom door + self.points[20] = ogre.Vector3(-l2, -h, -w2) ##20 + self.points[21] = ogre.Vector3(-l2, -h, w2) ##21 + self.points[22] = ogre.Vector3(l2, -h, w2) ##22 + self.points[23] = ogre.Vector3(l2, -h, -w2) ##23 + + ## left door + self.points[24] = ogre.Vector3(-l, h2, w2) ##24 + self.points[25] = ogre.Vector3(-l, -h2, w2) ##25 + self.points[26] = ogre.Vector3(-l, -h2, -w2) ##26 + self.points[27] = ogre.Vector3(-l, h2, -w2) ##27 + + ## right door + self.points[28] = ogre.Vector3(l, h2, w2) ##28 + self.points[29] = ogre.Vector3(l, -h2, w2) ##29 + self.points[30] = ogre.Vector3(l, -h2, -w2) ##30 + self.points[31] = ogre.Vector3(l, h2, -w2) ##31 - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_FRONT|DOOR_BACK, - False) - ## create another interior room - room = pczSM->createEntity( name +"_room2", "room_nxpxnypynzpz.mesh" ) + def createWalls(self, room, doorFlags, isEnclosure): + if (isEnclosure): + if(doorFlags & DOOR_FRONT): + ## make front wall outward facing with door + room.quad(0, 8, 11, 3) + room.quad(1, 9, 8, 0) + room.quad(2, 10, 9, 1) + room.quad(3, 11, 10, 2) + else: + ## make front wall outward facing without door + room.quad(0, 1, 2, 3) + + if(doorFlags & DOOR_BACK): + ## make back wall outward facing with door + room.quad(7, 15, 12, 4) + room.quad(6, 14, 15, 7) + room.quad(5, 13, 14, 6) + room.quad(4, 12, 13, 5) + else: + ## make back wall outward facing without door + room.quad(7, 6, 5, 4) + + if(doorFlags & DOOR_TOP): + ## make top wall outward facing with door + room.quad(0, 17, 16, 4) + room.quad(4, 16, 19, 7) + room.quad(7, 19, 18, 3) + room.quad(3, 18, 17, 0) + else: + ## make top wall outward facing without door + room.quad(0, 3, 7, 4) + + if(doorFlags & DOOR_BOT): + ## make bottom wall outward facing with door + room.quad(5, 20, 21, 1) + room.quad(6, 23, 20, 5) + room.quad(2, 22, 23, 6) + room.quad(1, 21, 22, 2) + else: + ## make bottom wall outward facing without door + room.quad(2, 1, 5, 6) + + if(doorFlags & DOOR_LEFT): + ## make left wall outward facing with door + room.quad(0, 24, 25, 1) + room.quad(4, 27, 24, 0) + room.quad(5, 26, 27, 4) + room.quad(1, 25, 26, 5) + else: + ## make left side wall outward facing without door + room.quad(1, 0, 4, 5) + + if(doorFlags & DOOR_RIGHT): + ## make right wall outward facing with door + room.quad(2, 29, 28, 3) + room.quad(6, 30, 29, 2) + room.quad(7, 31, 30, 6) + room.quad(3, 28, 31, 7) + else: + ## make right side wall outward facing without door + room.quad(3, 2, 6, 7) + + else: + + ## front back + if(doorFlags & DOOR_FRONT): + ## make front wall inward facing with door + room.quad(3, 11, 8, 0) + room.quad(0, 8, 9, 1) + room.quad(1, 9, 10, 2) + room.quad(2, 10, 11, 3) + else: + ## make front wall inward facing without door + room.quad(3, 2, 1, 0) + + if(doorFlags & DOOR_BACK): + ## make back wall inward facing with door + room.quad(4, 12, 15, 7) + room.quad(7, 15, 14, 6) + room.quad(6, 14, 13, 5) + room.quad(5, 13, 12, 4) + else: + ## make back wall inward facing without door + room.quad(4, 5, 6, 7) + + ## top bottom + if(doorFlags & DOOR_TOP): + ## make top wall inward facing with door + room.quad(4, 16, 17, 0) + room.quad(7, 19, 16, 4) + room.quad(3, 18, 19, 7) + room.quad(0, 17, 18, 3) + else: + ## make top wall inward facing without door + room.quad(4, 7, 3, 0) + + if(doorFlags & DOOR_BOT): + ## make bottom wall inward facing with door + room.quad(1, 21, 20, 5) + room.quad(5, 20, 23, 6) + room.quad(6, 23, 22, 2) + room.quad(2, 22, 21, 1) + else: + ## make bottom wall inward facing without door + room.quad(6, 5, 1, 2) + + ## end caps + if(doorFlags & DOOR_LEFT): + ## make left wall inward facing with door + room.quad(1, 25, 24, 0) + room.quad(0, 24, 27, 4) + room.quad(4, 27, 26, 5) + room.quad(5, 26, 25, 1) + else: + ## make left side wall inward facing without door + room.quad(5, 4, 0, 1) + + if(doorFlags & DOOR_RIGHT): + ## make right wall inward facing with door + room.quad(3, 28, 29, 2) + room.quad(2, 29, 30, 6) + room.quad(6, 30, 31, 7) + room.quad(7, 31, 28, 3) + else: + ## make right side wall inward facing without door + room.quad(7, 6, 2, 3) - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room2_node", Vector3( 0.0, 0.0f, 0.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room2_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_FRONT|DOOR_BACK|DOOR_LEFT|DOOR_RIGHT|DOOR_TOP|DOOR_BOT, - False) - - ## create another interior room - room = pczSM->createEntity( name +"_room3", "room_nzpz.mesh" ) - - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room3_node", Vector3( 0.0, 0.0f, -20.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room3_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_FRONT|DOOR_BACK, - False) - - ## create another interior room - room = pczSM->createEntity( name +"_room4", "room_nxpx.mesh" ) - - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room4_node", Vector3( -20.0, 0.0f, 0.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room4_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_LEFT|DOOR_RIGHT, - False) - - ## create another interior room - room = pczSM->createEntity( name +"_room5", "room_nxpx.mesh" ) - - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room5_node", Vector3( 20.0, 0.0f, 0.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room5_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_LEFT|DOOR_RIGHT, - False) - - ## create another interior room - room = pczSM->createEntity( name +"_room6", "room_ny.mesh" ) - - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room6_node", Vector3( 0.0, 10.0f, 0.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room6_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_BOT, - False) - - ## create another interior room - room = pczSM->createEntity( name +"_room7", "room_py.mesh" ) - - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room7_node", Vector3( 0.0, -50.0f, 0.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room7_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_TOP, - False) - - ## reset points to tall room size - createPoints(Vector3(20.0, 40.0, 20.0), Vector3(4.0, 10.0, 4.0)) - - ## create another interior room - room = pczSM->createEntity( name +"_room8", "room_nypy_4y.mesh" ) - - ## add the room as a child node to the enclosure node - roomNode = (PCZSceneNode*)exteriorNode->createChildSceneNode( name +"_room8_node", Vector3( 0.0, -25.0f, 0.0f ) ) - roomNode->attachObject(room) - - ## room needs it's own zone - zoneName = name +"_room8_zone" - newZone = pczSM->createZone(zoneType, zoneName) - newZone->setEnclosureNode(roomNode) - pczSM->addPCZSceneNode(roomNode, newZone) - - ## create portals for the room - createPortals(scene, - room, - roomNode, - newZone, - DOOR_BOT|DOOR_TOP, - False) - - - ## resolve portal zone pointers - pczSM->connectPortalsToTargetZonesByLocation() - - return exteriorNode - - - -Ogre.ManualObject* RoomObject::createRoom(Ogre::SceneManager *scene, - Ogre.String &name, - short doorFlags, - bool isEnclosure, - Ogre.Vector3 dimensions, - Ogre.Vector3 doorDimensions) - - addMaterial(name, Ogre.ColourValue(1,1,1,.75), Ogre::SBT_TRANSPARENT_ALPHA) - - Ogre.ManualObject* room = scene->createManualObject(name) - - room->begin(name, Ogre.RenderOperation::OT_TRIANGLE_LIST) - - ## create points - createPoints(dimensions, doorDimensions) - - Ogre.Real fade=.5 - Ogre.Real solid=.8 - Ogre.ColourValue color = ColourValue(0, 0, solid, solid) - - ## copy to room - for (int i=0 i<32;i++) - - room->position(points[i]) - room->colour(color) - - - createWalls(room, doorFlags, isEnclosure) - - room->end() - - return room - - -void RoomObject.addMaterial( Ogre::String &mat, - Ogre.ColourValue &clr, - Ogre.SceneBlendType sbt) - - static int init=False - if(init): - return - else: - init=True - - Ogre.MaterialPtr matptr = Ogre::MaterialManager::getSingleton().create(mat, "General") - matptr->setReceiveShadows(False) - matptr->getTechnique(0)->setLightingEnabled(True) - matptr->getTechnique(0)->getPass(0)->setDiffuse(clr) - matptr->getTechnique(0)->getPass(0)->setAmbient(clr) - matptr->getTechnique(0)->getPass(0)->setSelfIllumination(clr) - matptr->getTechnique(0)->getPass(0)->setSceneBlending(sbt) - matptr->getTechnique(0)->getPass(0)->setLightingEnabled(False) - matptr->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre.TVC_DIFFUSE) - - -void RoomObject.createPoints(Ogre::Vector3 dimensions, - Ogre.Vector3 doorDimensions) - - Ogre.Real l = dimensions.x/2 - Ogre.Real h = dimensions.y/2 - Ogre.Real w = dimensions.z/2 - -## 4 7 -## *-------* -## /| /| -## / | / | y -## / 5| 3/ 6| | -## 0*---*---*---* *-- x -## | / | / / -## | / | / z -## |/ |/ -## 1*-------*2 - - points[0] = Ogre.Vector3(-l, h, w) ##0 - points[1] = Ogre.Vector3(-l, -h, w) ##1 - points[2] = Ogre.Vector3(l, -h, w) ##2 - points[3] = Ogre.Vector3(l, h, w) ##3 - - points[4] = Ogre.Vector3(-l, h, -w) ##4 - points[5] = Ogre.Vector3(-l, -h, -w) ##5 - points[6] = Ogre.Vector3(l, -h, -w) ##6 - points[7] = Ogre.Vector3(l, h, -w) ##7 - - ## doors - Ogre.Real l2 = doorDimensions.x/2 - Ogre.Real h2 = doorDimensions.y/2 - Ogre.Real w2 = doorDimensions.z/2 - - ## front door - points[8] = Ogre.Vector3(-l2, h2, w) ##8 - points[9] = Ogre.Vector3(-l2, -h2, w) ##9 - points[10] = Ogre.Vector3(l2, -h2, w) ##10 - points[11] = Ogre.Vector3(l2, h2, w) ##11 - - ## back door - points[12] = Ogre.Vector3(-l2, h2, -w) ##12 - points[13] = Ogre.Vector3(-l2, -h2, -w) ##13 - points[14] = Ogre.Vector3(l2, -h2, -w) ##14 - points[15] = Ogre.Vector3(l2, h2, -w) ##15 - - ## top door - points[16] = Ogre.Vector3(-l2, h, -w2) ##16 - points[17] = Ogre.Vector3(-l2, h, w2) ##17 - points[18] = Ogre.Vector3(l2, h, w2) ##18 - points[19] = Ogre.Vector3(l2, h, -w2) ##19 - - ## bottom door - points[20] = Ogre.Vector3(-l2, -h, -w2) ##20 - points[21] = Ogre.Vector3(-l2, -h, w2) ##21 - points[22] = Ogre.Vector3(l2, -h, w2) ##22 - points[23] = Ogre.Vector3(l2, -h, -w2) ##23 - - ## left door - points[24] = Ogre.Vector3(-l, h2, w2) ##24 - points[25] = Ogre.Vector3(-l, -h2, w2) ##25 - points[26] = Ogre.Vector3(-l, -h2, -w2) ##26 - points[27] = Ogre.Vector3(-l, h2, -w2) ##27 - - ## right door - points[28] = Ogre.Vector3(l, h2, w2) ##28 - points[29] = Ogre.Vector3(l, -h2, w2) ##29 - points[30] = Ogre.Vector3(l, -h2, -w2) ##30 - points[31] = Ogre.Vector3(l, h2, -w2) ##31 - - -void RoomObject.createWalls(Ogre::ManualObject* room, - short doorFlags, - bool isEnclosure) - - - if (isEnclosure): - - if(doorFlags & DOOR_FRONT): - - ## make front wall outward facing with door - room->quad(0, 8, 11, 3) - room->quad(1, 9, 8, 0) - room->quad(2, 10, 9, 1) - room->quad(3, 11, 10, 2) - - else: - - ## make front wall outward facing without door - room->quad(0, 1, 2, 3) - - if(doorFlags & DOOR_BACK): - - ## make back wall outward facing with door - room->quad(7, 15, 12, 4) - room->quad(6, 14, 15, 7) - room->quad(5, 13, 14, 6) - room->quad(4, 12, 13, 5) - - else: - - ## make back wall outward facing without door - room->quad(7, 6, 5, 4) - - if(doorFlags & DOOR_TOP): - - ## make top wall outward facing with door - room->quad(0, 17, 16, 4) - room->quad(4, 16, 19, 7) - room->quad(7, 19, 18, 3) - room->quad(3, 18, 17, 0) - - else: - - ## make top wall outward facing without door - room->quad(0, 3, 7, 4) - - if(doorFlags & DOOR_BOT): - - ## make bottom wall outward facing with door - room->quad(5, 20, 21, 1) - room->quad(6, 23, 20, 5) - room->quad(2, 22, 23, 6) - room->quad(1, 21, 22, 2) - - else: - - ## make bottom wall outward facing without door - room->quad(2, 1, 5, 6) - - if(doorFlags & DOOR_LEFT): - - ## make left wall outward facing with door - room->quad(0, 24, 25, 1) - room->quad(4, 27, 24, 0) - room->quad(5, 26, 27, 4) - room->quad(1, 25, 26, 5) - - else: - - ## make left side wall outward facing without door - room->quad(1, 0, 4, 5) - - if(doorFlags & DOOR_RIGHT): - - ## make right wall outward facing with door - room->quad(2, 29, 28, 3) - room->quad(6, 30, 29, 2) - room->quad(7, 31, 30, 6) - room->quad(3, 28, 31, 7) - - else: - - ## make right side wall outward facing without door - room->quad(3, 2, 6, 7) - - - else: - - ## front back - if(doorFlags & DOOR_FRONT): - - ## make front wall inward facing with door - room->quad(3, 11, 8, 0) - room->quad(0, 8, 9, 1) - room->quad(1, 9, 10, 2) - room->quad(2, 10, 11, 3) - - else: - - ## make front wall inward facing without door - room->quad(3, 2, 1, 0) - - if(doorFlags & DOOR_BACK): - - ## make back wall inward facing with door - room->quad(4, 12, 15, 7) - room->quad(7, 15, 14, 6) - room->quad(6, 14, 13, 5) - room->quad(5, 13, 12, 4) - - else: - - ## make back wall inward facing without door - room->quad(4, 5, 6, 7) - - ## top bottom - if(doorFlags & DOOR_TOP): - - ## make top wall inward facing with door - room->quad(4, 16, 17, 0) - room->quad(7, 19, 16, 4) - room->quad(3, 18, 19, 7) - room->quad(0, 17, 18, 3) - - else: - - ## make top wall inward facing without door - room->quad(4, 7, 3, 0) - - if(doorFlags & DOOR_BOT): - - ## make bottom wall inward facing with door - room->quad(1, 21, 20, 5) - room->quad(5, 20, 23, 6) - room->quad(6, 23, 22, 2) - room->quad(2, 22, 21, 1) - - else: - - ## make bottom wall inward facing without door - room->quad(6, 5, 1, 2) - - ## end caps - if(doorFlags & DOOR_LEFT): - - ## make left wall inward facing with door - room->quad(1, 25, 24, 0) - room->quad(0, 24, 27, 4) - room->quad(4, 27, 26, 5) - room->quad(5, 26, 25, 1) - - else: - - ## make left side wall inward facing without door - room->quad(5, 4, 0, 1) - - if(doorFlags & DOOR_RIGHT): - - ## make right wall inward facing with door - room->quad(3, 28, 29, 2) - room->quad(2, 29, 30, 6) - room->quad(6, 30, 31, 7) - room->quad(7, 31, 28, 3) - - else: - - ## make right side wall inward facing without door - room->quad(7, 6, 2, 3) - - - - ## Create portals for every door -void RoomObject.createPortals(Ogre::SceneManager *scene, - Ogre.ManualObject* room, - Ogre.SceneNode * roomNode, - Ogre.PCZone * zone, - short doorFlags, - bool isEnclosure) + def createPortals(self, scene, room, roomNode, zone, doorFlags, isEnclosure): - Ogre.String portalName - Vector3 corners[4] - - if (isEnclosure): - - if(doorFlags & DOOR_FRONT): - - ## set the corners to the front door corners - corners[0] = points[8] - corners[1] = points[9] - corners[2] = points[10] - corners[3] = points[11] - ## create the portal - portalName = room->getName() + Ogre.String("_FrontDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BACK): - - ## set the corners to the front door corners - corners[0] = points[15] - corners[1] = points[14] - corners[2] = points[13] - corners[3] = points[12] - ## create the portal - portalName = room->getName() + Ogre.String("_BackDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_TOP): - - ## set the corners to the front door corners - corners[0] = points[16] - corners[1] = points[17] - corners[2] = points[18] - corners[3] = points[19] - ## create the portal - portalName = room->getName() + Ogre.String("_TopDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BOT): - - ## set the corners to the front door corners - corners[0] = points[23] - corners[1] = points[22] - corners[2] = points[21] - corners[3] = points[20] - ## create the portal - portalName = room->getName() + Ogre.String("_BottomDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_LEFT): - - ## set the corners to the front door corners - corners[0] = points[27] - corners[1] = points[26] - corners[2] = points[25] - corners[3] = points[24] - ## create the portal - portalName = room->getName() + Ogre.String("_LeftDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_RIGHT): - - ## set the corners to the front door corners - corners[0] = points[28] - corners[1] = points[29] - corners[2] = points[30] - corners[3] = points[31] - ## create the portal - portalName = room->getName() + Ogre.String("_RightDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - - else: - - if(doorFlags & DOOR_FRONT): - - ## set the corners to the front door corners - corners[0] = points[11] - corners[1] = points[10] - corners[2] = points[9] - corners[3] = points[8] - ## create the portal - portalName = room->getName() + Ogre.String("_FrontDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BACK): - - ## set the corners to the front door corners - corners[0] = points[12] - corners[1] = points[13] - corners[2] = points[14] - corners[3] = points[15] - ## create the portal - portalName = room->getName() + Ogre.String("_BackDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_TOP): - - ## set the corners to the front door corners - corners[0] = points[19] - corners[1] = points[18] - corners[2] = points[17] - corners[3] = points[16] - ## create the portal - portalName = room->getName() + Ogre.String("_TopDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BOT): - - ## set the corners to the front door corners - corners[0] = points[20] - corners[1] = points[21] - corners[2] = points[22] - corners[3] = points[23] - ## create the portal - portalName = room->getName() + Ogre.String("_BottomDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_LEFT): - - ## set the corners to the front door corners - corners[0] = points[24] - corners[1] = points[25] - corners[2] = points[26] - corners[3] = points[27] - ## create the portal - portalName = room->getName() + Ogre.String("_LeftDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_RIGHT): - - ## set the corners to the front door corners - corners[0] = points[31] - corners[1] = points[30] - corners[2] = points[29] - corners[3] = points[28] - ## create the portal - portalName = room->getName() + Ogre.String("_RightDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - - - -## Create portals for every door -void RoomObject.createPortals(Ogre::SceneManager *scene, - Ogre.Entity* room, - Ogre.SceneNode * roomNode, - Ogre.PCZone * zone, - short doorFlags, - bool isEnclosure) - - Ogre.String portalName - Vector3 corners[4] - - if (isEnclosure): - - if(doorFlags & DOOR_FRONT): - - ## set the corners to the front door corners - corners[0] = points[8] - corners[1] = points[9] - corners[2] = points[10] - corners[3] = points[11] - ## create the portal - portalName = room->getName() + Ogre.String("_FrontDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BACK): - - ## set the corners to the front door corners - corners[0] = points[15] - corners[1] = points[14] - corners[2] = points[13] - corners[3] = points[12] - ## create the portal - portalName = room->getName() + Ogre.String("_BackDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_TOP): - - ## set the corners to the front door corners - corners[0] = points[16] - corners[1] = points[17] - corners[2] = points[18] - corners[3] = points[19] - ## create the portal - portalName = room->getName() + Ogre.String("_TopDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BOT): - - ## set the corners to the front door corners - corners[0] = points[23] - corners[1] = points[22] - corners[2] = points[21] - corners[3] = points[20] - ## create the portal - portalName = room->getName() + Ogre.String("_BottomDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_LEFT): - - ## set the corners to the front door corners - corners[0] = points[27] - corners[1] = points[26] - corners[2] = points[25] - corners[3] = points[24] - ## create the portal - portalName = room->getName() + Ogre.String("_LeftDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_RIGHT): - - ## set the corners to the front door corners - corners[0] = points[28] - corners[1] = points[29] - corners[2] = points[30] - corners[3] = points[31] - ## create the portal - portalName = room->getName() + Ogre.String("_RightDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - - else: - - if(doorFlags & DOOR_FRONT): - - ## set the corners to the front door corners - corners[0] = points[11] - corners[1] = points[10] - corners[2] = points[9] - corners[3] = points[8] - ## create the portal - portalName = room->getName() + Ogre.String("_FrontDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BACK): - - ## set the corners to the front door corners - corners[0] = points[12] - corners[1] = points[13] - corners[2] = points[14] - corners[3] = points[15] - ## create the portal - portalName = room->getName() + Ogre.String("_BackDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_TOP): - - ## set the corners to the front door corners - corners[0] = points[19] - corners[1] = points[18] - corners[2] = points[17] - corners[3] = points[16] - ## create the portal - portalName = room->getName() + Ogre.String("_TopDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_BOT): - - ## set the corners to the front door corners - corners[0] = points[20] - corners[1] = points[21] - corners[2] = points[22] - corners[3] = points[23] - ## create the portal - portalName = room->getName() + Ogre.String("_BottomDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_LEFT): - - ## set the corners to the front door corners - corners[0] = points[24] - corners[1] = points[25] - corners[2] = points[26] - corners[3] = points[27] - ## create the portal - portalName = room->getName() + Ogre.String("_LeftDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - if(doorFlags & DOOR_RIGHT): - - ## set the corners to the front door corners - corners[0] = points[31] - corners[1] = points[30] - corners[2] = points[29] - corners[3] = points[28] - ## create the portal - portalName = room->getName() + Ogre.String("_RightDoorPortal") - Portal * p = ((PCZSceneManager*)scene)->createPortal(portalName) - p->setCorners(corners) - ## associate the portal with the roomnode - p->setNode(roomNode) - ## add the portal to the zone - zone->_addPortal(p) - ## update derived values for the portal - p->updateDerivedValues() - - - + corners=[ogre.Vector3] * 4 + + if (isEnclosure): + if(doorFlags & DOOR_FRONT): + ## set the corners to the front door corners + corners[0] = self.points[8] + corners[1] = self.points[9] + corners[2] = self.points[10] + corners[3] = self.points[11] + ## create the portal + portalName = room.getName() + "_FrontDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_BACK): + ## set the corners to the front door corners + corners[0] = self.points[15] + corners[1] = self.points[14] + corners[2] = self.points[13] + corners[3] = self.points[12] + ## create the portal + portalName = room.getName() + "_BackDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_TOP): + ## set the corners to the front door corners + corners[0] = self.points[16] + corners[1] = self.points[17] + corners[2] = self.points[18] + corners[3] = self.points[19] + ## create the portal + portalName = room.getName() + "_TopDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_BOT): + ## set the corners to the front door corners + corners[0] = self.points[23] + corners[1] = self.points[22] + corners[2] = self.points[21] + corners[3] = self.points[20] + ## create the portal + portalName = room.getName() + "_BottomDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_LEFT): + ## set the corners to the front door corners + corners[0] = self.points[27] + corners[1] = self.points[26] + corners[2] = self.points[25] + corners[3] = self.points[24] + ## create the portal + portalName = room.getName() + "_LeftDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_RIGHT): + ## set the corners to the front door corners + corners[0] = self.points[28] + corners[1] = self.points[29] + corners[2] = self.points[30] + corners[3] = self.points[31] + ## create the portal + portalName = room.getName() + "_RightDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + else: + if(doorFlags & DOOR_FRONT): + ## set the corners to the front door corners + corners[0] = self.points[11] + corners[1] = self.points[10] + corners[2] = self.points[9] + corners[3] = self.points[8] + ## create the portal + portalName = room.getName() + "_FrontDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_BACK): + ## set the corners to the front door corners + corners[0] = self.points[12] + corners[1] = self.points[13] + corners[2] = self.points[14] + corners[3] = self.points[15] + ## create the portal + portalName = room.getName() + "_BackDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_TOP): + ## set the corners to the front door corners + corners[0] = self.points[19] + corners[1] = self.points[18] + corners[2] = self.points[17] + corners[3] = self.points[16] + ## create the portal + portalName = room.getName() + "_TopDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_BOT): + ## set the corners to the front door corners + corners[0] = self.points[20] + corners[1] = self.points[21] + corners[2] = self.points[22] + corners[3] = self.points[23] + ## create the portal + portalName = room.getName() + "_BottomDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_LEFT): + ## set the corners to the front door corners + corners[0] = self.points[24] + corners[1] = self.points[25] + corners[2] = self.points[26] + corners[3] = self.points[27] + ## create the portal + portalName = room.getName() + "_LeftDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + + if(doorFlags & DOOR_RIGHT): + ## set the corners to the front door corners + corners[0] = self.points[31] + corners[1] = self.points[30] + corners[2] = self.points[29] + corners[3] = self.points[28] + ## create the portal + portalName = room.getName() + "_RightDoorPortal" + p = pcz.castAsPCZSceneManager(scene).createPortal(portalName) + p.setCorners(corners) + ## associate the portal with the roomnode + p.setNode(roomNode) + ## add the portal to the zone + zone._addPortal(p) + ## update derived values for the portal + p.updateDerivedValues() + Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/demos/plugins.cfg 2008-08-05 03:02:16 UTC (rev 684) @@ -10,8 +10,8 @@ Plugin=Plugin_BSPSceneManager.dll Plugin=Plugin_OctreeSceneManager.dll Plugin=Plugin_CgProgramManager.dll -#Plugin=Plugin_PCZSceneManager.dll -#Plugin=Plugin_OctreeZone.dll +Plugin=Plugin_PCZSceneManager.dll +Plugin=Plugin_OctreeZone.dll #Plugin=Plugin_OctreeSceneManager.dll Modified: trunk/python-ogre/packages_2.5/ogre/gui/CEGUI/__init__.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/gui/CEGUI/__init__.py 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/packages_2.5/ogre/gui/CEGUI/__init__.py 2008-08-05 03:02:16 UTC (rev 684) @@ -4,7 +4,7 @@ ## we need the path for additional CEGUI dll's if sys.platform == 'win32': - os.environ['PATH'] += ';' + __path__[0] + os.environ['PATH'] = __path__[0] +';' + os.environ['PATH'] elif sys.platform == "linux2": ## We need to import the library Modified: trunk/python-ogre/packages_2.5/ogre/gui/navi/__init__.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/gui/navi/__init__.py 2008-08-02 02:45:14 UTC (rev 683) +++ trunk/python-ogre/packages_2.5/ogre/gui/navi/__init__.py 2008-08-05 03:02:16 UTC (rev 684) @@ -1,2 +1,6 @@ import sys, os + +if sys.platform == 'win32': + os.environ['PATH'] = __path__[0] +';' + os.environ['PATH'] + from _navi_ import * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-09 21:51:27
|
Revision: 686 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=686&view=rev Author: andy_miller Date: 2008-08-09 21:51:33 +0000 (Sat, 09 Aug 2008) Log Message: ----------- Small but significant change to expose "overlapping" transformed functions in a more useful way (createive alias now generated) New patch (for Ogre 1.6 SVN) to make renderQueue functions work Modified Paths: -------------- trunk/python-ogre/code_generators/common_utils/__init__.py trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/code_generators/ogrenewt/generate_code.py Added Paths: ----------- trunk/python-ogre/patch/ogre_1.6.patch Removed Paths: ------------- trunk/python-ogre/patch/ogre_1.7.patch Modified: trunk/python-ogre/code_generators/common_utils/__init__.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/__init__.py 2008-08-05 07:25:40 UTC (rev 685) +++ trunk/python-ogre/code_generators/common_utils/__init__.py 2008-08-09 21:51:33 UTC (rev 686) @@ -1,4 +1,5 @@ import os, shutil +import sys import shared_ptr ##import hashlib ## makes this 2.5 dependent import md5 @@ -216,6 +217,7 @@ def Auto_Functional_Transformation ( mb, ignore_funs=[], special_vars=[]): toprocess = [] + aliases={} for fun in mb.member_functions(allow_empty=True): toprocess.append( fun ) for fun in mb.free_functions(allow_empty=True): @@ -229,6 +231,7 @@ arg_position = 0 trans=[] desc="" + ctypes_conversion = False for arg in fun.arguments: rawarg = declarations.remove_declarated( declarations.remove_const( @@ -245,6 +248,8 @@ trans.append( ft.modify_type(arg_position,_ReturnUnsignedInt ) ) desc = desc +"Argument: "+arg.name+ "( pos:" + str(arg_position) + " - " +\ arg.type.decl_string + " ) takes a CTypes.addressof(xx). \\n" + ctypes_conversion = True + ctypes_arg = arg.type.decl_string.split()[0] elif declarations.is_reference(arg.type): trans.append( ft.inout(arg_position ) ) desc = desc + "Argument: "+arg.name+ "( pos:" + str(arg_position) + " - " +\ @@ -256,17 +261,35 @@ arg_position += 1 if trans: if fun.documentation: # it's already be tweaked: - print "AUTOFT ERROR: Duplicate Tranforms.", fun + print "AUTOFT ERROR: Duplicate Tranforms.", fun, fun.documentation elif fun.virtuality == "pure virtual": print "AUTOFT WARNING: PURE VIRTUAL function requires tranform.", fun else: - print "AUTOFT OK: Tranformed ", fun - fun.add_transformation ( * trans , **{"alias":fun.name} ) + new_alias = fun.name + if ctypes_conversion: # only manage name changes if ctypes changing + # now lets look for a duplicate function name with the same number arguments + f= [None]*len(fun.arguments) + s = mb.member_functions("::" + fullname, arg_types=f, allow_empty=True) + if len (s) > 1: + # there are duplicate names so need to create something unique + ctypes_arg = ctypes_arg.replace("::", "_") # to clean up function names... + new_alias = fun.name + ctypes_arg[0].upper() + ctypes_arg[1:] + # now for REAL ugly code -- we have faked a new alias and it may not be unique + # so we track previous alias + class name to ensure unique names are generated + keyname = fullname + new_alias # we use the full class + function name + alias as the key + if keyname in aliases: # already exists, need to fake another version.. + new_alias = new_alias + "_" + str( aliases[keyname] ) + aliases[keyname] = aliases[keyname] + 1 + else: + aliases[keyname] = 1 + print "INFO: Adjusting Alias as multiple overlapping functions:", new_alias + + print "AUTOFT OK: Tranformed ", fun, "(",new_alias,")" + fun.add_transformation ( * trans , **{"alias":new_alias} ) fun.documentation = docit ("Auto Modified Arguments:", desc, "...") except: - pass - + print "Unexpected error:", sys.exc_info()[0] def Fix_Void_Ptr_Args ( mb, pointee_types=['unsigned int','int', 'float', 'unsigned char', 'char', 'bool'], ignore_names=[] ): """ we modify functions that take void *'s in their argument list to instead take Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-08-05 07:25:40 UTC (rev 685) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-08-09 21:51:33 UTC (rev 686) @@ -500,10 +500,28 @@ # # # x.documentation = docit ("", "format", "rgba" ) # # # # # # + + + + + # # # ## these need updates to Py++ to handle pointers -# # # # # x = ns.mem_fun('::Ogre::PixelUtil::unpackColour', arg_types=['float *','float *','float *','float *',None,None]) -# # # # # x.add_transformation(ft.output('r'), ft.output('g'), ft.output('b'), ft.output('a') ) -# # # # # x.documentation = docit ("", "Pixelformat, src", "r,g,b,a" ) +# x = ns.mem_fun('::Ogre::PixelUtil::packColour', arg_types=['Ogre::uint8','Ogre::uint8','Ogre::uint8','Ogre::uint8',None,None]) +# x.add_transformation(ft.modify_type(5,_ReturnUnsignedInt ), alias= "packColourUint" ) +# x.documentation = docit ("", "r,g,b,a,Pixelformat, src", "" ) +# +# x = ns.mem_fun('::Ogre::PixelUtil::packColour', arg_types=['float','float','float','float',None,None]) +# x.add_transformation(ft.modify_type(5,_ReturnUnsignedInt ), alias= "packColourFloat" ) +# x.documentation = docit ("", "r,g,b,a,Pixelformat, src", "" ) +# +# x = ns.mem_fun('::Ogre::PixelUtil::unpackColour', arg_types=['float *','float *','float *','float *',None,None]) +# x.add_transformation(ft.output('r'), ft.output('g'), ft.output('b'), ft.output('a'), alias="unpackColourFloat ) +# x.documentation = docit ("", "Pixelformat, src", "r,g,b,a" ) +# +# x = ns.mem_fun('::Ogre::PixelUtil::unpackColour', arg_types=['float *','float *','float *','float *',None,None]) +# x.add_transformation(ft.output('r'), ft.output('g'), ft.output('b'), ft.output('a'), alias="unpackColourFloat ) +# x.documentation = docit ("", "Pixelformat, src", "r,g,b,a" ) + # # # # # # # # x = ns.mem_fun('::Ogre::Frustum::projectSphere') # # # # # x.add_transformation(ft.output('left'), ft.output('top'), ft.output('right'), ft.output('bottom') ) @@ -1038,6 +1056,24 @@ ## need to create a welcome doc string for this... common_utils.add_constants( mb, { '__doc__' : '"Python-Ogre Main Module for OGRE 3D"' } ) + count = 0 + for v in main_ns.variables(): + if not v.ignore: + count +=1 +# v.exclude() + print "\n\nSPECIAL -- variables:", count + count = 0 + for v in main_ns.member_functions(): + if not v.ignore: + count +=1 +# v.exclude() + print "\n\nSPECIAL -- member functions:", count + count=0 + for v in main_ns.classes(): + if not v.ignore: + count +=1 +# v.exclude() + print "\n\nSPECIAL -- Number classes:", count ########################################################################################## # # Creating the code. After this step you should not modify/customize declarations. Modified: trunk/python-ogre/code_generators/ogrenewt/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrenewt/generate_code.py 2008-08-05 07:25:40 UTC (rev 685) +++ trunk/python-ogre/code_generators/ogrenewt/generate_code.py 2008-08-09 21:51:33 UTC (rev 686) @@ -116,8 +116,7 @@ global_ns.namespace( 'Ogre' ).class_('Node').include(already_exposed=True) global_ns.namespace( 'Ogre' ).class_('Serializer').include(already_exposed=True) - - + def set_call_policies_pointee( mb ): # Set the default policy to deal with pointer/reference return types to reference_existing object # as this is the ogrenewt Default. Added: trunk/python-ogre/patch/ogre_1.6.patch =================================================================== --- trunk/python-ogre/patch/ogre_1.6.patch (rev 0) +++ trunk/python-ogre/patch/ogre_1.6.patch 2008-08-09 21:51:33 UTC (rev 686) @@ -0,0 +1,236 @@ +Index: OgreMain/include/OgreMovableObject.h +=================================================================== +--- OgreMain/include/OgreMovableObject.h (revision 7873) ++++ OgreMain/include/OgreMovableObject.h (working copy) +@@ -482,7 +482,7 @@ + included too. + */ + virtual void visitRenderables(Renderable::Visitor* visitor, +- bool debugRenderables = false) = 0; ++ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } + + /** Sets whether or not the debug display of this object is enabled. + @remarks +Index: OgreMain/include/OgreRenderQueueListener.h +=================================================================== +--- OgreMain/include/OgreRenderQueueListener.h (revision 7873) ++++ OgreMain/include/OgreRenderQueueListener.h (working copy) +@@ -31,7 +31,9 @@ + + #include "OgrePrerequisites.h" + #include "OgreRenderQueue.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract interface which classes must implement if they wish to receive +@@ -64,8 +66,8 @@ + rendered. Note that in this case the renderQueueEnded event will not be raised + for this queue group. + */ +- virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, +- bool& skipThisInvocation) = 0; ++ virtual bool renderQueueStarted(uint8 queueGroupId, const String& invocation, ++ bool skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } + + /** Event raised after a queue group is rendered. + @remarks +@@ -79,8 +81,8 @@ + rendered will be repeated, and the renderQueueStarted and renderQueueEnded + events will also be fired for it again. + */ +- virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, +- bool& repeatThisInvocation) = 0; ++ virtual bool renderQueueEnded(uint8 queueGroupId, const String& invocation, ++ bool repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } + }; + + } +Index: OgreMain/include/OgreResourceGroupManager.h +=================================================================== +--- OgreMain/include/OgreResourceGroupManager.h (revision 7873) ++++ OgreMain/include/OgreResourceGroupManager.h (working copy) +@@ -37,6 +37,7 @@ + #include "OgreArchive.h" + #include "OgreIteratorWrappers.h" + #include <ctime> ++#include <stdexcept> + + namespace Ogre { + +@@ -92,7 +93,7 @@ + parsed. Note that in this case the scriptParseEnded event will not be raised + for this script. + */ +- virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0; ++ virtual bool scriptParseStarted(const String& scriptName, bool skipThisScript) { throw std::runtime_error ( std::string ("Virtual function ResourceGroupListener::scriptParseStarted called!") ); } + + /** This event is fired when the script has been fully parsed. + */ +@@ -350,7 +351,7 @@ + /// Internal event firing method + void fireResourceGroupScriptingStarted(const String& groupName, size_t scriptCount); + /// Internal event firing method +- void fireScriptStarted(const String& scriptName, bool &skipScript); ++ bool fireScriptStarted(const String& scriptName, bool skipScript); + /// Internal event firing method + void fireScriptEnded(const String& scriptName, bool skipped); + /// Internal event firing method +Index: OgreMain/include/OgreDataStream.h +=================================================================== +--- OgreMain/include/OgreDataStream.h (revision 7873) ++++ OgreMain/include/OgreDataStream.h (working copy) +@@ -33,6 +33,7 @@ + #include "OgreString.h" + #include "OgreSharedPtr.h" + #include <istream> ++#include <stdexcept> + + namespace Ogre { + +@@ -79,7 +80,7 @@ + @param count Number of bytes to read + @returns The number of bytes read + */ +- virtual size_t read(void* buf, size_t count) = 0; ++ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } + /** Get a single line from the stream. + @remarks + The delimiter character is not included in the data +Index: OgreMain/include/OgreHardwareBuffer.h +=================================================================== +--- OgreMain/include/OgreHardwareBuffer.h (revision 7873) ++++ OgreMain/include/OgreHardwareBuffer.h (working copy) +@@ -31,7 +31,9 @@ + + // Precompiler options + #include "OgrePrerequisites.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract class defining common features of hardware buffers. +@@ -244,7 +246,7 @@ + @param pDest The area of memory in which to place the data, must be large enough to + accommodate the data! + */ +- virtual void readData(size_t offset, size_t length, void* pDest) = 0; ++ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } + /** Writes data to the buffer from an area of system memory; note that you must + ensure that your buffer is big enough. + @param offset The byte offset from the start of the buffer to start writing +@@ -254,7 +256,7 @@ + such that DMA stalls can be avoided; use if you can. + */ + virtual void writeData(size_t offset, size_t length, const void* pSource, +- bool discardWholeBuffer = false) = 0; ++ bool discardWholeBuffer = false) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::writeData called!") ); } + + /** Copy data from another buffer into this one. + @remarks +Index: OgreMain/include/OgreCompositorChain.h +=================================================================== +--- OgreMain/include/OgreCompositorChain.h (revision 7873) ++++ OgreMain/include/OgreCompositorChain.h (working copy) +@@ -174,10 +174,10 @@ + public: + /** @copydoc RenderQueueListener::renderQueueStarted + */ +- virtual void renderQueueStarted(uint8 id, const String& invocation, bool& skipThisQueue); ++ virtual bool renderQueueStarted(uint8 id, const String& invocation, bool skipThisQueue); + /** @copydoc RenderQueueListener::renderQueueEnded + */ +- virtual void renderQueueEnded(uint8 id, const String& invocation, bool& repeatThisQueue); ++ virtual bool renderQueueEnded(uint8 id, const String& invocation, bool repeatThisQueue); + + /** Set current operation and target */ + void setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs); +Index: OgreMain/src/OgreResourceGroupManager.cpp +=================================================================== +--- OgreMain/src/OgreResourceGroupManager.cpp (revision 7873) ++++ OgreMain/src/OgreResourceGroupManager.cpp (working copy) +@@ -929,7 +929,7 @@ + for (FileInfoList::iterator fii = (*flli)->begin(); fii != (*flli)->end(); ++fii) + { + bool skipScript = false; +- fireScriptStarted(fii->filename, skipScript); ++ skipScript = fireScriptStarted(fii->filename, skipScript); + if(skipScript) + { + LogManager::getSingleton().logMessage( +@@ -1218,17 +1218,18 @@ + } + } + //----------------------------------------------------------------------- +- void ResourceGroupManager::fireScriptStarted(const String& scriptName, bool &skipScript) ++ bool ResourceGroupManager::fireScriptStarted(const String& scriptName, bool skipScript) + { + OGRE_LOCK_AUTO_MUTEX + for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin(); + l != mResourceGroupListenerList.end(); ++l) + { + bool temp = false; +- (*l)->scriptParseStarted(scriptName, temp); ++ temp = (*l)->scriptParseStarted(scriptName, temp); + if(temp) + skipScript = true; + } ++ return skipScript; + } + //----------------------------------------------------------------------- + void ResourceGroupManager::fireScriptEnded(const String& scriptName, bool skipped) +Index: OgreMain/src/OgreCompositorChain.cpp +=================================================================== +--- OgreMain/src/OgreCompositorChain.cpp (revision 7873) ++++ OgreMain/src/OgreCompositorChain.cpp (working copy) +@@ -377,8 +377,8 @@ + mViewport = vp; + } + //----------------------------------------------------------------------- +-void CompositorChain::RQListener::renderQueueStarted(uint8 id, +- const String& invocation, bool& skipThisQueue) ++bool CompositorChain::RQListener::renderQueueStarted(uint8 id, ++ const String& invocation, bool skipThisQueue) + { + // Skip when not matching viewport + // shadows update is nested within main viewport update +@@ -392,11 +392,13 @@ + { + skipThisQueue = true; + } ++ return skipThisQueue; + } + //----------------------------------------------------------------------- +-void CompositorChain::RQListener::renderQueueEnded(uint8 id, +- const String& invocation, bool& repeatThisQueue) ++bool CompositorChain::RQListener::renderQueueEnded(uint8 id, ++ const String& invocation, bool repeatThisQueue) + { ++ return repeatThisQueue; + } + //----------------------------------------------------------------------- + void CompositorChain::RQListener::setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs) +Index: OgreMain/src/OgreSceneManager.cpp +=================================================================== +--- OgreMain/src/OgreSceneManager.cpp (revision 7873) ++++ OgreMain/src/OgreSceneManager.cpp (working copy) +@@ -3651,7 +3651,7 @@ + iend = mRenderQueueListeners.end(); + for (i = mRenderQueueListeners.begin(); i != iend; ++i) + { +- (*i)->renderQueueStarted(id, invocation, skip); ++ skip = (*i)->renderQueueStarted(id, invocation, skip); + } + return skip; + } +@@ -3664,7 +3664,7 @@ + iend = mRenderQueueListeners.end(); + for (i = mRenderQueueListeners.begin(); i != iend; ++i) + { +- (*i)->renderQueueEnded(id, invocation, repeat); ++ repeat = (*i)->renderQueueEnded(id, invocation, repeat); + } + return repeat; + } Deleted: trunk/python-ogre/patch/ogre_1.7.patch =================================================================== --- trunk/python-ogre/patch/ogre_1.7.patch 2008-08-05 07:25:40 UTC (rev 685) +++ trunk/python-ogre/patch/ogre_1.7.patch 2008-08-09 21:51:33 UTC (rev 686) @@ -1,119 +0,0 @@ -Index: ogre/OgreMain/include/OgreDataStream.h -=================================================================== ---- ogre/OgreMain/include/OgreDataStream.h (revision 7701) -+++ ogre/OgreMain/include/OgreDataStream.h (working copy) -@@ -33,6 +33,7 @@ - #include "OgreString.h" - #include "OgreSharedPtr.h" - #include <istream> -+#include <stdexcept> - - namespace Ogre { - -@@ -79,7 +80,7 @@ - @param count Number of bytes to read - @returns The number of bytes read - */ -- virtual size_t read(void* buf, size_t count) = 0; -+ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } - /** Get a single line from the stream. - @remarks - The delimiter character is not included in the data -Index: ogre/OgreMain/include/OgreHardwareBuffer.h -=================================================================== ---- ogre/OgreMain/include/OgreHardwareBuffer.h (revision 7701) -+++ ogre/OgreMain/include/OgreHardwareBuffer.h (working copy) -@@ -31,7 +31,9 @@ - - // Precompiler options - #include "OgrePrerequisites.h" -+#include <stdexcept> - -+ - namespace Ogre { - - /** Abstract class defining common features of hardware buffers. -@@ -244,7 +246,7 @@ - @param pDest The area of memory in which to place the data, must be large enough to - accommodate the data! - */ -- virtual void readData(size_t offset, size_t length, void* pDest) = 0; -+ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } - /** Writes data to the buffer from an area of system memory; note that you must - ensure that your buffer is big enough. - @param offset The byte offset from the start of the buffer to start writing -@@ -254,7 +256,7 @@ - such that DMA stalls can be avoided; use if you can. - */ - virtual void writeData(size_t offset, size_t length, const void* pSource, -- bool discardWholeBuffer = false) = 0; -+ bool discardWholeBuffer = false) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::writeData called!") ); } - - /** Copy data from another buffer into this one. - @remarks -Index: ogre/OgreMain/include/OgreMovableObject.h -=================================================================== ---- ogre/OgreMain/include/OgreMovableObject.h (revision 7701) -+++ ogre/OgreMain/include/OgreMovableObject.h (working copy) -@@ -482,7 +482,7 @@ - included too. - */ - virtual void visitRenderables(Renderable::Visitor* visitor, -- bool debugRenderables = false) = 0; -+ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } - - /** Sets whether or not the debug display of this object is enabled. - @remarks -Index: ogre/OgreMain/include/OgreRenderQueueListener.h -=================================================================== ---- ogre/OgreMain/include/OgreRenderQueueListener.h (revision 7701) -+++ ogre/OgreMain/include/OgreRenderQueueListener.h (working copy) -@@ -31,7 +31,9 @@ - - #include "OgrePrerequisites.h" - #include "OgreRenderQueue.h" -+#include <stdexcept> - -+ - namespace Ogre { - - /** Abstract interface which classes must implement if they wish to receive -@@ -65,7 +67,7 @@ - for this queue group. - */ - virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, -- bool& skipThisInvocation) = 0; -+ bool& skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } - - /** Event raised after a queue group is rendered. - @remarks -@@ -80,7 +82,7 @@ - events will also be fired for it again. - */ - virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, -- bool& repeatThisInvocation) = 0; -+ bool& repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } - }; - - } -Index: ogre/OgreMain/include/OgreResourceGroupManager.h -=================================================================== ---- ogre/OgreMain/include/OgreResourceGroupManager.h (revision 7701) -+++ ogre/OgreMain/include/OgreResourceGroupManager.h (working copy) -@@ -36,6 +36,7 @@ - #include "OgreResource.h" - #include "OgreArchive.h" - #include "OgreIteratorWrappers.h" -+#include <stdexcept> - - namespace Ogre { - -@@ -91,7 +92,7 @@ - parsed. Note that in this case the scriptParseEnded event will not be raised - for this script. - */ -- virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0; -+ virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) { throw std::runtime_error ( std::string ("Virtual function ResourceGroupListener::scriptParseStarted called!") ); } - - /** This event is fired when the script has been fully parsed. - */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-15 10:44:08
|
Revision: 689 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=689&view=rev Author: andy_miller Date: 2008-08-15 10:44:11 +0000 (Fri, 15 Aug 2008) Log Message: ----------- First go at Hydrax (0.3) module Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/PythonOgreConfig_system.py trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h trunk/python-ogre/ThirdParty/Hydrax/Module.h trunk/python-ogre/ThirdParty/Hydrax/Noise.h trunk/python-ogre/ThirdParty/Hydrax/Perlin.h trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.h trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.h trunk/python-ogre/code_generators/hydrax/customization_data.py trunk/python-ogre/code_generators/hydrax/generate_code.py trunk/python-ogre/code_generators/hydrax/python_hydrax.h trunk/python-ogre/environment.py trunk/python-ogre/setup.py Added Paths: ----------- trunk/python-ogre/demos/hydrax/ trunk/python-ogre/demos/hydrax/media/ trunk/python-ogre/demos/hydrax/media/Hydrax/ trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_0.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_1.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_10.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_11.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_12.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_13.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_14.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_15.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_16.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_17.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_18.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_19.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_2.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_20.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_21.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_22.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_23.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_24.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_25.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_26.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_27.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_28.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_29.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_3.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_30.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_31.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_4.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_5.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_6.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_7.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_8.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_9.bmp trunk/python-ogre/demos/hydrax/media/Hydrax/Foam.png trunk/python-ogre/demos/hydrax/media/Hydrax/Fresnel.bmp trunk/python-ogre/demos/hydrax/media/materials/ trunk/python-ogre/demos/hydrax/media/materials/programs/ trunk/python-ogre/demos/hydrax/media/materials/programs/OffsetMapping.cg trunk/python-ogre/demos/hydrax/media/materials/scripts/ trunk/python-ogre/demos/hydrax/media/materials/scripts/OffsetMapping.material trunk/python-ogre/demos/hydrax/media/materials/scripts/SkyBox.material trunk/python-ogre/demos/hydrax/media/materials/textures/ trunk/python-ogre/demos/hydrax/media/materials/textures/Island.tga trunk/python-ogre/demos/hydrax/media/materials/textures/IslandNH.tga trunk/python-ogre/demos/hydrax/media/models/ trunk/python-ogre/demos/hydrax/media/models/Island.mesh trunk/python-ogre/demos/hydrax/media/packs/ trunk/python-ogre/demos/hydrax/media/packs/OgreCore.zip trunk/python-ogre/demos/hydrax/media/packs/SkyBoxes.zip trunk/python-ogre/packages_2.5/ogre/addons/hydrax/ trunk/python-ogre/packages_2.5/ogre/addons/hydrax/__init__.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-15 10:44:11 UTC (rev 689) @@ -83,6 +83,8 @@ PATH_particleuniverse = os.path.join(PATH_Ogre, 'PlugIns', 'ParticleUniverse' ) PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) +PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') + # it's time for the SDK version if SDK: PATH_CEGUI = os.path.join(BASE_DIR, 'ogre') @@ -176,6 +178,7 @@ PATH_INCLUDE_ogreforests = PATH_ogreforests PATH_INCLUDE_particleuniverse = os.path.join(PATH_particleuniverse, 'include' ) PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') +PATH_INCLUDE_hydrax= PATH_hydrax PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include') ,os.path.join(BASE_DIR, 'vorbis', 'include') Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-08-15 10:44:11 UTC (rev 689) @@ -79,8 +79,8 @@ PATH_cadunetree= os.path.join(PATH_THIRDPARTY, 'cadunetree') PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) +PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') - ### ### these paths assume you've left all the directory structure as standard ### Override anything that is different @@ -119,8 +119,8 @@ PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') PATH_LIB_opensteer = os.path.join(LOCAL_LIB) PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') +PATH_INCLUDE_hydrax= PATH_hydrax - PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_Ogre_Dependencies = PATH_INCLUDE_Ogre # os.path.join( PATH_Ogre, 'Dependencies/include') Modified: trunk/python-ogre/PythonOgreConfig_system.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_system.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/PythonOgreConfig_system.py 2008-08-15 10:44:11 UTC (rev 689) @@ -62,8 +62,8 @@ PATH_particleuniverse = os.path.join(PATH_Ogre, 'PlugIns', 'ParticleUniverse' ) PATH_cadunetree= os.path.join(PATH_THIRDPARTY, 'cadunetree') PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') +PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') - ### ### these paths assume you've left all the directory structure as standard ### Override anything that is different @@ -97,8 +97,8 @@ PATH_LIB_navi= os.path.join(PATH_navi, 'lib') PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') PATH_LIB_opensteer = os.path.join(LOCAL_LIB) +PATH_INCLUDE_hydrax= PATH_hydrax - PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_Ogre_Dependencies = PATH_INCLUDE_Ogre # os.path.join( PATH_Ogre, 'Dependencies/include') Modified: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-15 10:44:11 UTC (rev 689) @@ -35,7 +35,7 @@ #include "MaterialManager.h" #include "TextureManager.h" #include "DecalsManager.h" -#include "Modules/Module.h" +#include "Module.h" namespace Hydrax { Modified: trunk/python-ogre/ThirdParty/Hydrax/Module.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Module.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/Module.h 2008-08-15 10:44:11 UTC (rev 689) @@ -25,10 +25,10 @@ #ifndef _Hydrax_Module_H_ #define _Hydrax_Module_H_ -#include "../Prerequisites.h" -#include "../Noise/Noise.h" -#include "../Mesh.h" -#include "../MaterialManager.h" +#include "Prerequisites.h" +#include "Noise.h" +#include "Mesh.h" +#include "MaterialManager.h" namespace Hydrax{ namespace Module { Modified: trunk/python-ogre/ThirdParty/Hydrax/Noise.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Noise.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/Noise.h 2008-08-15 10:44:11 UTC (rev 689) @@ -25,7 +25,7 @@ #ifndef _Hydrax_Noise_H_ #define _Hydrax_Noise_H_ -#include "../Prerequisites.h" +#include "Prerequisites.h" namespace Hydrax{ namespace Noise { Modified: trunk/python-ogre/ThirdParty/Hydrax/Perlin.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Perlin.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/Perlin.h 2008-08-15 10:44:11 UTC (rev 689) @@ -29,9 +29,9 @@ #ifndef _Hydrax_Noise_Perlin_H_ #define _Hydrax_Noise_Perlin_H_ -#include "../../Prerequisites.h" +#include "Prerequisites.h" -#include "../Noise.h" +#include "Noise.h" #define n_bits 5 #define n_size (1<<(n_bits-1)) Modified: trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h 2008-08-15 10:44:11 UTC (rev 689) @@ -29,15 +29,15 @@ #include <Ogre.h> /// Define the dll export qualifier if compiling for Windows -#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 - #ifdef HYDRAX_LIB - #define DllExport __declspec (dllexport) - #else - #define DllExport __declspec (dllimport) - #endif -#else +// #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 +// #ifdef HYDRAX_LIB +// #define DllExport __declspec (dllexport) +// #else +// #define DllExport __declspec (dllimport) +// #endif +// #else #define DllExport -#endif +// #endif /// Log macro #define HydraxLOG(msg) Ogre::LogManager::getSingleton().logMessage("[Hydrax] " + Ogre::String(msg)); Modified: trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.h 2008-08-15 10:44:11 UTC (rev 689) @@ -31,11 +31,11 @@ #ifndef _Hydrax_Modules_ProjectedGrid_H_ #define _Hydrax_Modules_projectedGrid_H_ -#include "../../Prerequisites.h" +#include "Prerequisites.h" -#include "../../Hydrax.h" -#include "../../Mesh.h" -#include "../Module.h" +#include "Hydrax.h" +#include "Mesh.h" +#include "Module.h" namespace Hydrax{ namespace Module { Modified: trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.h 2008-08-15 10:44:11 UTC (rev 689) @@ -25,11 +25,11 @@ #ifndef _Hydrax_Modules_SimpleGrid_H_ #define _Hydrax_Modules_SimpleGrid_H_ -#include "../../Prerequisites.h" +#include "Prerequisites.h" -#include "../../Hydrax.h" -#include "../../Mesh.h" -#include "../Module.h" +#include "Hydrax.h" +#include "Mesh.h" +#include "Module.h" namespace Hydrax{ namespace Module { Modified: trunk/python-ogre/code_generators/hydrax/customization_data.py =================================================================== --- trunk/python-ogre/code_generators/hydrax/customization_data.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/code_generators/hydrax/customization_data.py 2008-08-15 10:44:11 UTC (rev 689) @@ -1,6 +1,6 @@ def header_files( version ): - return [ ''] + return [ 'Hydrax.h'] def huge_classes( version ): return [] Modified: trunk/python-ogre/code_generators/hydrax/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/hydrax/generate_code.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/code_generators/hydrax/generate_code.py 2008-08-15 10:44:11 UTC (rev 689) @@ -6,7 +6,7 @@ # ----------------------------------------------------------------------------- ## STARTER TEMPLATE.. -## replace PROJECT with lowercase project name +## replace hydrax with lowercase project name ## set MAIN_NAMESPACE ## rename and configure .h files @@ -40,7 +40,7 @@ import common_utils.ogre_properties as ogre_properties from common_utils import docit -MAIN_NAMESPACE = '' +MAIN_NAMESPACE = 'Hydrax' ############################################################ ## @@ -192,11 +192,11 @@ # NOTE: If you update the source library code you need to manually delete the cache .XML file # xml_cached_fc = parser.create_cached_source_fc( - os.path.join( environment.PROJECT.root_dir, "python_PROJECT.h" ) - , environment.PROJECT.cache_file ) + os.path.join( environment.hydrax.root_dir, "python_hydrax.h" ) + , environment.hydrax.cache_file ) - defined_symbols = [ ] - defined_symbols.append( 'VERSION_' + environment.PROJECT.version ) + defined_symbols = ['OGRE_NONCLIENT_BUILD' ] + defined_symbols.append( 'VERSION_' + environment.hydrax.version ) # # build the core Py++ system from the GCCXML created source @@ -204,10 +204,10 @@ mb = module_builder.module_builder_t( [ xml_cached_fc ] , gccxml_path=environment.gccxml_bin , working_directory=environment.root_dir - , include_paths=environment.PROJECT.include_dirs + , include_paths=environment.hydrax.include_dirs , define_symbols=defined_symbols , indexing_suite_version=2 - , cflags=environment.PROJECT.cflags + , cflags=environment.hydrax.cflags ) # if this module depends on another set it here @@ -250,11 +250,11 @@ if cls.name not in NoPropClasses: cls.add_properties( recognizer=ogre_properties.ogre_property_recognizer_t() ) - common_utils.add_constants( mb, { 'PROJECT_version' : '"%s"' % environment.PROJECT.version.replace("\n", "\\\n") + common_utils.add_constants( mb, { 'hydrax_version' : '"%s"' % environment.hydrax.version.replace("\n", "\\\n") , 'python_version' : '"%s"' % sys.version.replace("\n", "\\\n" ) } ) ## need to create a welcome doc string for this... - common_utils.add_constants( mb, { '__doc__' : '"PROJECT DESCRIPTION"' } ) + common_utils.add_constants( mb, { '__doc__' : '"hydrax DESCRIPTION"' } ) ########################################################################################## @@ -263,23 +263,23 @@ # ########################################################################################## extractor = exdoc.doc_extractor() # I'm excluding the UTFstring docs as lots about nothing - mb.build_code_creator (module_name='_PROJECT_' , doc_extractor= extractor ) + mb.build_code_creator (module_name='_hydrax_' , doc_extractor= extractor ) - for inc in environment.PROJECT.include_dirs: + for inc in environment.hydrax.include_dirs: mb.code_creator.user_defined_directories.append(inc ) - mb.code_creator.user_defined_directories.append( environment.PROJECT.generated_dir ) - mb.code_creator.replace_included_headers( customization_data.header_files( environment.PROJECT.version ) ) + mb.code_creator.user_defined_directories.append( environment.hydrax.generated_dir ) + mb.code_creator.replace_included_headers( customization_data.header_files( environment.hydrax.version ) ) - huge_classes = map( mb.class_, customization_data.huge_classes( environment.PROJECT.version ) ) + huge_classes = map( mb.class_, customization_data.huge_classes( environment.hydrax.version ) ) - mb.split_module(environment.PROJECT.generated_dir, huge_classes, use_files_sum_repository=False) + mb.split_module(environment.hydrax.generated_dir, huge_classes, use_files_sum_repository=False) ## now we need to ensure a series of headers and additional source files are ## copied to the generated directory.. -# common_utils.copyTree ( sourcePath = environment.Config.PATH_INCLUDE_PROJECT, -# destPath = environment.PROJECT.generated_dir, -# recursive=False ) + common_utils.copyTree ( sourcePath = environment.Config.PATH_INCLUDE_hydrax, + destPath = environment.hydrax.generated_dir, + recursive= False ) if __name__ == '__main__': start_time = time.clock() Modified: trunk/python-ogre/code_generators/hydrax/python_hydrax.h =================================================================== --- trunk/python-ogre/code_generators/hydrax/python_hydrax.h 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/code_generators/hydrax/python_hydrax.h 2008-08-15 10:44:11 UTC (rev 689) @@ -1,18 +1,18 @@ -#include "PROJECT MASTER.h" +#include "Hydrax.h" // First we create a magic namespace to hold all our aliases namespace pyplusplus { namespace aliases { - #include "python_PROJECT_aliases.h" + #include "python_hydrax_aliases.h" } } // then we exposed everything needed (and more) to ensure GCCXML makes them visible to Py++ // -namespace python_PROJECT{ namespace details{ +namespace python_hydrax{ namespace details{ inline void instantiate(){ - using namespace PROJECT; - #include "python_PROJECT_sizeof.h" + using namespace Hydrax; + #include "python_hydrax_sizeof.h" } } } Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_0.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_1.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_10.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_11.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_12.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_13.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_14.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_15.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_16.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_17.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_18.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_19.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_2.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_20.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_21.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_22.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_23.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_24.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_25.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_26.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_27.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_28.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_29.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_3.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_30.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_31.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_4.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_5.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_6.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_7.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_8.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Caustics_9.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Foam.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/Hydrax/Fresnel.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/hydrax/media/materials/programs/OffsetMapping.cg =================================================================== --- trunk/python-ogre/demos/hydrax/media/materials/programs/OffsetMapping.cg (rev 0) +++ trunk/python-ogre/demos/hydrax/media/materials/programs/OffsetMapping.cg 2008-08-15 10:44:11 UTC (rev 689) @@ -0,0 +1,100 @@ +/* Bump mapping with Parallax offset vertex program + In this program, we want to calculate the tangent space light end eye vectors + which will get passed to the fragment program to produce the per-pixel bump map + with parallax offset effect. +*/ + +/* Vertex program that moves light and eye vectors into texture tangent space at vertex */ + +void main_vp(float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 tangent : TANGENT0, + // outputs + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float3 oLightDir : TEXCOORD1, // tangent space + out float3 oEyeDir : TEXCOORD2, // tangent space + out float3 oHalfAngle : TEXCOORD3, // + // parameters + uniform float4 lightPosition, // object space + uniform float3 eyePosition, // object space + uniform float4x4 worldViewProj) +{ + // calculate output position + oPosition = mul(worldViewProj, position); + + // pass the main uvs straight through unchanged + oUv = uv*float2(8, 8); + + // calculate tangent space light vector + // Get object space light direction + float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w)); + float3 eyeDir = eyePosition - position.xyz; + + // Calculate the binormal (NB we assume both normal and tangent are + // already normalised) + // NB looks like nvidia cross params are BACKWARDS to what you'd expect + // this equates to NxT, not TxN + float3 binormal = cross(tangent, normal); + + // Form a rotation matrix out of the vectors + float3x3 rotation = float3x3(tangent, binormal, normal); + + // Transform the light vector according to this matrix + lightDir = normalize(mul(rotation, lightDir)); + eyeDir = normalize(mul(rotation, eyeDir)); + + oLightDir = lightDir; + oEyeDir = eyeDir; + oHalfAngle = normalize(eyeDir + lightDir); +} + +// General functions + +// Expand a range-compressed vector +float3 expand(float3 v) +{ + return (v - 0.5) * 2; +} + +void main_fp(float2 uv : TEXCOORD0, + float3 lightDir : TEXCOORD1, + float3 eyeDir : TEXCOORD2, + float3 halfAngle : TEXCOORD3, + uniform float3 lightDiffuse, + uniform float3 lightSpecular, + uniform float4 scaleBias, + uniform sampler2D normalHeightMap, + uniform sampler2D diffuseMap, + out float4 oColor : COLOR) +{ + // get the height using the tex coords + float height = tex2D(normalHeightMap, uv).a; + + // scale and bias factors + float scale = scaleBias.x; + float bias = scaleBias.y; + + // calculate displacement + float displacement = (height * scale) + bias; + + float3 uv2 = float3(uv, 1); + + // calculate the new tex coord to use for normal and diffuse + float2 newTexCoord = ((eyeDir * displacement) + uv2).xy; + + // get the new normal and diffuse values + float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz); + float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz; + + float3 specular = pow(saturate(dot(normal, halfAngle)), 32) * lightSpecular; + float diff = saturate(dot(normal, lightDir)); + if(diff<0.3) + diff = 0.3; + float3 col = diffuse * diff * lightDiffuse + specular; + + oColor = float4(col, 1); +} + + Added: trunk/python-ogre/demos/hydrax/media/materials/scripts/OffsetMapping.material =================================================================== --- trunk/python-ogre/demos/hydrax/media/materials/scripts/OffsetMapping.material (rev 0) +++ trunk/python-ogre/demos/hydrax/media/materials/scripts/OffsetMapping.material 2008-08-15 10:44:11 UTC (rev 689) @@ -0,0 +1,60 @@ +// Bump map with Parallax offset vertex program, support for this is required +vertex_program Examples/OffsetMappingVP cg +{ + source OffsetMapping.cg + entry_point main_vp + profiles vs_1_1 arbvp1 +} + +// Bump map with parallax fragment program +fragment_program Examples/OffsetMappingFP cg +{ + source OffsetMapping.cg + entry_point main_fp + profiles ps_2_0 arbfp1 +} + +material Examples/OffsetMapping/Specular +{ + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // do the lighting and bump mapping with parallax pass + pass + { + + // Vertex program reference + vertex_program_ref Examples/OffsetMappingVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto eyePosition camera_position_object_space + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref Examples/OffsetMappingFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto lightSpecular light_specular_colour 0 + // Parallax Height scale and bias + param_named scaleBias float4 0.04 -0.02 1 0 + } + + // Normal + height(alpha) map + texture_unit + { + texture IslandNH.tga + tex_coord_set 0 + } + + // Base diffuse texture map + texture_unit + { + texture Island.tga + tex_coord_set 1 + } + } + } +} Added: trunk/python-ogre/demos/hydrax/media/materials/scripts/SkyBox.material =================================================================== --- trunk/python-ogre/demos/hydrax/media/materials/scripts/SkyBox.material (rev 0) +++ trunk/python-ogre/demos/hydrax/media/materials/scripts/SkyBox.material 2008-08-15 10:44:11 UTC (rev 689) @@ -0,0 +1,107 @@ +material Sky/Evening +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture evening.jpg separateUV + tex_address_mode clamp + } + } + } +} + +material Sky/EarlyMorning +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture early_morning.jpg separateUV + tex_address_mode clamp + } + } + } +} + +material Sky/Morning +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture morning.jpg separateUV + tex_address_mode clamp + } + } + } +} + +material Sky/Stormy +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture stormy.jpg separateUV + tex_address_mode clamp + } + } + } +} + +material Sky/ClubTropicana +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture ct.png separateUV + tex_address_mode clamp + } + } + } +} + +material Sky/Clouds +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture clouds.png separateUV + tex_address_mode clamp + } + } + } +} Property changes on: trunk/python-ogre/demos/hydrax/media/materials/textures/Island.tga ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/materials/textures/IslandNH.tga ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/models/Island.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/packs/OgreCore.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/python-ogre/demos/hydrax/media/packs/SkyBoxes.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/environment.py 2008-08-15 10:44:11 UTC (rev 689) @@ -1632,19 +1632,15 @@ name='hydrax' parent="ogre/addons" cflags = "" - try: - include_dirs = [ Config.PATH_Boost, - Config.PATH_hydrax - , Config.PATH_INCLUDE_Ogre - ] - lib_dirs = [Config.PATH_LIB_Boost, - Config.PATH_LIB_hydrax, - Config.PATH_LIB_Ogre_OgreMain + include_dirs = [ Config.PATH_Boost, + Config.PATH_INCLUDE_hydrax + , Config.PATH_INCLUDE_Ogre ] - except: - pass + lib_dirs = [Config.PATH_LIB_Boost, + Config.PATH_LIB_Ogre_OgreMain + ] CheckIncludes=[] - libs=[ boost.lib, 'OgreMain', 'hydrax' ] + libs=[ boost.lib, 'OgreMain' ] ModuleName="hydrax" ############################################################################################ @@ -1686,6 +1682,7 @@ , 'cadunetree' : cadunetree ,'opensteer' : opensteer ,'ogrepcz' : ogrepcz + , 'hydrax' : hydrax } # Added: trunk/python-ogre/packages_2.5/ogre/addons/hydrax/__init__.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/addons/hydrax/__init__.py (rev 0) +++ trunk/python-ogre/packages_2.5/ogre/addons/hydrax/__init__.py 2008-08-15 10:44:11 UTC (rev 689) @@ -0,0 +1 @@ +from _hydrax_ import * Modified: trunk/python-ogre/setup.py =================================================================== --- trunk/python-ogre/setup.py 2008-08-15 08:08:10 UTC (rev 688) +++ trunk/python-ogre/setup.py 2008-08-15 10:44:11 UTC (rev 689) @@ -72,7 +72,7 @@ 'ogre.addons.ogreforests', 'ogre.addons.et', 'ogre.addons.caelum', 'ogre.addons.noise', 'ogre.addons.watermesh', 'ogre.addons.ofusion', 'ogre.addons.particleuniverse', 'ogre.addons.cadunetree', - 'ogre.renderer.ogrepcz' ], + 'ogre.renderer.ogrepcz', 'ogre.addons.hydrax' ], "package_dir": {'': 'packages_'+ PythonVersionString }, "package_data": {'': ['*.pyd', '*.dll', '*.so']} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-15 08:04:07
|
Revision: 687 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=687&view=rev Author: andy_miller Date: 2008-08-15 08:04:11 +0000 (Fri, 15 Aug 2008) Log Message: ----------- Updates to Caelum (R282), Forests/PagedGeomerty (R2490) and preparing to put Hydrax 0.3 in the svn Modified Paths: -------------- trunk/python-ogre/ThirdParty/caelum/Astronomy.h trunk/python-ogre/ThirdParty/caelum/CaelumExceptions.h trunk/python-ogre/ThirdParty/caelum/CaelumSystem.cpp trunk/python-ogre/ThirdParty/caelum/CaelumSystem.h trunk/python-ogre/ThirdParty/caelum/FlatCloudLayer.cpp trunk/python-ogre/ThirdParty/caelum/ImageStarfield.cpp trunk/python-ogre/ThirdParty/caelum/ImageStarfield.h trunk/python-ogre/ThirdParty/caelum/Moon.cpp trunk/python-ogre/ThirdParty/caelum/PointStarfield.cpp trunk/python-ogre/ThirdParty/caelum/PrecipitationController.cpp trunk/python-ogre/ThirdParty/caelum/PrecipitationController.h trunk/python-ogre/ThirdParty/caelum/UniversalClock.cpp trunk/python-ogre/ThirdParty/caelum/UniversalClock.h trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/code_generators/ogre/python_ogre_aliases.h Removed Paths: ------------- trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp trunk/python-ogre/ThirdParty/Hydrax/Enums.h trunk/python-ogre/ThirdParty/Hydrax/Help.cpp trunk/python-ogre/ThirdParty/Hydrax/Help.h trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h trunk/python-ogre/ThirdParty/Hydrax/Mesh.cpp trunk/python-ogre/ThirdParty/Hydrax/Mesh.h trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp trunk/python-ogre/ThirdParty/Hydrax/Perlin.h trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.cpp trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h trunk/python-ogre/ThirdParty/Hydrax/Structs.cpp trunk/python-ogre/ThirdParty/Hydrax/Structs.h Deleted: trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp 2008-08-15 08:04:11 UTC (rev 687) @@ -1,31 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#include "Enums.h" - -namespace Hydrax -{ - -} Deleted: trunk/python-ogre/ThirdParty/Hydrax/Enums.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Enums.h 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Enums.h 2008-08-15 08:04:11 UTC (rev 687) @@ -1,69 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#ifndef _Enums_H_ -#define _Enums_H_ - -#include "Prerequisites.h" - -namespace Hydrax -{ - /** Texture quality enumeration(2^n) - */ - enum DllExport TextureQuality - { - TEX_QUA_2 = 2, - TEX_QUA_4 = 4, - TEX_QUA_8 = 8, - TEX_QUA_16 = 16, - TEX_QUA_32 = 32, - TEX_QUA_64 = 64, - TEX_QUA_128 = 128, - TEX_QUA_256 = 256, - TEX_QUA_512 = 512, - TEX_QUA_1024 = 1024 - }; - - /** Hydrax flags for select the components - that we want to use. - 0 for none, 1 for all. - */ - enum DllExport HydraxComponent - { - HYDRAX_COMPONENT_SUN = 1 << 0, - HYDRAX_COMPONENT_FOAM = 1 << 1, - HYDRAX_COMPONENT_DEPTH = 1 << 2, - /// Smooth transitions needs depth component - HYDRAX_COMPONENT_SMOOTH = 1 << 3, - HYDRAX_COMPONENT_CAUSTICS = 1 << 4, - /// See documentation - HYDRAX_COMPONENT_PLSM2 = 1 << 5, - - HYDRAX_COMPONENTS_NONE = 0x0000, - HYDRAX_COMPONENTS_ALL = 0x001F, - }; -} - -#endif Deleted: trunk/python-ogre/ThirdParty/Hydrax/Help.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Help.cpp 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Help.cpp 2008-08-15 08:04:11 UTC (rev 687) @@ -1,31 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#include "Help.h" - -namespace Hydrax -{ - -} Deleted: trunk/python-ogre/ThirdParty/Hydrax/Help.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Help.h 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Help.h 2008-08-15 08:04:11 UTC (rev 687) @@ -1,193 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#ifndef _Help_H_ -#define _Help_H_ - -#include "Prerequisites.h" - -#include "../noise/noise.h" -#include "../noise/noiseutils.h" - -namespace Hydrax -{ - /** Struct wich contains an especific width and height value - */ - struct DllExport Size - { - /// Width value - int Width; - /// Height value - int Height; - - /** Default constructor - */ - Size() - { - Width = 0; - Height = 0; - } - - /** Constructor - @param size The width and height values - */ - Size(int size) - { - Width = size; - Height = size; - } - - /** Constructor - @param width Width value - @param height Height value - */ - Size(int width, int height) - { - Width = width; - Height = height; - } - - /** Destructor - */ - ~Size() - { - } - - /** Sets the same width and height value - @param size The width and height values - */ - void setSize(int size) - { - Width = size; - Height = size; - } - - /** Sets the especified values - @param width Width value - @param height Height value - */ - void setSize(int width, int height) - { - Width = width; - Height = height; - } - }; - - /** Struct for store a float** data pointer, its size and its normal map - */ - struct DllExport NoiseBuffer - { - /// Our float pointer data - float** mData; - /// Size - Size mSize; - /// Normal map(its use is optional) - noise::utils::Image mNormalMap; - - /** Default constructor - */ - NoiseBuffer() : mData(0) - { - } - - /** Destructor - */ - ~NoiseBuffer() - { - if (mData) - { - for (int k = 0; k < mSize.Width; k++) - { - delete[] mData[k]; - } - - delete[] mData; - } - } - - /** Constructor - @param Data Data pointer - @param Size Data bidimensional array width/height size - */ - NoiseBuffer(float **Data, Size Size) - { - mData = Data; - mSize = Size; - } - - /** Constructor - @param Data Data pointer - @param Size Data bidimensional array width/height size - @param NormalMap noise::utils::Image that contains our data image normal map - */ - NoiseBuffer(float **Data, Size Size, noise::utils::Image NormalMap) - { - mData = Data; - mSize = Size; - mNormalMap = NormalMap; - } - - /** Set data and size - @param Data Data pointer - @param Size Data bidimensional array width/height size - */ - void Set(float **Data, Size Size) - { - mData = Data; - mSize = Size; - } - - /** Set data, size and normal map image - @param Data Data pointer - @param Size Data bidimensional array width/height size - @param NormalMap noise::utils::Image that contains our data image normal map - */ - void Set(float **Data, Size Size, noise::utils::Image NormalMap) - { - mData = Data; - mSize = Size; - mNormalMap = NormalMap; - } - - /** Get our data pointer - @return Data float** pointer - */ - float** getData() - { - return mData; - } - - /** Get float value from an especific x/y coordinates - @return x/y value of our data - */ - float getData(int x, int y) - { - return mData[x][y]; - } - - }; -} - -#endif Deleted: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp 2008-08-15 08:04:11 UTC (rev 687) @@ -1,1316 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#include "Hydrax.h" - -namespace Hydrax -{ - - Hydrax::Hydrax(Ogre::SceneManager *sm, Ogre::Camera *c) - : mSceneManager(sm) - , mCamera(c) - , mCreated(false) - , mPolygonMode(0) - , mPosition(Ogre::Vector3(0,0,0)) - , mPlanesError(0) - , mVelocity(9.75) - , mFullReflectionDistance(90000000) - , mGlobalTransparency(0.05) - , mNormalDistortion(0.09) - , mSunPosition(Ogre::Vector3(5000,3000,1)) - , mSunStrength(1.75) - , mSunArea(150) - , mSunColor(Ogre::Vector3(1,0.75,0.25)) - , mFoamMaxDistance(75000000) - , mFoamScale(50) - , mFoamStart(0.5) - , mFoamTransparency(1.275) - , mDepthLimit(0) - , mDepthColor(Ogre::Vector3(0,0.1,0.172)) - , mSmoothPower(30) - , mCausticsScale(20) - , mCausticsPower(15) - , mCausticsEnd(0.55) - , mActualTexScrollPosition(0) - , mMesh(new Mesh(sm)) - , mSceneNode(0) - , mRefractionPlane(0) - , mReflectionPlane(0) - , mDepthPlane(0) - , mTextureRefraction(0) - , mTextureReflection(0) - , mTextureDepth(0) - , mPlanesSceneNode(0) - , mComponents(HYDRAX_COMPONENTS_NONE) - { - LOG("[Hydrax] Hydrax object created."); - } - - Hydrax::~Hydrax() - { - if (mSceneNode) - { - mSceneNode->detachAllObjects(); - mSceneNode->getParentSceneNode()->removeAndDestroyChild(mSceneNode->getName()); - - Ogre::TextureManager::getSingleton().remove("HydraxHeight"); - Ogre::TextureManager::getSingleton().remove("HydraxNormalMap"); - - delete mMesh; - } - - if (mPlanesSceneNode) - { - mPlanesSceneNode->detachAllObjects(); - mPlanesSceneNode->getParentSceneNode()->removeAndDestroyChild(mPlanesSceneNode->getName()); - - Ogre::RenderTarget* mRT_TextureRefraction = mTextureRefraction->getBuffer()->getRenderTarget(); - mRT_TextureRefraction->removeAllListeners(); - mRT_TextureRefraction->removeAllViewports(); - - Ogre::RenderTarget* mRT_TextureReflection = mTextureReflection->getBuffer()->getRenderTarget(); - mRT_TextureReflection->removeAllListeners(); - mRT_TextureReflection->removeAllViewports(); - - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); - mRT_TextureDepth->removeAllListeners(); - mRT_TextureDepth->removeAllViewports(); - - Ogre::TextureManager::getSingleton().remove("Depth"); - - Ogre::MeshManager::getSingleton().remove("DepthClipPlane"); - } - - Ogre::TextureManager::getSingleton().remove("Reflection"); - Ogre::TextureManager::getSingleton().remove("Refraction"); - - Ogre::MeshManager::getSingleton().remove("RefractionClipPlane"); - Ogre::MeshManager::getSingleton().remove("ReflectionClipPlane"); - } - - mNoiseBuffer[2].Set(mPerlin.getFreeData(), mPerlin.mSize); - mNoiseBuffer.clear(); - - LOG("[Hydrax] Hydrax object removed."); - } - - void Hydrax::create() - { - if (isCreated()) - { - LOG("[Hydrax] Hydrax alredy created, skipping..."); - - return; - } - - LOG("[Hydrax] Creating perlin noise textures and normal maps."); - _createTextures(); - _updateTextures(0); - LOG("[Hydrax] Perlin noise textures and normal maps created."); - - LOG("[Hydrax] Creating water mesh."); - mSceneNode = mSceneManager->getRootSceneNode()->createChildSceneNode(); - mMesh->create(mSceneNode); - mMesh->update(mNoiseBuffer[2]); - LOG("[Hydrax] Water mesh created"); - - LOG("[Hydrax] Creating RTListeners."); - _createRttListeners(); - LOG("[Hydrax] RTListeners created"); - - mCreated = true; - } - - void Hydrax::_createTextures() - { - mPerlin.setSize(mPerlinOptions.TexQuality, mPerlinOptions.TexQuality); - - mNoiseBuffer.reserve(3); - mNoiseBuffer.resize(3); - - mPerlin.mPerlinModule.SetFrequency(mPerlinOptions.Frecuency); - mPerlin.mPerlinModule.SetPersistence(mPerlinOptions.Persistence); - mPerlin.mPerlinModule.SetOctaveCount(mPerlinOptions.Octave); - mPerlin.mPerlinModule.SetLacunarity(mPerlinOptions.Lacunarity); - - mPerlin.createPerlinTexture(Ogre::String("HydraxHeight")); - mPerlin.createNMTexture(Ogre::String("HydraxNormalMap")); - - mPerlin.mPerlinModule.SetSeed(0); - mNoiseBuffer[0].Set(mPerlin.getData(true), mPerlin.mSize, mPerlin.getNormalMap(mPerlinOptions.NMHeight, true)); - mPerlin.mPerlinModule.SetSeed(1); - mNoiseBuffer[1].Set(mPerlin.getData(true), mPerlin.mSize, mPerlin.getNormalMap(mPerlinOptions.NMHeight, true)); - mNoiseBuffer[2].Set(mPerlin.getFreeData(), mPerlin.mSize); - mNoiseBuffer[2].mNormalMap.SetSize(mPerlin.mSize.Width, mPerlin.mSize.Height); - } - - void Hydrax::_updateTextures(Ogre::Real timeSinceLastFrame) - { - int x, y, newY1, newY1a, newY2, newY2a; - float a, b, c, d, diff, diffb; - - float** OriginalA = mNoiseBuffer[0].mData; - float** OriginalB = mNoiseBuffer[1].mData; - - diff = (mActualTexScrollPosition - static_cast<int>(mActualTexScrollPosition))/2; // Divide by 2 to avoid it in: mNoiseBuffer[2].mData[x][y] = (c+d)/2; - diffb = 0.5 - diff; - - for (y = 0; y < mNoiseBuffer[0].mSize.Height; y ++) - { - newY1 = y + static_cast<int>(mActualTexScrollPosition); - if (newY1>mNoiseBuffer[0].mSize.Height-1) - { - newY1-=mNoiseBuffer[0].mSize.Height; - } - - newY1a = (y+1) + static_cast<int>(mActualTexScrollPosition); - if (newY1a>mNoiseBuffer[0].mSize.Height-1) - { - newY1a-=mNoiseBuffer[0].mSize.Height; - } - - newY2 = y - static_cast<int>(mActualTexScrollPosition); - if (newY2<0) - { - newY2+=mNoiseBuffer[0].mSize.Height-1; - } - - newY2a = (y+1) - static_cast<int>(mActualTexScrollPosition); - if (newY2a<0) - { - newY2a+=mNoiseBuffer[0].mSize.Height-1; - } - if (newY2a>mNoiseBuffer[0].mSize.Height-1) - { - newY2a-=mNoiseBuffer[0].mSize.Height; - } - - for (x = 0; x < mNoiseBuffer[0].mSize.Width; x ++) - { - a = OriginalA[newY1][x]; - b = OriginalA[newY1a][x]; - - c=a*diffb+ b*diff; - - a = OriginalB[newY2][x]; - b = OriginalB[newY2a][x]; - - d=a*diff + b*diffb; - - mNoiseBuffer[2].mData[y][x] = (c+d); - } - } - - mActualTexScrollPosition += mVelocity*timeSinceLastFrame; - - if (mActualTexScrollPosition>mNoiseBuffer[0].mSize.Height) - { - mActualTexScrollPosition = 0; - } - - mPerlin.updatePerlinTexture(mNoiseBuffer[2].mData); - _updateNM(); - } - - void Hydrax::_updateNM() - { - int x, y, newY1, newY1a, newY2, newY2a; - float diff, diffb; - - diff = (mActualTexScrollPosition - static_cast<int>(mActualTexScrollPosition))/2; // Divide by 2 to avoid it in the bucle - diffb = 0.5 - diff; - - for (y = 0; y < mNoiseBuffer[0].mSize.Height; y ++) - { - newY1 = y + static_cast<int>(mActualTexScrollPosition); - if (newY1>mNoiseBuffer[0].mSize.Height-1) - { - newY1-=mNoiseBuffer[0].mSize.Height; - } - - newY1a = y+1 + static_cast<int>(mActualTexScrollPosition); - if (newY1a>mNoiseBuffer[0].mSize.Height-1) - { - newY1a-=mNoiseBuffer[0].mSize.Height; - } - - newY2 = y - static_cast<int>(mActualTexScrollPosition); - if (newY2<0) - { - newY2+=mNoiseBuffer[0].mSize.Height-1; - } - - newY2a = (y+1) - static_cast<int>(mActualTexScrollPosition); - if (newY2a<0) - { - newY2a+=mNoiseBuffer[0].mSize.Height-1; - } - if (newY2a>mNoiseBuffer[0].mSize.Height-1) - { - newY2a-=mNoiseBuffer[0].mSize.Height; - } - - for (x = 0; x < mNoiseBuffer[0].mSize.Width; x ++) - { - noise::utils::Color c = - noise::utils::Color( - // Red - (( mNoiseBuffer[1].mNormalMap.GetValue(newY1,x).red *diffb + mNoiseBuffer[1].mNormalMap.GetValue(newY1a,x).red *diff ) - +(mNoiseBuffer[0].mNormalMap.GetValue(newY2,x).red *diff + mNoiseBuffer[0].mNormalMap.GetValue(newY2a,x).red *diffb)), - // Green - (( mNoiseBuffer[1].mNormalMap.GetValue(newY1,x).green *diffb + mNoiseBuffer[1].mNormalMap.GetValue(newY1a,x).green *diff ) - +(mNoiseBuffer[0].mNormalMap.GetValue(newY2,x).green *diff + mNoiseBuffer[0].mNormalMap.GetValue(newY2a,x).green *diffb)), - // Blue - (( mNoiseBuffer[1].mNormalMap.GetValue(newY1,x).blue *diffb + mNoiseBuffer[1].mNormalMap.GetValue(newY1a,x).blue *diff ) - +(mNoiseBuffer[0].mNormalMap.GetValue(newY2,x).blue *diff + mNoiseBuffer[0].mNormalMap.GetValue(newY2a,x).blue *diffb)), - // Alpha - 255); - - mNoiseBuffer[2].mNormalMap.SetValue(y,x,c); - } - } - - mPerlin.updateNMTexture(mNoiseBuffer[2].mNormalMap); - } - - void Hydrax::_createRttListeners() - { - if (!isCreated()) - { - mRefractionPlane = new Ogre::MovablePlane("RefractionPlane"); - mReflectionPlane = new Ogre::MovablePlane("ReflectionPlane"); - - mRefractionPlane->d = 0; - mReflectionPlane->d = 0; - - mRefractionPlane->normal = Ogre::Vector3::NEGATIVE_UNIT_Y; - mReflectionPlane->normal = Ogre::Vector3::UNIT_Y; - - Ogre::MeshManager::getSingleton().createPlane( - "RefractionClipPlane",Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - *mRefractionPlane, - mMesh->getSize().Width,mMesh->getSize().Height, - 10,10,true,1,5,5,Ogre::Vector3::UNIT_Z); - - Ogre::MeshManager::getSingleton().createPlane( - "ReflectionClipPlane",Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - *mReflectionPlane, - mMesh->getSize().Width,mMesh->getSize().Height, - 10,10,true,1,5,5,Ogre::Vector3::UNIT_Z); - - mRefractionPlane->setCastShadows(false); - mReflectionPlane->setCastShadows(false); - - mPlanesSceneNode = mSceneManager->getRootSceneNode()->createChildSceneNode(); - mPlanesSceneNode->attachObject(mRefractionPlane); - mPlanesSceneNode->attachObject(mReflectionPlane); - - mReflectionListener.mHydrax = this; - mRefractionListener.mHydrax = this; - } - - Ogre::TextureManager::getSingleton().remove("Reflection"); - Ogre::TextureManager::getSingleton().remove("Refraction"); - - mTextureRefraction = Ogre::TextureManager::getSingleton().createManual( - "Refraction", - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - Ogre::TEX_TYPE_2D, - mRttOptions.RefractionQuality, mRttOptions.RefractionQuality, 0, - Ogre::PF_R8G8B8, - Ogre::TU_RENDERTARGET); - - Ogre::RenderTarget* mRT_TextureRefraction = mTextureRefraction->getBuffer()->getRenderTarget(); - { - Ogre::Viewport *v = mRT_TextureRefraction->addViewport(mCamera); - v->setClearEveryFrame(true); - v->setBackgroundColour(Ogre::ColourValue::White); - v->setOverlaysEnabled(false); - - mRT_TextureRefraction->addListener(&mRefractionListener); - - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - Ogre::TextureUnitState* t = mat->getTechnique(0)->getPass(0)->getTextureUnitState(2); - t->setTextureName("Refraction"); - } - - mTextureReflection = Ogre::TextureManager::getSingleton().createManual( - "Reflection", - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - Ogre::TEX_TYPE_2D, - mRttOptions.ReflectionQuality, mRttOptions.ReflectionQuality, 0, - Ogre::PF_R8G8B8, - Ogre::TU_RENDERTARGET); - - Ogre::RenderTarget* mRT_TextureReflection = mTextureReflection->getBuffer()->getRenderTarget(); - { - Ogre::Viewport *v = mRT_TextureReflection->addViewport(mCamera); - v->setClearEveryFrame(true); - v->setBackgroundColour(Ogre::ColourValue::White); - v->setOverlaysEnabled(false); - - mRT_TextureReflection->addListener(&mReflectionListener); - - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - Ogre::TextureUnitState* t = mat->getTechnique(0)->getPass(0)->getTextureUnitState(1); - t->setTextureName("Reflection"); - } - - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - _createDepthRttListener(); - } - } - - void Hydrax::_createDepthRttListener(bool Create, bool Delete) - { - if (Create) - { - Ogre::TextureManager::getSingleton().remove("Depth"); - - if (!isCreated()) - { - mDepthPlane = new Ogre::MovablePlane("DepthPlane"); - - mDepthPlane->d = 0; - mDepthPlane->normal = Ogre::Vector3::NEGATIVE_UNIT_Y; - - Ogre::MeshManager::getSingleton().createPlane( - "DepthClipPlane",Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - *mDepthPlane, - mMesh->getSize().Width,mMesh->getSize().Height, - 10,10,true,1,5,5,Ogre::Vector3::UNIT_Z); - - mDepthPlane->setCastShadows(false); - - mPlanesSceneNode->attachObject(mDepthPlane); - - mDepthListener.mHydrax = this; - } - - mTextureDepth = Ogre::TextureManager::getSingleton().createManual( - "Depth", - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - Ogre::TEX_TYPE_2D, - mRttOptions.DepthQuality, mRttOptions.DepthQuality, 0, - Ogre::PF_R8G8B8, - Ogre::TU_RENDERTARGET); - - Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); - { - Ogre::Viewport *v = mRT_TextureDepth->addViewport(mCamera); - v->setClearEveryFrame(true); - v->setBackgroundColour(Ogre::ColourValue::White); - v->setOverlaysEnabled(false); - v->setMaterialScheme("Depth"); - - mRT_TextureDepth->addListener(&mDepthListener); - - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - Ogre::TextureUnitState* t = mat->getTechnique(0)->getPass(0)->getTextureUnitState(3); - t->setTextureName("Depth"); - } - - } - if (Delete) - { - Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); - mRT_TextureDepth->removeAllListeners(); - mRT_TextureDepth->removeAllViewports(); - - Ogre::TextureManager::getSingleton().remove("Depth"); - - Ogre::MeshManager::getSingleton().remove("DepthClipPlane"); - } - } - - void Hydrax::CReflectionListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) - { - mHydrax->mMesh->getEntity()->setVisible(false); - mHydrax->mReflectionPlane->getParentNode()->translate(0,mHydrax->mPlanesError,0); - - mHydrax->mCamera->enableReflection(mHydrax->mReflectionPlane); - mHydrax->mCamera->enableCustomNearClipPlane(mHydrax->mReflectionPlane); - } - - void Hydrax::CReflectionListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) - { - mHydrax->mMesh->getEntity()->setVisible(true); - mHydrax->mReflectionPlane->getParentNode()->translate(0,-mHydrax->mPlanesError,0); - - mHydrax->mCamera->disableReflection(); - mHydrax->mCamera->disableCustomNearClipPlane(); - } - - void Hydrax::CRefractionListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) - { - mHydrax->mMesh->getEntity()->setVisible(false); - mHydrax->mRefractionPlane->getParentNode()->translate(0,mHydrax->mPlanesError,0); - - mHydrax->mCamera->enableCustomNearClipPlane(mHydrax->mRefractionPlane); - } - - void Hydrax::CRefractionListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) - { - mHydrax->mMesh->getEntity()->setVisible(true); - mHydrax->mRefractionPlane->getParentNode()->translate(0,-mHydrax->mPlanesError,0); - - mHydrax->mCamera->disableCustomNearClipPlane(); - } - - void Hydrax::CDepthListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) - { - mHydrax->mMesh->getEntity()->setVisible(false); - - Ogre::SceneManager::MovableObjectIterator it = mHydrax->mSceneManager->getMovableObjectIterator("Entity"); - - Ogre::Entity* cur; - mMaterials.empty(); - - while (it.hasMoreElements()) - { - cur = dynamic_cast<Ogre::Entity*>(it.peekNextValue()); - mMaterials.push(cur->getSubEntity(0)->getMaterialName()); - - if (mHydrax->isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - cur->getSubEntity(0)->setMaterialName("HydraxShaderDepthCaustics"); - } - else - { - cur->getSubEntity(0)->setMaterialName("HydraxShaderDepth"); - } - - it.moveNext(); - } - - mHydrax->mDepthPlane->getParentNode()->translate(0,mHydrax->mPlanesError,0); - mHydrax->mCamera->enableCustomNearClipPlane(mHydrax->mDepthPlane); - } - - void Hydrax::CDepthListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) - { - Ogre::SceneManager::MovableObjectIterator it = mHydrax->mSceneManager->getMovableObjectIterator("Entity"); - - Ogre::Entity* cur; - - while (it.hasMoreElements()) - { - std::string name = mMaterials.front(); - - cur = dynamic_cast<Ogre::Entity*>(it.peekNextValue()); - if (Ogre::MaterialManager::getSingleton().resourceExists(name)) - cur->setMaterialName(name); - - mMaterials.pop(); - it.moveNext(); - } - - mHydrax->mMesh->getEntity()->setVisible(true); - - mHydrax->mCamera->disableCustomNearClipPlane(); - mHydrax->mDepthPlane->getParentNode()->translate(0,-mHydrax->mPlanesError,0); - } - - void Hydrax::setPerlinOptions(PerlinOptions PerlinOptions) - { - mPerlinOptions = PerlinOptions; - - if (isCreated()) - { - LOG("[Hydrax] Updating perlin options."); - - Ogre::TextureManager::getSingleton().remove("HydraxHeight"); - Ogre::TextureManager::getSingleton().remove("HydraxNormalMap"); - - mNoiseBuffer.clear(); - - _createTextures(); - _updateTextures(0); - - LOG("[Hydrax] Perlin options updated."); - } - } - - void Hydrax::setMeshOptions(MeshOptions MeshOptions) - { - if (isCreated()) - { - Ogre::String MaterialNameTmp = mMesh->getMaterialName(); - - LOG("[Hydrax] Updating water mesh."); - LOG("[Hydrax] Deleting water mesh."); - - delete mMesh; - - LOG("[Hydrax] Water mesh deleted."); - - LOG("[Hydrax] Creating water mesh."); - mMesh = new Mesh(mSceneManager); - mMesh->setMeshOptions(MeshOptions); - mMesh->setMaterialName(MaterialNameTmp); - mMesh->create(mSceneNode); - setPosition(mPosition); - mMesh->update(mNoiseBuffer[2]); - LOG("[Hydrax] Water mesh created"); - - return; - } - - mMesh->setMeshOptions(MeshOptions); - } - - void Hydrax::setRttOptions(RttOptions RttOptions) - { - mRttOptions = RttOptions; - - if (isCreated()) - { - LOG("[Hydrax] Updating Rtt options."); - - Ogre::RenderTarget* mRT_TextureRefraction = mTextureRefraction->getBuffer()->getRenderTarget(); - mRT_TextureRefraction->removeAllListeners(); - mRT_TextureRefraction->removeAllViewports(); - - Ogre::RenderTarget* mRT_TextureReflection = mTextureReflection->getBuffer()->getRenderTarget(); - mRT_TextureReflection->removeAllListeners(); - mRT_TextureReflection->removeAllViewports(); - - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); - mRT_TextureDepth->removeAllListeners(); - mRT_TextureDepth->removeAllViewports(); - - Ogre::TextureManager::getSingleton().remove("Depth"); - } - - Ogre::TextureManager::getSingleton().remove("Reflection"); - Ogre::TextureManager::getSingleton().remove("Refraction"); - - _createRttListeners(); - - LOG("[Hydrax] Rtt options updated."); - } - } - - void Hydrax::setPolygonMode(int Tipe) - { - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - - if (Tipe == 0) - { - mat->getTechnique(0)->getPass(0)->setPolygonMode(Ogre::PM_SOLID); - } - else if (Tipe == 1) - { - mat->getTechnique(0)->getPass(0)->setPolygonMode(Ogre::PM_WIREFRAME); - } - else if (Tipe == 2) - { - mat->getTechnique(0)->getPass(0)->setPolygonMode(Ogre::PM_POINTS); - } - } - - void Hydrax::update(Ogre::Real timeSinceLastFrame) - { - if (mVelocity == 0) - { - return; - } - - _updateTextures(timeSinceLastFrame); - mMesh->update(mNoiseBuffer[2]); - } - - void Hydrax::setComponents(HydraxComponent Components) - { - // Create/Delete depth rtt listeners if it's necesary - if (isCreated()) - { - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - if (!(Components & HYDRAX_COMPONENT_DEPTH)) - { - _createDepthRttListener(false, true); - } - } - else - { - if (Components & HYDRAX_COMPONENT_DEPTH) - { - _createDepthRttListener(); - } - } - } - - mComponents = Components; - - /* Shaders: - - 1 - Standard - 2 - Standard, Sun - 3 - Standard, Foam - 4 - Standard, Sun, Foam - - 5 - Depth - 6 - Depth, Sun - 7 - Depth, Foam - 8 - Depth, Sun, Foam - - 9 - Depth, Smooth - 10 - Depth, Smooth, Sun - 11 - Depth, Smooth, Foam - 12 - Depth, Smooth, Sun, Foam - - 13 - Depth, Caustics - 14 - Depth, Sun, Caustics - 15 - Depth, Foam, Caustics - 16 - Depth, Sun, Foam, Caustics - - 17 - Depth, Smooth, Caustics - 18 - Depth, Smooth, Sun, Caustics - 19 - Depth, Smooth, Foam, Caustics - 20 - Depth, Smooth, Sun, Foam, Caustics - */ - - int Index = 1; - - if (isComponent(HYDRAX_COMPONENT_SUN)) - { - Index ++; - } - - if (isComponent(HYDRAX_COMPONENT_FOAM)) - { - Index += 2; - } - - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - Index += 4; - } - - if (isComponent(HYDRAX_COMPONENT_SMOOTH) || isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - Index += 4; - - if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - Index += 8; - } - } - else - { - // Delete smooth component: Mask flags can't be removed - // so we have to evaluate all posibilities - // and reasign components... - - if (isComponent(HYDRAX_COMPONENT_SUN) && - isComponent(HYDRAX_COMPONENT_FOAM) && - isComponent(HYDRAX_COMPONENT_PLSM2)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_SUN | - HYDRAX_COMPONENT_FOAM | - HYDRAX_COMPONENT_PLSM2); - } - else - if (isComponent(HYDRAX_COMPONENT_SUN) && - isComponent(HYDRAX_COMPONENT_FOAM)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_SUN | - HYDRAX_COMPONENT_FOAM); - } - else - if (isComponent(HYDRAX_COMPONENT_SUN) && - isComponent(HYDRAX_COMPONENT_PLSM2)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_SUN | - HYDRAX_COMPONENT_PLSM2); - } - else - if (isComponent(HYDRAX_COMPONENT_FOAM) && - isComponent(HYDRAX_COMPONENT_PLSM2)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_FOAM | - HYDRAX_COMPONENT_PLSM2); - } - else - if (isComponent(HYDRAX_COMPONENT_SUN)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_SUN); - } - else - if (isComponent(HYDRAX_COMPONENT_FOAM)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_FOAM); - } - else - if (isComponent(HYDRAX_COMPONENT_PLSM2)) - { - mComponents = static_cast<HydraxComponent> - (HYDRAX_COMPONENT_PLSM2); - } - - LOG("[Hydrax] Requested component needs depth component... requested component desactivated."); - } - } - - mMesh->setMaterialName(Ogre::String("HydraxShader"+Ogre::StringConverter::toString(Index))); - } - - bool Hydrax::isComponent(HydraxComponent Component) - { - if (mComponents & Component) - { - return true; - } - - if (Component == HYDRAX_COMPONENTS_NONE && mComponents == HYDRAX_COMPONENTS_NONE) - { - return true; - } - - if (Component == HYDRAX_COMPONENTS_ALL && mComponents == HYDRAX_COMPONENTS_ALL) - { - return true; - } - - return false; - } - - void Hydrax::_setWaterVertexProgramParameter(Ogre::String Param, float Value) - { - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - mat->getTechnique(0)->getPass(0)->getVertexProgramParameters()->setNamedConstant(Param, Value); - } - - void Hydrax::_setWaterFragmentProgramParameter(Ogre::String Param, float Value) - { - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(Param, Value); - } - - void Hydrax::_setWaterVertexProgramParameter(Ogre::String Param, Ogre::Vector3 Value) - { - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - mat->getTechnique(0)->getPass(0)->getVertexProgramParameters()->setNamedConstant(Param, Value); - } - - void Hydrax::_setWaterFragmentProgramParameter(Ogre::String Param, Ogre::Vector3 Value) - { - Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); - mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(Param, Value); - } - - void Hydrax::_setDepthVertexProgramParameter(Ogre::String Param, float Value) - { - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - // Entity's depth shader - Ogre::MaterialPtr mat; - - if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepthCaustics"); - } - else - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepth"); - } - - try - { - if (!mat.isNull()) - { - mat->getTechnique(0)->getPass(0)->getVertexProgramParameters()->setNamedConstant(Param, Value); - } - } - catch (...) - { - } - - // Terrain depth shader - if (isComponent(HYDRAX_COMPONENT_PLSM2)) - { - int w, h; - - mSceneManager->getOption("Width", &w); - mSceneManager->getOption("Height", &h); - - Ogre::String Mapa; - Ogre::String Formato; - - mSceneManager->getOption("CurrentMap", &Mapa); - mSceneManager->getOption("CurrentTextureFormat", &Formato); - - for (int i = 0; i < w; i++) - { - for (int j = 0; j < h; j++) - { - Ogre::String NombreMaterial = Formato + "." + Ogre::StringConverter::toString(i) + "." + Ogre::StringConverter::toString(j) + "." + Mapa; - - mat = Ogre::MaterialManager::getSingleton().getByName(NombreMaterial); - - if (!mat.isNull()) - { - try - { - mat->getTechnique(1)->getPass(0)->getVertexProgramParameters()->setNamedConstant(Param, Value); - } - catch (...) - { - } - } - } - } - } - } - } - - void Hydrax::_setDepthFragmentProgramParameter(Ogre::String Param, float Value) - { - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - // Entity's depth shader - Ogre::MaterialPtr mat; - - if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepthCaustics"); - } - else - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepth"); - } - - try - { - if (!mat.isNull()) - { - mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(Param, Value); - } - } - catch (...) - { - } - - // Terrain depth shader - if (isComponent(HYDRAX_COMPONENT_PLSM2)) - { - int w, h; - - mSceneManager->getOption("Width", &w); - mSceneManager->getOption("Height", &h); - - Ogre::String Mapa; - Ogre::String Formato; - - mSceneManager->getOption("CurrentMap", &Mapa); - mSceneManager->getOption("CurrentTextureFormat", &Formato); - - for (int i = 0; i < w; i++) - { - for (int j = 0; j < h; j++) - { - Ogre::String NombreMaterial = Formato + "." + Ogre::StringConverter::toString(i) + "." + Ogre::StringConverter::toString(j) + "." + Mapa; - - mat = Ogre::MaterialManager::getSingleton().getByName(NombreMaterial); - - if (!mat.isNull()) - { - try - { - mat->getTechnique(1)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(Param, Value); - } - catch (...) - { - } - } - } - } - } - } - } - - void Hydrax::_setDepthVertexProgramParameter(Ogre::String Param, Ogre::Vector3 Value) - { - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - // Entity's depth shader - Ogre::MaterialPtr mat; - - if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepthCaustics"); - } - else - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepth"); - } - - try - { - if (!mat.isNull()) - { - mat->getTechnique(0)->getPass(0)->getVertexProgramParameters()->setNamedConstant(Param, Value); - } - } - catch (...) - { - } - - // Terrain depth shader - if (isComponent(HYDRAX_COMPONENT_PLSM2)) - { - int w, h; - - mSceneManager->getOption("Width", &w); - mSceneManager->getOption("Height", &h); - - Ogre::String Mapa; - Ogre::String Formato; - - mSceneManager->getOption("CurrentMap", &Mapa); - mSceneManager->getOption("CurrentTextureFormat", &Formato); - - for (int i = 0; i < w; i++) - { - for (int j = 0; j < h; j++) - { - Ogre::String NombreMaterial = Formato + "." + Ogre::StringConverter::toString(i) + "." + Ogre::StringConverter::toString(j) + "." + Mapa; - - mat = Ogre::MaterialManager::getSingleton().getByName(NombreMaterial); - - if (!mat.isNull()) - { - try - { - mat->getTechnique(1)->getPass(0)->getVertexProgramParameters()->setNamedConstant(Param, Value); - } - catch (...) - { - } - } - } - } - } - } - } - - void Hydrax::_setDepthFragmentProgramParameter(Ogre::String Param, Ogre::Vector3 Value) - { - if (isComponent(HYDRAX_COMPONENT_DEPTH)) - { - // Entity's depth shader - Ogre::MaterialPtr mat; - - if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepthCaustics"); - } - else - { - mat = Ogre::MaterialManager::getSingleton().getByName("HydraxShaderDepth"); - } - - try - { - if (!mat.isNull()) - { - mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(Param, Value); - } - } - catch (...) - { - } - - // Terrain depth shader - if (isComponent(HYDRAX_COMPONENT_PLSM2)) - { - int w, h; - - mSceneManager->getOption("Width", &w); - mSceneManager->getOption("Height", &h); - - Ogre::String Mapa; - Ogre::String Formato; - - mSceneManager->getOption("CurrentMap", &Mapa); - mSceneManager->getOption("CurrentTextureFormat", &Formato); - - for (int i = 0; i < w; i++) - { - for (int j = 0; j < h; j++) - { - Ogre::String NombreMaterial = Formato + "." + Ogre::StringConverter::toString(i) + "." + Ogre::StringConverter::toString(j) + "." + Mapa; - - mat = Ogre::MaterialManager::getSingleton().getByName(NombreMaterial); - - if (!mat.isNull()) - { - try - { - mat->getTechnique(1)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(Param, Value); - } - catch (...) - { - } - } - } - } - } - } - } - - void Hydrax::setPosition(Ogre::Vector3 Position) - { - mPosition = Position; - - _setDepthVertexProgramParameter("uPlaneYPos", Position.y); - - mSceneNode->setPosition(Position); - mPlanesSceneNode->setPosition(Position); - } - - void Hydrax::setPlanesError(Ogre::Real PlanesError) - { - mPlanesError = PlanesError; - } - - void Hydrax::setStrength(Ogre::Real Strength) - { - mMesh->setStrength(Strength); - } - - void Hydrax::setVelocity(Ogre::Real Velocity) - { - mVelocity = Velocity; - } - - void Hydrax::setFullReflectionDistance(Ogre::Real FullReflectionDistance) - { - mFullReflectionDistance = FullReflectionDistance; - - _setWaterFragmentProgramParameter("uFullReflectionDistance", FullReflectionDistance); - } - - void Hydrax::setGlobalTransparency(Ogre::Real GlobalTransparency) - { - mGlobalTransparency = GlobalTransparency; - - _setWaterFragmentProgramParameter("uGlobalTransparency", GlobalTransparency); - } - - void Hydrax::setNormalDistortion(Ogre::Real NormalDistortion) - { - mNormalDistortion = NormalDistortion; - - _setWaterFragmentProgramParameter("uNormalDistortion", NormalDistortion); - } - - void Hydrax::setSunPosition(Ogre::Vector3 SunPosition) - { - if (!isComponent(HYDRAX_COMPONENT_SUN)) - { - return; - } - - mSunPosition = SunPosition; - - _setWaterFragmentProgramParameter("uSunPosition", SunPosition); - } - - void Hydrax::setSunStrength(Ogre::Real SunStrength) - { - if (!isComponent(HYDRAX_COMPONENT_SUN)) - { - return; - } - - mSunStrength = SunStrength; - - _setWaterFragmentProgramParameter("uSunStrength", SunStrength); - } - - void Hydrax::setSunArea(Ogre::Real SunArea) - { - if (!isComponent(HYDRAX_COMPONENT_SUN)) - { - return; - } - - mSunArea = SunArea; - - _setWaterFragmentProgramParameter("uSunArea", SunArea); - } - - void Hydrax::setFoamMaxDistance(Ogre::Real FoamMaxDistance) - { - if (!isComponent(HYDRAX_COMPONENT_FOAM)) - { - return; - } - - mFoamMaxDistance = FoamMaxDistance; - - _setWaterFragmentProgramParameter("uFoamMaxDistance", FoamMaxDistance); - } - - void Hydrax::setFoamScale(Ogre::Real FoamScale) - { - if (!isComponent(HYDRAX_COMPONENT_FOAM)) - { - return; - } - - mFoamScale = FoamScale; - - _setWaterFragmentProgramParameter("uFoamScale", FoamScale); - } - - void Hydrax::setFoamStart(Ogre::Real FoamStart) - { - if (!isComponent(HYDRAX_COMPONENT_FOAM)) - { - return; - } - - mFoamStart = FoamStart; - - _setWaterFragmentProgramParameter("uFoamStart", FoamStart); - } - - void Hydrax::setFoamTransparency(Ogre::Real FoamTransparency) - { - if (!isComponent(HYDRAX_COMPONENT_FOAM)) - { - return; - } - - mFoamTransparency = FoamTransparency; - - _setWaterFragmentProgramParameter("uFoamTransparency", FoamTransparency); - } - - void Hydrax::setSunColor(Ogre::Vector3 SunColor) - { - if (!isComponent(HYDRAX_COMPONENT_SUN)) - { - return; - } - - mSunColor = SunColor; - - _setWaterFragmentProgramParameter("uSunColor", SunColor); - } - - void Hydrax::setDepthColor(Ogre::Vector3 DepthColor) - { - if (!isComponent(HYDRAX_COMPONENT_DEPTH)) - { - return; - } - - mDepthColor = DepthColor; - - _setWaterFragmentProgramParameter("uDepthColor", DepthColor); - } - - void Hydrax::setDepthLimit(Ogre::Real DepthLimit) - { - if (!isComponent(HYDRAX_COMPONENT_DEPTH)) - { - return; - } - - if (DepthLimit <= 0) - { - DepthLimit = 1; - } - - mDepthLimit = DepthLimit; - - _setDepthFragmentProgramParameter("uDepthLimit", 1/DepthLimit); - } - - void Hydrax::setSmoothPower(Ogre::Real SmoothPower) - { - if (!isComponent(HYDRAX_COMPONENT_SMOOTH)) - { - return; - } - - mSmoothPower = SmoothPower; - - _setWaterFragmentProgramParameter("uSmoothPower", SmoothPower); - } - - void Hydrax::setCausticsScale(Ogre::Real CausticsScale) - { - if (!isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - return; - } - - mCausticsScale = CausticsScale; - - _setDepthFragmentProgramParameter("uCausticsScale", CausticsScale); - } - - void Hydrax::setCausticsPower(Ogre::Real CausticsPower) - { - if (!isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - return; - } - - mCausticsPower = CausticsPower; - - _setWaterFragmentProgramParameter("uCausticsPower", CausticsPower); - } - - void Hydrax::setCausticsEnd(Ogre::Real CausticsEnd) - { - if (!isComponent(HYDRAX_COMPONENT_CAUSTICS)) - { - return; - } - - mCausticsEnd = CausticsEnd; - - _setWaterFragmentProgramParameter("uCausticsEnd", CausticsEnd); - } -} Deleted: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-15 08:04:11 UTC (rev 687) @@ -1,648 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#ifndef _Hydrax_H_ -#define _Hydrax_H_ - -#include "Prerequisites.h" - -#include "Enums.h" -#include "Structs.h" -#include "Help.h" -#include "Perlin.h" -#include "Mesh.h" - -namespace Hydrax -{ - /** Hydrax is a realistic water rendering plugin for Ogre. - */ - class DllExport Hydrax - { - public: - /** Constructor - @param sm Ogre SceneManager pointer - @param c Ogre Camera pointer - */ - Hydrax(Ogre::SceneManager *sm, Ogre::Camera *c); - - /** Destructor - */ - ~Hydrax(); - - /** Call when all params are set, creates grid water - and perlin / normal map textures - @remarks Call when all params are set - */ - void create(); - - /** Call every frame - @todo Add listener interface - */ - void update(Ogre::Real timeSinceLastFrame); - - /** Returns if the especified component is active - @param Component Component that we want to check - */ - bool isComponent(HydraxComponent Component); - - /** Set perlin options - @param PerlinOptions Options - @remarks It can be called after create(), Perlin and normal map textures will be updated - */ - void setPerlinOptions(PerlinOptions PerlinOptions); - - /** Set mesh options - @param MeshOptions Options - @remarks It can be called after create(), Mesh will be updated - */ - void setMeshOptions(MeshOptions MeshOptions); - - /** Set Rtt options - @param RttOptions Options - @remarks It can be called after create(), Rtt's will be updated - */ - void setRttOptions(RttOptions RttOptions); - - /** Set Hydrax components - @param Components Components - @remarks It can be called after create(), Components will be updated - */ - void setComponents(HydraxComponent Components); - - /** Set polygon mode: 1-Solid, 2-Wireframe, 3-Points - @param Time polygon mode: 1-Solid, 2-Wireframe, 3-Points - */ - void setPolygonMode(int Tipe); - - /** Set water position - @param Position Water position - */ - void setPosition(Ogre::Vector3 Position); - - /** Set clip planes error - @param PlanesError Clip planes error - */ - void setPlanesError(Ogre::Real PlanesError); - - /** Set water strength - @param Strength Water strength - */ - void setStrength(Ogre::Real Strength); - - /** Set water velocity - @param Velocity Water velocity - */ - void setVelocity(Ogre::Real Velocity); - - /** Set full reflection distance - @param FullReflectionDistance Full reflection distance - */ - void setFullReflectionDistance(Ogre::Real FullReflectionDistance); - - /** Set global transparency - @param GlobalTransparency Global transparency distance - */ - void setGlobalTransparency(Ogre::Real GlobalTransparency); - - /** Set normal distortion - @param NormalDistortion Normal distortion - @remarks Value will bi very short, like 0.025 - */ - void setNormalDistortion(Ogre::Real NormalDistortion); - - /** Set sun position - @param SunPosition Sun position - */ - void setSunPosition(Ogre::Vector3 SunPosition); - - /** Set sun strength - @param SunStrength Sun strength - */ - void setSunStrength(Ogre::Real SunStrength); - - /** Set sun area - @param SunArea Sun area - */ - void setSunArea(Ogre::Real SunArea); - - /** Set sun color - @param SunColor Sun color - */ - void setSunColor(Ogre::Vector3 SunColor); - - /** Set foam max distance - @param FoamMaxDistance Foam max distance - */ - void setFoamMaxDistance(Ogre::Real FoamMaxDistance); - - /** Set foam scale - @param FoamScale Foam scale - */ - void setFoamScale(Ogre::Real FoamScale); - - /** Set foam start - @param FoamStart Foam start - */ - void setFoamStart(Ogre::Real FoamStart); - - /** Set foam transparency - @param FoamTransparency Foam transparency - */ - void setFoamTransparency(Ogre::Real FoamTransparency); - - /** Set depth limit - @param DepthLimit Depth limit - */ - void setDepthLimit(Ogre::Real DepthLimit); - - /** Set depth color - @param DepthColor Foam color - */ - void setDepthColor(Ogre::Vector3 DepthColor); - - /** Set smooth power - @param SmoothPower Smooth power - @remarks Less values more transition distance, hight values short transition values, 1-50 range(aprox.) - */ - void setSmoothPower(Ogre::Real SmoothPower); - - /** Set caustics scale - @param CausticsScale Caustics scale - */ - void setCausticsScale(Ogre::Real CausticsScale); - - /** Set caustics power - @param CausticsPower Caustics power - */ - void setCausticsPower(Ogre::Real CausticsPower); - - /** Set caustics end - @param CausticsEnd Caustics end - */ - void setCausticsEnd(Ogre::Real CausticsEnd); - - /** Has create() already called? - @return Has create() already called? - */ - inline bool isCreated() - { - return mCreated; - } - - /** Get perlin options - @return Hydrax perlin options - */ - inline PerlinOptions getPerlinOptions() - { - return mPerlinOptions; - } - - /** Get mesh options - @return Hydrax mesh options - */ - inline MeshOptions getMeshOptions() - { - return mMesh->getMeshOptions(); - } - - /** Get rtt options - @return Hydrax rtt options - */ - inline RttOptions getRttOptions() - { - return mRttOptions; - } - - /** Get hydrax components selected - @return Hydrax components - */ - inline HydraxComponent getComponents() - { - return mComponents; - } - - /** Get current polygon mode - @return Current polygon mode: 1-Solid, 2-Wireframe, 3-Points - */ - inline int getPolygonMode() - { - return mPolygonMode; - } - - /** Get water position - @return Water position - */ - inline Ogre::Vector3 getPosition() - { - return mPosition; - } - - /** Get water strength - @return Hydrax water strength - */ - inline Ogre::Real getStrength() - { - return mMesh->getStrength(); - } - - /** Get water transition velocity - @return Water transition velocity - */ - inline Ogre::Real getVelocity() - { - return mVelocity; - } - - /** Get full reflection distance - @return Hydrax water full reflection distance - */ - inline Ogre::Real getFullReflectionDistance() - { - return mFullReflectionDistance; - } - - /** Get global transparency - @return Hydrax water global transparency - */ - inline Ogre::Real getGlobalTransparency() - { - return mGlobalTransparency; - } - - /** Get sun position - @return Sun position - */ - inline Ogre::Vector3 getSunPosition() - { - return mSunPosition; - } - - /** Get normal distortion - @return Hydrax normal distortion - */ - inline Ogre::Real getNormalDistortion() - { - return mNormalDistortion; - } - - /** Get water strength - @return Hydrax water strength - */ - inline Ogre::Real getSunStrength() - { - return mSunStrength; - } - - /** Get sun area - @return Sun area - */ - inline Ogre::Real getSunArea() - { - return mSunArea; - } - - /** Get sun color - @return Sun color - */ - inline Ogre::Vector3 getSunColor() - { - return mSunColor; - } - - /** Get foam max distance - @return Foam max distance - */ - inline Ogre::Real getFoamMaxDistance() - { - return mFoamMaxDistance; - } - - /** Get foam scale - @return Foam scale - */ - inline Ogre::Real getFoamScale() - { - return mFoamScale; - } - - /** Get foam start - @return Foam start - */ - inline Ogre::Real getFoamStart() - { - return mFoamStart; - } - - /** Get foam transparency - @return Foam scale - */ - inline Ogre::Real getFoamTransparency() - { - return mFoamTransparency; - } - - /** Get depth limit - @return Depth limit - */ - inline Ogre::Real getDepthLimit() - { - return mDepthLimit; - } - - /** Get depth color - @return Depth color - */ - inline Ogre::Vector3 getDepthColor() - { - return mDepthColor; - } - - /** Get smooth power - @return Smooth power - */ - inline Ogre::Real getSmoothPower() - { - return mSmoothPower; - } - - /** Get caustics power - @return Caustics power - */ - inline Ogre::Real getCausticsPower() - { - return mCausticsPower; - } - - /** Get caustics end - @return Caustics end - */ - inline Ogre::Real getCausticsEnd() - { - return mCausticsEnd; - } - - private: - - /** Hydrax::CRefractionListener class - */ - class CRefractionListener : public Ogre::RenderTargetListener - { - public: - /// Hydrax manager pointer - Hydrax* mHydrax; - - /** Funtion that runs each frame - @param evt Ogre RenderTargetEvent - @remarks We've to override it - */ - void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); - - /** Funtion that runs each frame - @param evt Ogre RenderTargetEvent - @remarks We've to override it - */ - void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); - }; - - /** Hydrax::CReflectionListener class - */ - class CReflectionListener : public Ogre::RenderTargetListener - { - public: - /// Hydrax manager pointer - Hydrax* mHydrax; - - /** Funtion that runs each frame - @param evt Ogre RenderTargetEvent - @remarks We've to override it - */ - void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); - - /** Funtion that runs each frame - @param evt Ogre RenderTargetEvent - @remarks We've to override it - */ - void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); - }; - - /** Hydrax::CDepthListener class - */ - class CDepthListener : public Ogre::RenderTargetListener - { - public: - /// Hydrax manager pointer - Hydrax* mHydrax; - - /// std::string to store entity's original materials name - std::queue<std::string> mMaterials; - - /** Funtion that runs each frame - @param evt Ogre RenderTargetEvent - @remarks We've to override it - */ - void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); - - /** Funtion that runs each frame - @param evt Ogre RenderTargetEvent - @remarks We've to override it - */ - void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); - }; - - /** Create all perlin and normal map textures - */ - void _createTextures(); - - /** Update perlin noise textures - @param timeSinceLastFrame Ogre RenderTargetEvent.timeSinceLastFrame - */ - void _updateTextures(Ogre::Real timeSinceLastFrame); - - /** Update normal map textures - */ - void _updateNM(); - - /** Create all rtt listeners - */ - void _createRttListeners(); - - /** Create/Delete depth rtt listener - @param Create Create depth rtt listener? - @param Delete Delete depth rtt listener? - @remarks Don't call with (Delete = true) if before we haven't call it with (Create = true) - */ - void _createDepthRttListener(bool Create = true, bool Delete = false); - - /** Set float param in water vertex program - @param Param Parameter - @param Value Float value - */ - void _setWaterVertexProgramParameter(Ogre::String Param, float Value); - - /** Set float param in water fragment program - @param Param Parameter - @param Value Float value - */ - void _setWaterFragmentProgramParameter(Ogre::String Param, float Value); - - /** Set Ogre::Vector3 param in water vertex program - @param Param Parameter - @param Value Ogre::Vector3 value - */ - void _setWaterVertexProgramParameter(Ogre::String Param, Ogre::Vector3 Value); - - /** Set Ogre::Vector3 param in water fragment program - @param Param Parameter - @param Value Ogre::Vector3 value - */ - void _setWaterFragmentProgramParameter(Ogre::String Param, Ogre::Vector3 Value); - - /** Set float param in depth vertex program - @param Param Parameter - @param Value Float value - */ - void _setDepthVertexProgramParameter(Ogre::String Param, float Value); - - /** Set float param in depth fragment program - @param Param Parameter - @param Value Float value - */ - void _setDepthFragmentProgramParameter(Ogre::String Param, float Value); - - /** Set Ogre::Vector3 param in depth vertex program - @param Param Parameter - @param Value Ogre::Vector3 value - */ - void _setDepthVertexProgramParameter(Ogre::String Param, Ogre::Vector3 Value); - - /** Set Ogre::Vector3 param in depth fragment program - @param Param Parameter - @param Value Ogre::Vector3 value - */ - void _setDepthFragmentProgramParameter(Ogre::String Param, Ogre::Vector3 Value); - - /// Has create() already called? - bool mCreated; - - /// Perlin options - PerlinOptions mPerlinOptions; - /// Rtt options - RttOptions mRttOptions; - /// Hydrax components - HydraxComponent mComponents; - - /// Polygon mode: 1-Solid, 2-Wireframe, 3-Points - int mPolygonMode; - /// Water position - Ogre::Vector3 mPosition; - /// Planes error, y axis clipplanes displacement - Ogre::Real mPlanesError; - /// Water(displacement) velocity - Ogre::Real mVelocity; - - /// Full reflection distance param - Ogre::Real mFullReflectionDistance; - /// Global transparency param - Ogre::Real mGlobalTransparency; - /// Normal distortion param - Ogre::Real mNormalDistortion; - - /// Sun position - Ogre::Vector3 mSunPosition; - /// Sun strength param - Ogre::Real mSunStrength; - /// Sun area - Ogre::Real mSunArea; - /// Sun color - Ogre::Vector3 mSunColor; - - /// Foam max distance param - Ogre::Real mFoamMaxDistance; - /// Foam scale param - Ogre::Real mFoamScale; - /// Foam start param - Ogre::Real mFoamStart; - /// Foam transparency param - Ogre::Real mFoamTransparency; - - /// Depth limit param - Ogre::Real mDepthLimit; - /// Depth color param - Ogre::Vector3 mDepthColor; - - /// Smooth power param - Ogre::Real mSmoothPower; - - /// Caustics scale param - Ogre::Real mCausticsScale; - /// Caustics power - Ogre::Real mCausticsPower; - /// Caustics end - Ogre::Real mCausticsEnd; - - /// NoiseBuffer for store our 3 perlin textures: Source1, Source2, Final(Final is update every frame) - std::vector<NoiseBuffer> mNoiseBuffer; - /// Our perlin data generation object - Perlin mPerlin; - /// Current texture blending position - float mActualTexScrollPosition; - - /// Our Hydrax::Mesh pointer - Mesh *mMesh; - - /// Refraction Plane pointer - Ogre::MovablePlane* mRefractionPlane; - /// Reflection Plane pointer - Ogre::MovablePlane* mReflectionPlane; - /// Depth Plane pointer - Ogre::MovablePlane* mDepthPlane; - - /// Refraction texture - Ogre::TexturePtr mTextureRefraction; - /// Reflection texture - Ogre::TexturePtr mTextureReflection; - /// Depth texture - Ogre::TexturePtr mTextureDepth; - - /// Refraction listener - CRefractionListener mRefractionListener; - /// Reflection listener - CReflectionListener mReflectionListener; - /// Depth listener - CDepthListener mDepthListener; - - /// SceneNode to attach our Hydrax::Mesh entity - Ogre::SceneNode *mSceneNode; - /// SceneNode to attach our planes - Ogre::SceneNode *mPlanesSceneNode; - - /// Pointer to Ogre::SceneManager - Ogre::SceneManager *mSceneManager; - /// Pointer to Ogre::Camera - Ogre::Camera *mCamera; - }; -} - -#endif Deleted: trunk/python-ogre/ThirdParty/Hydrax/Mesh.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Mesh.cpp 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Mesh.cpp 2008-08-15 08:04:11 UTC (rev 687) @@ -1,309 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#include "Mesh.h" - -namespace Hydrax -{ - Mesh::Mesh(Ogre::SceneManager *sm) - : mSceneManager(sm) - , mStrength(20) - , mMesh(0) - , mSubMesh(0) - , mEntity(0) - , mComplexity(0) - , mNumFaces(0) - , mNumVertices(0) - , mPosVertexBuffer(0) - , mTexcoordsVertexBuffer(0) - , mIndexBuffer(0) - , mMaterialName("HydraxShader1") - { - } - - Mesh::~Mesh() - { - Ogre::MeshManager::getSingleton().remove("HydraxMesh"); - - mSceneManager->destroyEntity(mEntity); - } - - void Mesh::setMeshOptions(MeshOptions MeshOptions) - { - mMeshOptions = MeshOptions; - } - - void Mesh::setMaterialName(Ogre::String MaterialName) - { - mMaterialName = MaterialName; - - if (mEntity) - { - mEntity->setMaterialName(mMaterialName); - } - } - - void Mesh::create(Ogre::SceneNode *SceneNode) - { - int x,y; - - mComplexity = mMeshOptions.Complexity; - mSize = mMeshOptions.MeshSize; - mNumFaces = 2 * mComplexity * mComplexity; - mNumVertices = (mComplexity + 1) * (mComplexity + 1) ; - - // Create mesh and submesh - mMesh = Ogre::MeshManager::getSingleton().createManual("HydraxMesh", - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); - mSubMesh = mMesh->createSubMesh(); - mSubMesh->useSharedVertices = false; - - // Vertex buffers - mSubMesh->vertexData = new Ogre::VertexData(); - mSubMesh->vertexData->vertexStart = 0; - mSubMesh->vertexData->vertexCount = mNumVertices; - - Ogre::VertexDeclaration* vdecl = mSubMesh->vertexData->vertexDeclaration; - Ogre::VertexBufferBinding* vbind = mSubMesh->vertexData->vertexBufferBinding; - - vdecl->addElement(0, 0, Ogre::VET_FLOAT3, Ogre::VES_POSITION); - vdecl->addElement(1, 0, Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES); - - // --- Position vertices --- - // Create vertex buffer - mPosVertexBuffer = - Ogre::HardwareBufferManager::getSingleton().createVertexBuffer( - 3*sizeof(float), - mNumVertices, - Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE); - - // Set bingind - vbind->setBinding(0, mPosVertexBuffer); - - // Lock vertex buffer - float *posVertexBuffer = - (float*)mPosVertexBuffer-> - lock(0, - mNumVertices, - Ogre::HardwareBuffer::HBL_DISCARD); - - // Set values - for (y=0;y<=mComplexity;y++) - { - for (x=0;x<=mComplexity;x++) - { - int numPoint = y*(mComplexity+1) + x ; - - posVertexBuffer[3*numPoint+0] = (float)(x) / (float)(mComplexity) * (float) mSize.Width; - posVertexBuffer[3*numPoint+1] = 0; - posVertexBuffer[3*numPoint+2] = (float)(y) / (float)(mComplexity) * (float) mSize.Height; - } - } - - // Unlock the buffer - mPosVertexBuffer->unlock(); - - // --- Texcoords --- - // Create vertex buffer - mTexcoordsVertexBuffer = - Ogre::HardwareBufferManager::getSingleton().createVertexBuffer( - 2*sizeof(float), - mNumVertices, - Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY); - - // Set binding - vbind->setBinding(1, mTexcoordsVertexBuffer); - - // Lock our vertices - float *texcoordsBufData = - (float*)mTexcoordsVertexBuffer-> - lock(0, - mNumVertices, - Ogre::HardwareBuffer::HBL_DISCARD); - // Asign values - for (y=0;y<=mComplexity;y++) - { - for (x=0;x<=mComplexity;x++) - { - texcoordsBufData[2*(y*(mComplexity+1)+x)+0] = (float)y / mComplexity ; - texcoordsBufData[2*(y*(mComplexity+1)+x)+1] = (float)x / mComplexity ; - } - } - - // Unlock - mTexcoordsVertexBuffer->unlock(); - - // --- Index buffer --- - // Find what we need, 16 or 32 bit buffer - bool is32Bits = false; - Ogre::HardwareIndexBuffer::IndexType IT_BIT = Ogre::HardwareIndexBuffer::IT_16BIT; - - if (mComplexity > 255) - { - is32Bits = true; - IT_BIT = Ogre::HardwareIndexBuffer::IT_32BIT; - } - - // Create index buffer - mIndexBuffer = - Ogre::HardwareBufferManager::getSingleton().createIndexBuffer( - IT_BIT, - 3*mNumFaces, - Ogre::HardwareBuffer::HBU_STATIC, true); - - // Lock - unsigned short *faceVertexIndices16Bits; - unsigned long *faceVertexIndices32Bits; - - if (!is32Bits) - { - // 16 Bit buffer - faceVertexIndices16Bits = - (unsigned short*)mIndexBuffer-> - lock(0, - mNumFaces*3*2, - Ogre::HardwareBuffer::HBL_DISCARD); - } - else - { - // 32 bits buffer - faceVertexIndices32Bits = - (unsigned long*)mIndexBuffer-> - lock(0, - mNumFaces*3*2, - Ogre::HardwareBuffer::HBL_DISCARD); - } - - // Set values - unsigned short *twoface16Bits; - unsigned long *twoface32Bits; - - for (y=0 ; y<mComplexity ; y++) - { - for (int x=0 ; x<mComplexity ; x++) - { - int p0 = y*(mComplexity+1) + x ; - int p1 = y*(mComplexity+1) + x + 1 ; - int p2 = (y+1)*(mComplexity+1) + x ; - int p3 = (y+1)*(mComplexity+1) + x + 1 ; - - if (!is32Bits) - { - // 16 bits buffer - twoface16Bits = faceVertexIndices16Bits + (y*mComplexity+x)*2*3; - - // First triangle - twoface16Bits[0]=p2; - twoface16Bits[1]=p1; - twoface16Bits[2]=p0; - // Second triangle - twoface16Bits[3]=p2; - twoface16Bits[4]=p3; - twoface16Bits[5]=p1; - } - else - { - // 32 bits buffer - twoface32Bits = faceVertexIndices32Bits + (y*mComplexity+x)*2*3; - - // First triangle - twoface32Bits[0]=p2; - twoface32Bits[1]=p1; - twoface32Bits[2]=p0; - // Second triangle - twoface32Bits[3]=p2; - twoface32Bits[4]=p3; - twoface32Bits[5]=p1; - } - } - } - - // Unlock - mIndexBuffer->unlock(); - - // Set index buffer for this submesh - mSubMesh->indexData->indexBuffer = mIndexBuffer; - mSubMesh->indexData->indexStart = 0; - mSubMesh->indexData->indexCount = 3*mNumFaces; - - // End mesh creation - Ogre::AxisAlignedBox meshBounds(0,0,0, - mSize.Width, mStrength, mSize.Height); - - mMesh->_setBounds(meshBounds, false); - mMesh->_setBoundingSphereRadius (1); - mMesh->load(); - mMesh->touch(); - - mEntity = mSceneManager->createEntity("HydraxMeshEnt", "HydraxMesh"); - mEntity->setMaterialName(mMaterialName); - mEntity->setRenderQueueGroup(Ogre::RENDER_QUEUE_9); - Ogre::MaterialPtr m = Ogre::MaterialManager::getSingleton().getByName(mMaterialName); - m->setReceiveShadows(false); - - SceneNode->attachObject(mEntity); - SceneNode->setPosition(-mSize.Width/2,0,-mSize.Height/2); - } - - void Mesh::update(const NoiseBuffer &NoiseBuffer) - { - float *posVertexBuffer = - (float*)mPosVertexBuffer-> - lock(0, - mNumVertices, - Ogre::HardwareBuffer::HBL_NORMAL); - - int x, y, xcoord, ycoord; - float* row; - - float *buf = posVertexBuffer+1 ; // +1 for Y coordinate - - for (y=1;y<=mComplexity-1;y++) - { - ycoord = (int)(((float)y/mComplexity)*NoiseBuffer.mSize.Height); - - row = buf + 3*y*(mComplexity+1); - - for (x=1;x<=mComplexity-1;x++) - { - xcoord = (int)(((float)x/mComplexity)*NoiseBuffer.mSize.Width); - - row[3*x] = NoiseBuffer.mData[xcoord][ycoord]*mStrength; - } - } - - mPosVertexBuffer->unlock(); - } - - void Mesh::setStrength(Ogre::Real Strength) - { - mStrength = Strength; - - Ogre::AxisAlignedBox meshBounds(0,0,0, - mSize.Width, mStrength, mSize.Height); - - mMesh->_setBounds (meshBounds, false); - } -} Deleted: trunk/python-ogre/ThirdParty/Hydrax/Mesh.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Mesh.h 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Mesh.h 2008-08-15 08:04:11 UTC (rev 687) @@ -1,194 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#ifndef _Mesh_H_ -#define _Mesh_H_ - -#include "Prerequisites.h" - -#include "Help.h" -#include "Structs.h" - -namespace Hydrax -{ - /** Class wich contains all funtions/variables related to - Hydrax water mesh - */ - class DllExport Mesh - { - public: - /** Constructor - @param sm Ogre SceneManager - */ - Mesh(Ogre::SceneManager *sm); - - /** Destructor - */ - ~Mesh(); - - /** Set mesh options - @param MeshOptions MeshOptions structure - @remarks Call before create() - */ - void setMeshOptions(MeshOptions MeshOptions); - - /** Set mesh material - @param MaterialName The material name - */ - void setMaterialName(Ogre::String MaterialName); - - /** Create our water mesh, geometry, entity, etc... - @param SceneNode Ogre SceneNode where entity will be attach - @remarks Call it after setMeshOptions() and setMaterialName() - */ - void create(Ogre::SceneNode *SceneNode); - - /** Update our mesh grid from a NoiseBuffer data - @param NoiseBuffer NoiseBuffer wich contains the data - @remarks Only call it after create() ! - */ - void update(const NoiseBuffer &NoiseBuffer); - - /** Set water strength(Y axis multiplier) - @param Strength Strength - */ - void setStrength(Ogre::Real Strength); - - /** Get mesh options - @return Mesh options - */ - inline MeshOptions getMeshOptions() - { - return mMeshOptions; - } - - /** Get mesh - @return Mesh - */ - inline Ogre::MeshPtr getMesh() - { - return mMesh; - } - - /** Get sub mesh - @return Sub mesh - */ - inline Ogre::SubMesh* getSubMesh() - { - return mSubMesh; - } - - /** Get entity - @return Entity - */ - inline Ogre::Entity* getEntity() - { - return mEntity; - } - - /** Get complexity - @return Complexity - */ - inline int getComplexity() - { - return mComplexity; - } - - /** Get size - @return Size - */ - inline Size getSize() - { - return mSize; - } - - /** Get number of faces - @return Number of faces - */ - inline int getNumFaces() - { - return mNumFaces; - } - - /** Get number of vertices - @return Number of vertices - */ - inline int getNumVertices() - { - return mNumVertices; - } - - /** Get material name - @return Material name - */ - inline Ogre::String getMaterialName() - { - return mMaterialName; - } - - /** Get strength - @return Sterngth - */ - inline Ogre::Real getStrength() - { - return mStrength; - } - - private: - /// Mesh options - MeshOptions mMeshOptions; - /// Ogre::MeshPtr - Ogre::MeshPtr mMesh; - /// Ogre::Submesh pointer - Ogre::SubMesh *mSubMesh; - /// Ogre::Entity pointer - Ogre::Entity *mEntity; - /// Grid complexity - int mComplexity; - /// Grid size - Size mSize; - /// Number of faces - int mNumFaces; - /// Number of vertices - int mNumVertices; - - /// Position vertex buffer - Ogre::HardwareVertexBufferSharedPtr mPosVertexBuffer; - /// Texture coordinate vertex buffer - Ogre::HardwareVertexBufferSharedPtr mTexcoordsVertexBuffer; - /// Index buffer - Ogre::HardwareIndexBufferSharedPtr mIndexBuffer; - - /// Water strength(Y axis multiplier) - Ogre::Real mStrength; - /// Material name - Ogre::String mMaterialName; - - /// Pointer to Ogre::SceneManager - Ogre::SceneManager *mSceneManager; - }; -} - -#endif Deleted: trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp 2008-08-15 08:04:11 UTC (rev 687) @@ -1,248 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#include "Perlin.h" - -namespace Hydrax -{ - - Perlin::Perlin() - : mTexturePerlinPtr(0) - , mTextureNMPtr(0) - , mTexturePerlinPtrActive(false) - , mTextureNMPtrActive(false) - { - } - - Perlin::Perlin(int seed) - { - Perlin(); - - mPerlinModule.SetSeed(seed); - } - - Perlin::~Perlin() - { - } - - void Perlin::setSize(int width, int height) - { - mSize.setSize(width, height); - } - - float** Perlin::getData(bool seamless) - { - noise::utils::NoiseMapBuilderPlane constructor; - noise::utils::NoiseMap noiseMap; - - constructor.SetBounds (-1.0, 1.0, -1.0, 1.0); - constructor.SetDestSize (mSize.Width,mSize.Height); - constructor.EnableSeamless(seamless); - constructor.SetSourceModule(mPerlinModule); - constructor.SetDestNoiseMap(noiseMap); - constructor.Build(); - - float** Temp = getFreeData(); - - for (int k = 0; k < mSize.Width; k++) - { - for (int u = 0; u < mSize.Height; u++) - { - // Convert a [-1,1] range double to [0,1] range float - float To01 = (1+static_cast<float>(noiseMap.GetValue(k, u)))/2; - - if (To01 > 1) - { - To01 = 1; - } - else if (To01 < 0) - { - To01 = 0; - } - - Temp[k][u] = To01; - } - } - - return Temp; - } - - float** Perlin::getFreeData() - { - float** Temp = new float *[mSize.Width]; - - for (int k = 0; k < mSize.Width; k++) - { - Temp[k] = new float[mSize.Height]; - } - - return Temp; - } - - void Perlin::free(float** data) - { - if (data) - { - for (int k = 0; k < mSize.Width; k++) - { - delete[] data[k]; - } - - delete[] data; - } - } - - noise::utils::Image Perlin::getNormalMap(double bumpHeight, bool seamless) - { - noise::utils::NoiseMapBuilderPlane constructor; - noise::utils::NoiseMap noiseMap; - - constructor.SetBounds(-1.0, 1.0, -1.0, 1.0); - constructor.SetDestSize(mSize.Width, mSize.Height); - constructor.EnableSeamless(seamless); - constructor.SetSourceModule(mPerlinModule); - constructor.SetDestNoiseMap(noiseMap); - constructor.Build(); - - noise::utils::RendererNormalMap mRenderer; - noise::utils::Image mImage; - mImage.SetSize(mSize.Width, mSize.Height); - mRenderer.EnableWrap(seamless); - mRenderer.SetBumpHeight(bumpHeight); - mRenderer.SetSourceNoiseMap(noiseMap); - mRenderer.SetDestImage(mImage); - mRenderer.Render(); - - return mImage; - } - - void Perlin::createPerlinTexture(Ogre::String name, Ogre::String resourceGroup) - { - Ogre::TextureManager::getSingleton().remove(name); - - mTexturePerlinPtr = Ogre::TextureManager::getSingleton(). - createManual(name, - resourceGroup, - Ogre::TEX_TYPE_2D, - mSize.Width, mSize.Height, - 0, - Ogre::PF_BYTE_BGRA, - Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE); - - mTexturePerlinPtrActive = true; - - float** Temp = getData(); - updatePerlinTexture(Temp); - free(Temp); - - mTexturePerlinPtr->load(); - } - - void Perlin::updatePerlinTexture(float** data) - { - if (!mTexturePerlinPtrActive) - { - return; - } - - Ogre::HardwarePixelBufferSharedPtr pixelBuffer = mTexturePerlinPtr->getBuffer(); - - pixelBuffer->lock(Ogre::HardwareBuffer::HBL_NORMAL); // for best performance use HBL_DISCARD! - const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock(); - - Ogre::uint8* pDest = static_cast<Ogre::uint8*>(pixelBox.data); - - int x,y; - - for (x = 0; x < mSize.Width; x++) - { - for (y = 0; y < mSize.Height; y++) - { - *pDest++ = 255; // B - *pDest++ = 255; // G - *pDest++ = 255; // R - *pDest++ = data[x][y]*255; // A - } - } - - pixelBuffer->unlock(); - } - - void Perlin::createNMTexture(Ogre::String name, Ogre::String resourceGroup) - { - Ogre::TextureManager::getSingleton().remove(name); - - mTextureNMPtr = Ogre::TextureManager::getSingleton(). - createManual(name, - resourceGroup, - Ogre::TEX_TYPE_2D, - mSize.Width, mSize.Height, - 0, - Ogre::PF_BYTE_BGRA, - Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE); - - mTextureNMPtrActive = true; - - updateNMTexture(getNormalMap(1)); - - mTextureNMPtr->load(); - } - - void Perlin::updateNMTexture(noise::utils::Image image) - { - if (!mTextureNMPtrActive) - { - return; - } - - Ogre::HardwarePixelBufferSharedPtr pixelBuffer = mTextureNMPtr->getBuffer(); - - pixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD); // for best performance use HBL_DISCARD! - const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock(); - - Ogre::uint8* pDest = static_cast<Ogre::uint8*>(pixelBox.data); - - noise::utils::Color c; - - int x,y; - - for (x = 0; x < mSize.Width; x++) - { - for (y = 0; y < mSize.Height; y++) - { - c = image.GetValue(x ,y); - - *pDest++ = static_cast<uint8>(c.blue); // B - *pDest++ = static_cast<uint8>(c.green); // G - *pDest++ = static_cast<uint8>(c.red); // R - *pDest++ = 255; // A - } - } - - pixelBuffer->unlock(); - } - -} - Deleted: trunk/python-ogre/ThirdParty/Hydrax/Perlin.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Perlin.h 2008-08-09 21:51:33 UTC (rev 686) +++ trunk/python-ogre/ThirdParty/Hydrax/Perlin.h 2008-08-15 08:04:11 UTC (rev 687) @@ -1,135 +0,0 @@ -/* --------------------------------------------------------------------------------- -This source file is part of Hydrax. -Visit --- - -Copyright (C) 2007 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> - <xavyiy@...> - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to -http://www.gnu.org/copyleft/gpl.html. --------------------------------------------------------------------------------- -*/ - -#ifndef _Perlin_H_ -#define _Perlin_H_ - -#include "Prerequisites.h" - -#include "Help.h" - -#include "../noise/noise.h" -#include "../noise/noiseutils.h" - -namespace Hydrax -{ - /** Class for provide a solid object for use perlin noise data and generate ogre textures. - @remarks This class is used too for generate Ogre textures, wich can be used in shaders, - or something like that. - */ - class DllExport Perlin - { - public: - - /** Default constructor - */ - Perlin(); - @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-15 08:08:02
|
Revision: 688 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=688&view=rev Author: andy_miller Date: 2008-08-15 08:08:10 +0000 (Fri, 15 Aug 2008) Log Message: ----------- Adding Hydrax 0.3 to the svn Added Paths: ----------- trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.cpp trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.h trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp trunk/python-ogre/ThirdParty/Hydrax/Enums.h trunk/python-ogre/ThirdParty/Hydrax/Help.cpp trunk/python-ogre/ThirdParty/Hydrax/Help.h trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h trunk/python-ogre/ThirdParty/Hydrax/Image.cpp trunk/python-ogre/ThirdParty/Hydrax/Image.h trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.cpp trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.h trunk/python-ogre/ThirdParty/Hydrax/Mesh.cpp trunk/python-ogre/ThirdParty/Hydrax/Mesh.h trunk/python-ogre/ThirdParty/Hydrax/Module.cpp trunk/python-ogre/ThirdParty/Hydrax/Module.h trunk/python-ogre/ThirdParty/Hydrax/Noise.cpp trunk/python-ogre/ThirdParty/Hydrax/Noise.h trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp trunk/python-ogre/ThirdParty/Hydrax/Perlin.h trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.cpp trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.cpp trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.h trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.cpp trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.h trunk/python-ogre/ThirdParty/Hydrax/Structs.cpp trunk/python-ogre/ThirdParty/Hydrax/Structs.h trunk/python-ogre/ThirdParty/Hydrax/TextureManager.cpp trunk/python-ogre/ThirdParty/Hydrax/TextureManager.h trunk/python-ogre/code_generators/hydrax/ trunk/python-ogre/code_generators/hydrax/customization_data.py trunk/python-ogre/code_generators/hydrax/generate_code.py trunk/python-ogre/code_generators/hydrax/hand_made_wrappers.py trunk/python-ogre/code_generators/hydrax/python_hydrax.h trunk/python-ogre/code_generators/hydrax/python_hydrax_aliases.h trunk/python-ogre/code_generators/hydrax/python_hydrax_sizeof.h Added: trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.cpp 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,271 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#include "DecalsManager.h" + +#include "Hydrax.h" + +namespace Hydrax +{ + Decal::Decal(Hydrax *h, const Ogre::String &TextureName, const int& Id) + : mHydrax(h) + , mTextureName(TextureName) + , mId(Id) + , mRegisteredPass(0) + , mPosition(Ogre::Vector2(0,0)) + , mSize(Ogre::Vector2(1,1)) + , mOrientation(Ogre::Radian(0)) + , mTransparency(1) + , mVisible(true) + { + mProjector = new Ogre::Frustum(); + mProjector->setProjectionType(Ogre::PT_ORTHOGRAPHIC); + + mSceneNode = mHydrax->getSceneManager()->getRootSceneNode()->createChildSceneNode(); + mSceneNode->attachObject(mProjector); + mSceneNode->setPosition(Ogre::Vector3(0,0,0)); + mSceneNode->setOrientation(Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::NEGATIVE_UNIT_X)); + + setPosition(mPosition); + setSize(mSize); + setOrientation(mOrientation); + } + + Decal::~Decal() + { + if (mRegisteredPass) + { + mRegisteredPass->getParent()->removePass(mRegisteredPass->getIndex()); + mRegisteredPass = static_cast<Ogre::Pass*>(NULL); + } + + mSceneNode->getParentSceneNode()->removeAndDestroyChild(mSceneNode->getName()); + + delete mProjector; + } + + void Decal::registerPass(Ogre::Pass* _Pass) + { + if (mRegisteredPass) + { + mRegisteredPass->getParent()->removePass(mRegisteredPass->getIndex()); + mRegisteredPass = static_cast<Ogre::Pass*>(NULL); + } + + _Pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); + _Pass->setDepthBias(1,1); + _Pass->setLightingEnabled(false); + _Pass->setDepthWriteEnabled(false); + + Ogre::TextureUnitState *DecalTexture = _Pass->createTextureUnitState(mTextureName); + DecalTexture->setProjectiveTexturing(true, mProjector); + DecalTexture->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP); + DecalTexture->setTextureFiltering(Ogre::FO_LINEAR, Ogre::FO_LINEAR, Ogre::FO_NONE); + DecalTexture->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_TEXTURE, Ogre::LBS_MANUAL, 1.0, mTransparency); + + mRegisteredPass = _Pass; + } + + void Decal::unregister() + { + if (mRegisteredPass) + { + mRegisteredPass->getParent()->removePass(mRegisteredPass->getIndex()); + mRegisteredPass = static_cast<Ogre::Pass*>(NULL); + } + } + + void Decal::setPosition(const Ogre::Vector2& Position) + { + mPosition = Position; + + mSceneNode->setPosition(Position.x, 0, Position.y); + } + + void Decal::setSize(const Ogre::Vector2& Size) + { + mSize = Size; + + // This method is only available in the CVS HEAD, + // if you have problems compiling, just comment the + // following line: + mProjector->setOrthoWindow(Size.x, Size.y); + } + + void Decal::setOrientation(const Ogre::Radian& Orientation) + { + mSceneNode->rotate(Ogre::Vector3::UNIT_Z, -mOrientation + Orientation); + + mOrientation = Orientation; + } + + void Decal::setTransparency(const Ogre::Real& Transparency) + { + mTransparency = Transparency; + + if (mRegisteredPass) + { + mRegisteredPass->getTextureUnitState(0) + ->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_TEXTURE, Ogre::LBS_MANUAL, 1.0, mTransparency); + } + } + + void Decal::setVisible(const bool& Visible) + { + mVisible = Visible; + + unregister(); + } + + // -------------------------------------------------------------------- + + DecalsManager::DecalsManager(Hydrax *h) + : mHydrax(h) + , mNextId(0) + , mWaterStrength(5) + { + } + + DecalsManager::~DecalsManager() + { + for(DecalIt = mDecals.begin(); DecalIt != mDecals.end(); DecalIt++) + { + delete (*DecalIt); + } + + mDecals.clear(); + } + + void DecalsManager::update() + { + if (mHydrax->getCamera()->getPosition() == mLastPosition && + mHydrax->getCamera()->getOrientation() == mLastOrientation) + { + return; + } + + Ogre::Vector2 DPos; + Ogre::Real HHeight = mHydrax->getPosition().y; + Ogre::Vector2 DSize; + Ogre::AxisAlignedBox DecalBox; + + for(DecalIt = mDecals.begin(); DecalIt != mDecals.end(); DecalIt++) + { + if (!(*DecalIt)->isVisible()) + { + continue; + } + + DPos = (*DecalIt)->getPosition(); + DSize = (*DecalIt)->getSize()/2; + + DecalBox = Ogre::AxisAlignedBox(DPos.x - DSize.x, HHeight - mWaterStrength, DPos.y - DSize.y, + DPos.x + DSize.x, HHeight + mWaterStrength, DPos.y + DSize.y); + + if (mHydrax->getCamera()->isVisible(DecalBox)) + { + if (!(*DecalIt)->getRegisteredPass()) + { + (*DecalIt)->registerPass( + mHydrax->getMaterialManager()->getMaterial(MaterialManager::MAT_WATER)-> + getTechnique(0)->createPass()); + } + } + else + { + (*DecalIt)->unregister(); + } + } + + mLastPosition = mHydrax->getCamera()->getPosition(); + mLastOrientation = mHydrax->getCamera()->getOrientation(); + } + + Decal* DecalsManager::add(const Ogre::String& TextureName) + { + Decal* NewDecal = new Decal(mHydrax, TextureName, mNextId); + + mDecals.push_back(NewDecal); + + if (mHydrax->getMaterialManager()->isCreated()) + { + NewDecal->registerPass( + mHydrax->getMaterialManager()->getMaterial(MaterialManager::MAT_WATER)-> + getTechnique(0)->createPass()); + } + + mNextId++; + + return NewDecal; + } + + Decal* DecalsManager::get(const int& Id) + { + for(DecalIt = mDecals.begin(); DecalIt != mDecals.end(); DecalIt++) + { + if((*DecalIt)->getId() == Id) + { + return (*DecalIt); + } + } + + return static_cast<Decal*>(NULL); + } + + void DecalsManager::remove(const int& Id) + { + for(DecalIt = mDecals.begin(); DecalIt != mDecals.end(); DecalIt++) + { + if((*DecalIt)->getId() == Id) + { + delete (*DecalIt); + mDecals.erase(DecalIt); + + return; + } + } + } + + void DecalsManager::removeAll() + { + for(DecalIt = mDecals.begin(); DecalIt != mDecals.end(); DecalIt++) + { + delete (*DecalIt); + } + + mDecals.clear(); + + mNextId = 0; + } + + void DecalsManager::registerAll() + { + for(DecalIt = mDecals.begin(); DecalIt != mDecals.end(); DecalIt++) + { + (*DecalIt)->registerPass( + mHydrax->getMaterialManager()->getMaterial(MaterialManager::MAT_WATER)-> + getTechnique(0)->createPass()); + } + } +} Added: trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.h 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,283 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#ifndef _Hydrax_DecalsManager_H_ +#define _Hydrax_DecalsManager_H_ + +#include "Prerequisites.h" + +namespace Hydrax +{ + class Hydrax; + + /** Decal class. + */ + class DllExport Decal + { + public: + /** Constructor + @param h Hydrax parent pointer + @param TextureName Texture name + @param Id Decal Id + */ + Decal(Hydrax *h, const Ogre::String &TextureName, const int& Id); + + /** Destructor + */ + ~Decal(); + + /** Register the decal int the specified pass + @param _Pass Pass to be registred + */ + void registerPass(Ogre::Pass* _Pass); + + /** Unregister from current technique + */ + void unregister(); + + /** Get decal texture name + @return Decal texture name + */ + inline const Ogre::String& getTextureName() const + { + return mTextureName; + } + + /** Get the decal Id + @return Decal Id + */ + inline const int& getId() const + { + return mId; + } + + /** Get the decal projector + @return Projector frustum + */ + inline Ogre::Frustum* getProjector() + { + return mProjector; + } + + /** Get the decal scene node + @return Decal scene node + */ + inline Ogre::SceneNode* getSceneNode() + { + return mSceneNode; + } + + /** Get the pass the decal is in + @return Registered pass + @remarks return NULL if decal isn't registered + */ + inline Ogre::Pass *getRegisteredPass() + { + return mRegisteredPass; + } + + /** Get decal position + @return Decal position + */ + inline const Ogre::Vector2& getPosition() const + { + return mPosition; + } + + /** Get decal size + @return Decal size + */ + inline const Ogre::Vector2& getSize() const + { + return mSize; + } + + /** Get decal orientation + @return Decal orientation + */ + inline const Ogre::Radian& getOrientation() const + { + return mOrientation; + } + + /** Get decal transparency + @return Decal transparency + */ + inline const Ogre::Real& getTransparency() const + { + return mTransparency; + } + + /** Is decal visile? + @return true if decal is visible + */ + inline const bool& isVisible() const + { + return mVisible; + } + + /** Set decal position + @param Position Decal position + */ + void setPosition(const Ogre::Vector2& Position); + + /** Set decal size + @param Size Decal size in world coordinates + */ + void setSize(const Ogre::Vector2& Size); + + /** Set decal orientation + @param Orientation Decal orientation + */ + void setOrientation(const Ogre::Radian& Orientation); + + /** Set decal transparency + @param Transparency Decal transparency in [0,1] range + @remarks 0 = Full transparent, 1 = Full opacity + */ + void setTransparency(const Ogre::Real& Transparency); + + /** Set decal visibile or not + @param Visible true if yes, false if not + */ + void setVisible(const bool& Visible); + + private: + /// Decal texture name + Ogre::String mTextureName; + /// Decal Id + int mId; + /// Decal projector + Ogre::Frustum *mProjector; + /// Decal scene node + Ogre::SceneNode *mSceneNode; + /// Registered pass + Ogre::Pass *mRegisteredPass; + + /// Position + Ogre::Vector2 mPosition; + /// Size + Ogre::Vector2 mSize; + /// Orientation + Ogre::Radian mOrientation; + /// Transparency + Ogre::Real mTransparency; + /// Is decal visible? + bool mVisible; + + /// Hydrax parent pointer + Hydrax *mHydrax; + }; + + /** Decals manager class. Use it for place any kind of texture + over the water! Like ship trails, overwater vegetables, ... + */ + class DllExport DecalsManager + { + public: + /** Constructor + @param h Hydrax parent pointer + */ + DecalsManager(Hydrax *h); + + /** Destructor + */ + ~DecalsManager(); + + /** Update decal manager + @remarks Call each frame + */ + void update(); + + /** Add decal + @param TextureName Texture name + @return Hydrax::Decal* Use it as a usual Ogre::SceneNode(Decal::getSceneNode()) for position, rotate...etc! + */ + Decal* add(const Ogre::String& TextureName); + + /** Get decal + @param Id Decal Id + @return Hydrax::Decal* + */ + Decal* get(const int& Id); + + /** Remove decal + @param Id Decal Id + */ + void remove(const int& Id); + + /** Remove all decals + */ + void removeAll(); + + /** Register all decals + @remarks Use it when water material is (re)created + */ + void registerAll(); + + /** Get decals std::vector + @return std::vector<Decal*> list + */ + inline std::vector<Decal*> getDecals() + { + return mDecals; + } + + /** Get water strength (used for decals culling) + @return Water strength + */ + inline const Ogre::Real _getWaterStrength() const + { + return mWaterStrength; + } + + /** Set water strength (used for decals culling) + @param WaterStrength Water strength + */ + inline void _setWaterStrength(const Ogre::Real &WaterStrength) + { + mWaterStrength = WaterStrength; + } + + private: + /// Decals std::vector + std::vector<Decal*> mDecals; + /// Decal iterator + std::vector<Decal*>::iterator DecalIt; + /// Next Id + int mNextId; + + /// Water strength (For decals culling) + Ogre::Real mWaterStrength; + + /// Last camera position, orientation + Ogre::Vector3 mLastPosition; + Ogre::Quaternion mLastOrientation; + + /// Hydrax parent pointer + Hydrax *mHydrax; + }; +}; + +#endif \ No newline at end of file Added: trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,30 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#include "Enums.h" + +namespace Hydrax +{ + +} Added: trunk/python-ogre/ThirdParty/Hydrax/Enums.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Enums.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Enums.h 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,66 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#ifndef _Hydrax_Enums_H_ +#define _Hydrax_Enums_H_ + +#include "Prerequisites.h" + +namespace Hydrax +{ + /** Texture quality enumeration(2^n) + */ + DllExport enum TextureQuality + { + TEX_QUA_2 = 2, + TEX_QUA_4 = 4, + TEX_QUA_8 = 8, + TEX_QUA_16 = 16, + TEX_QUA_32 = 32, + TEX_QUA_64 = 64, + TEX_QUA_128 = 128, + TEX_QUA_256 = 256, + TEX_QUA_512 = 512, + TEX_QUA_1024 = 1024 + }; + + /** Hydrax flags for select the components + that we want to use. + 0 for none, 1 for all. + */ + DllExport enum HydraxComponent + { + HYDRAX_COMPONENT_SUN = 1 << 0, + HYDRAX_COMPONENT_FOAM = 1 << 1, + HYDRAX_COMPONENT_DEPTH = 1 << 2, + /// Smooth transitions and caustics components need depth component + HYDRAX_COMPONENT_SMOOTH = 1 << 3, + HYDRAX_COMPONENT_CAUSTICS = 1 << 4, + + HYDRAX_COMPONENTS_NONE = 0x0000, + HYDRAX_COMPONENTS_ALL = 0x001F, + }; +} + +#endif Added: trunk/python-ogre/ThirdParty/Hydrax/Help.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Help.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Help.cpp 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,74 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#include "Help.h" + +namespace Hydrax +{ + Ogre::Vector2 Math::intersectionOfTwoLines(const Ogre::Vector2 &a, const Ogre::Vector2 &b, + const Ogre::Vector2 &c, const Ogre::Vector2 &d) + { + float r, s, denominator = (b.x - a.x) * (d.y - c.y) - (b.y - a.y) * (d.x - c.x); + + // If the denominator in above is zero, AB & CD are colinear + if (denominator == 0) + { + return Ogre::Vector2::ZERO; + } + + float numeratorR = (a.y - c.y) * (d.x - c.x) - (a.x - c.x) * (d.y - c.y); + // If the numerator above is also zero, AB & CD are collinear. + // If they are collinear, then the segments may be projected to the x- + // or y-axis, and overlap of the projected intervals checked. + + r = numeratorR / denominator; + + float numeratorS = (a.y - c.y) * (b.x - a.x) - (a.x - c.x) * (b.y - a.y); + + s = numeratorS / denominator; + + // If 0<=r<=1 & 0<=s<=1, intersection exists + // r<0 or r>1 or s<0 or s>1 line segments do not intersect + if (r < 0 || r > 1 || s < 0 || s > 1) + { + return Ogre::Vector2::ZERO; + } + + ///* + // Note: + // If the intersection point of the 2 lines are needed (lines in this + // context mean infinite lines) regardless whether the two line + // segments intersect, then + // + // If r>1, P is located on extension of AB + // If r<0, P is located on extension of BA + // If s>1, P is located on extension of CD + // If s<0, P is located on extension of DC + //*/ + + // Find intersection point + return Ogre::Vector2((a.x + (r * (b.x - a.x))), + (a.y + (r * (b.y - a.y)))); + } +} Added: trunk/python-ogre/ThirdParty/Hydrax/Help.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Help.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Help.h 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,118 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#ifndef _Hydrax_Help_H_ +#define _Hydrax_Help_H_ + +#include "Prerequisites.h" + +namespace Hydrax +{ + /** Struct wich contains an especific width and height value + */ + struct DllExport Size + { + /// Width value + int Width; + /// Height value + int Height; + + /** Default constructor + */ + Size() + { + Width = 0; + Height = 0; + } + + /** Constructor + @param size The width and height values + */ + Size(const int &size) + { + Width = size; + Height = size; + } + + /** Constructor + @param width Width value + @param height Height value + */ + Size(const int &width, const int &height) + { + Width = width; + Height = height; + } + + /** Destructor + */ + ~Size() + { + } + + /** Sets the same width and height value + @param size The width and height values + */ + void setSize(const int &size) + { + Width = size; + Height = size; + } + + /** Sets the especified values + @param width Width value + @param height Height value + */ + void setSize(const int &width, const int &height) + { + Width = width; + Height = height; + } + }; + + /** Math class with some help funtions + */ + class Math + { + public: + /** Constructor + */ + Math(){}; + /** Destructor + */ + ~Math(){}; + + /** Find the intersection point of two lines + @param a First line origin + @param b First line final + @param c First line origin + @param d First line final + @return Ogre::Vector2::ZERO if there isn't intersection, intersection point + */ + static Ogre::Vector2 intersectionOfTwoLines(const Ogre::Vector2 &a, const Ogre::Vector2 &b, + const Ogre::Vector2 &c, const Ogre::Vector2 &d); + }; +} + +#endif Added: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,1210 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#pragma warning(disable:4355) + +#include "Hydrax.h" + +namespace Hydrax +{ + + Hydrax::Hydrax(Ogre::SceneManager *sm, Ogre::Camera *c) + : mSceneManager(sm) + , mCamera(c) + , mCreated(false) + , mPolygonMode(0) + , mShaderMode(MaterialManager::SM_HLSL) + , mPosition(Ogre::Vector3(0,0,0)) + , mPlanesError(0) + , mFullReflectionDistance(99999997952.0) + , mGlobalTransparency(0.05) + , mNormalDistortion(0.09) + , mSunPosition(Ogre::Vector3(5000,3000,1)) + , mSunStrength(1.75) + , mSunArea(150) + , mSunColor(Ogre::Vector3(1,0.75,0.25)) + , mFoamMaxDistance(75000000.0) + , mFoamScale(0.0075) + , mFoamStart(0) + , mFoamTransparency(1) + , mDepthLimit(0) + , mDepthColor(Ogre::Vector3(0,0.1,0.172)) + , mSmoothPower(30) + , mCausticsScale(20) + , mCausticsPower(15) + , mCausticsEnd(0.55) + , mMesh(new Mesh(this)) + , mTextureManager(new TextureManager(this)) + , mMaterialManager(new MaterialManager(this)) + , mDecalsManager(new DecalsManager(this)) + , mModule(0) + , mSceneNode(0) + , mRefractionPlane(0) + , mReflectionPlane(0) + , mDepthPlane(0) + , mTextureRefraction(0) + , mTextureReflection(0) + , mTextureDepth(0) + , mPlanesSceneNode(0) + , mComponents(HYDRAX_COMPONENTS_NONE) + { + HydraxLOG("Hydrax object created."); + } + + Hydrax::~Hydrax() + { + if (mModule) + { + delete mModule; + } + + if (mSceneNode) + { + mSceneNode->detachAllObjects(); + mSceneNode->getParentSceneNode()->removeAndDestroyChild(mSceneNode->getName()); + + delete mTextureManager; + delete mMaterialManager; + delete mDecalsManager; + delete mMesh; + } + + if (mPlanesSceneNode) + { + mPlanesSceneNode->detachAllObjects(); + mPlanesSceneNode->getParentSceneNode()->removeAndDestroyChild(mPlanesSceneNode->getName()); + + Ogre::RenderTarget* mRT_TextureRefraction = mTextureRefraction->getBuffer()->getRenderTarget(); + mRT_TextureRefraction->removeAllListeners(); + mRT_TextureRefraction->removeAllViewports(); + + Ogre::RenderTarget* mRT_TextureReflection = mTextureReflection->getBuffer()->getRenderTarget(); + mRT_TextureReflection->removeAllListeners(); + mRT_TextureReflection->removeAllViewports(); + + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); + mRT_TextureDepth->removeAllListeners(); + mRT_TextureDepth->removeAllViewports(); + + Ogre::TextureManager::getSingleton().remove("HydraxDepthMap"); + + Ogre::MeshManager::getSingleton().remove("DepthClipPlane"); + } + + Ogre::TextureManager::getSingleton().remove("HydraxReflectionMap"); + Ogre::TextureManager::getSingleton().remove("HydraxRefractionMap"); + + Ogre::MeshManager::getSingleton().remove("RefractionClipPlane"); + Ogre::MeshManager::getSingleton().remove("ReflectionClipPlane"); + } + + HydraxLOG("Hydrax object removed."); + } + + void Hydrax::create() + { + if (mModule == NULL) + { + HydraxLOG("Module isn't set, skipping..."); + + return; + } + + if (mCreated) + { + HydraxLOG("Hydrax alredy created, skipping..."); + + return; + } + + HydraxLOG("Creating module."); + mModule->create(); + HydraxLOG("Module created."); + + HydraxLOG("Creating RTListeners."); + _createRttListeners(); + HydraxLOG("RTListeners created"); + + HydraxLOG("Registring device restored listener"); + mDeviceRestoredListener.mHydrax = this; + Ogre::Root::getSingleton().getRenderSystem()->addListener(&mDeviceRestoredListener); + HydraxLOG("Device restored listener registred"); + + HydraxLOG("Creating materials,"); + mMaterialManager->createMaterials(mComponents, MaterialManager::Options(mShaderMode, mModule->getNormalMode())); + mMesh->setMaterialName(mMaterialManager->getMaterial(MaterialManager::MAT_WATER)->getName()); + HydraxLOG("Materials created."); + + HydraxLOG("Creating water mesh."); + mSceneNode = mSceneManager->getRootSceneNode()->createChildSceneNode(); + mMesh->setOptions(mModule->getMeshOptions()); + mMesh->create(mSceneNode); + HydraxLOG("Water mesh created"); + + mCreated = true; + } + + void Hydrax::DeviceRestoredListener::eventOccurred(const Ogre::String& eventName, const Ogre::NameValuePairList *parameters) + { + if (eventName == "DeviceRestored") + { + // Restore mesh + HydraxLOG("Restoring water mesh."); + if (mHydrax->mMesh->isCreated()) + { + Ogre::String MaterialNameTmp = mHydrax->mMesh->getMaterialName(); + Mesh::Options MeshOptionsTmp = mHydrax->mMesh->getOptions(); + + HydraxLOG("Updating water mesh."); + + HydraxLOG("Deleting water mesh."); + delete mHydrax->mMesh; + HydraxLOG("Water mesh deleted."); + + HydraxLOG("Creating water mesh."); + mHydrax->mMesh = new Mesh(mHydrax); + mHydrax->mMesh->setOptions(MeshOptionsTmp); + mHydrax->mMesh->setMaterialName(MaterialNameTmp); + mHydrax->mMesh->create(mHydrax->mSceneNode); + mHydrax->setPosition(mHydrax->mPosition); + mHydrax->mModule->update(0); // ??? + HydraxLOG("Water mesh created"); + } + HydraxLOG("Water mesh restored."); + } + } + + void Hydrax::_createRttListeners() + { + if (!mCreated) + { + mRefractionPlane = new Ogre::MovablePlane("RefractionPlane"); + mReflectionPlane = new Ogre::MovablePlane("ReflectionPlane"); + + mRefractionPlane->d = 0; + mReflectionPlane->d = 0; + + mRefractionPlane->normal = Ogre::Vector3::NEGATIVE_UNIT_Y; + mReflectionPlane->normal = Ogre::Vector3::UNIT_Y; + + Ogre::MeshManager::getSingleton().createPlane( + "RefractionClipPlane",HYDRAX_RESOURCE_GROUP, + *mRefractionPlane, + mMesh->getSize().Width,mMesh->getSize().Height, + 10,10,true,1,5,5,Ogre::Vector3::UNIT_Z); + + Ogre::MeshManager::getSingleton().createPlane( + "ReflectionClipPlane",HYDRAX_RESOURCE_GROUP, + *mReflectionPlane, + mMesh->getSize().Width,mMesh->getSize().Height, + 10,10,true,1,5,5,Ogre::Vector3::UNIT_Z); + + mRefractionPlane->setCastShadows(false); + mReflectionPlane->setCastShadows(false); + + mPlanesSceneNode = mSceneManager->getRootSceneNode()->createChildSceneNode(); + mPlanesSceneNode->attachObject(mRefractionPlane); + mPlanesSceneNode->attachObject(mReflectionPlane); + + mReflectionListener.mHydrax = this; + mRefractionListener.mHydrax = this; + + mReflectionListener.mCReflectionQueueListener.mHydrax = this; + mReflectionListener.mCReflectionQueueListener.mActive = false; + mSceneManager->addRenderQueueListener(&mReflectionListener.mCReflectionQueueListener); + } + + Ogre::TextureManager::getSingleton().remove("HydraxReflectionMap"); + Ogre::TextureManager::getSingleton().remove("HydraxRefractionMap"); + + mTextureRefraction = Ogre::TextureManager::getSingleton().createManual( + "HydraxRefractionMap", + HYDRAX_RESOURCE_GROUP, + Ogre::TEX_TYPE_2D, + mRttOptions.RefractionQuality, mRttOptions.RefractionQuality, 0, + Ogre::PF_R8G8B8, + Ogre::TU_RENDERTARGET); + + Ogre::RenderTarget* mRT_TextureRefraction = mTextureRefraction->getBuffer()->getRenderTarget(); + { + Ogre::Viewport *v = mRT_TextureRefraction->addViewport(mCamera); + v->setClearEveryFrame(true); + v->setBackgroundColour(Ogre::ColourValue::White); + v->setOverlaysEnabled(false); + + mRT_TextureRefraction->addListener(&mRefractionListener); + } + + mTextureReflection = Ogre::TextureManager::getSingleton().createManual( + "HydraxReflectionMap", + HYDRAX_RESOURCE_GROUP, + Ogre::TEX_TYPE_2D, + mRttOptions.ReflectionQuality, mRttOptions.ReflectionQuality, 0, + Ogre::PF_R8G8B8, + Ogre::TU_RENDERTARGET); + + Ogre::RenderTarget* mRT_TextureReflection = mTextureReflection->getBuffer()->getRenderTarget(); + { + Ogre::Viewport *v = mRT_TextureReflection->addViewport(mCamera); + v->setClearEveryFrame(true); + v->setBackgroundColour(Ogre::ColourValue::White); + v->setOverlaysEnabled(false); + + mRT_TextureReflection->addListener(&mReflectionListener); + } + + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + _createDepthRttListener(); + } + + getMaterialManager()->reload(MaterialManager::MAT_WATER); + } + + void Hydrax::_createDepthRttListener(const bool &Create, const bool &Delete) + { + if (Create) + { + Ogre::TextureManager::getSingleton().remove("HydraxDepthMap"); + + if (!mCreated) + { + mDepthPlane = new Ogre::MovablePlane("DepthPlane"); + + mDepthPlane->d = 0; + mDepthPlane->normal = Ogre::Vector3::NEGATIVE_UNIT_Y; + + Ogre::MeshManager::getSingleton().createPlane( + "DepthClipPlane",HYDRAX_RESOURCE_GROUP, + *mDepthPlane, + mMesh->getSize().Width,mMesh->getSize().Height, + 10,10,true,1,5,5,Ogre::Vector3::UNIT_Z); + + mDepthPlane->setCastShadows(false); + + mPlanesSceneNode->attachObject(mDepthPlane); + + mDepthListener.mHydrax = this; + } + + mTextureDepth = Ogre::TextureManager::getSingleton().createManual( + "HydraxDepthMap", + HYDRAX_RESOURCE_GROUP, + Ogre::TEX_TYPE_2D, + mRttOptions.DepthQuality, mRttOptions.DepthQuality, 0, + Ogre::PF_R8G8B8, + Ogre::TU_RENDERTARGET); + + Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); + { + Ogre::Viewport *v = mRT_TextureDepth->addViewport(mCamera); + v->setClearEveryFrame(true); + v->setBackgroundColour(Ogre::ColourValue::Black); + v->setOverlaysEnabled(false); + v->setMaterialScheme("HydraxDepth"); + v->setSkiesEnabled(false); + + mRT_TextureDepth->addListener(&mDepthListener); + } + + getMaterialManager()->reload(MaterialManager::MAT_WATER); + } + if (Delete) + { + Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); + mRT_TextureDepth->removeAllListeners(); + mRT_TextureDepth->removeAllViewports(); + + Ogre::TextureManager::getSingleton().remove("HydraxDepthMap"); + + Ogre::MeshManager::getSingleton().remove("DepthClipPlane"); + } + } + + void Hydrax::CReflectionListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) + { + mCReflectionQueueListener.mActive = true; + + mHydrax->mMesh->getEntity()->setVisible(false); + mHydrax->mReflectionPlane->getParentNode()->translate(0,mHydrax->mPlanesError,0); + + if (mHydrax->mCamera->getPosition().y < mHydrax->mReflectionPlane->getParentNode()->getPosition().y) + { + mCameraPlaneDiff = mHydrax->mReflectionPlane->getParentNode()->getPosition().y-mHydrax->mCamera->getPosition().y+0.05; + mHydrax->mReflectionPlane->getParentNode()->translate(0,-mCameraPlaneDiff,0); + } + else + { + mCameraPlaneDiff = 0; + } + + mHydrax->mCamera->enableReflection(mHydrax->mReflectionPlane); + mHydrax->mCamera->enableCustomNearClipPlane(mHydrax->mReflectionPlane); + } + + void Hydrax::CReflectionListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) + { + mHydrax->mMesh->getEntity()->setVisible(true); + + if (mCameraPlaneDiff != 0) + { + mHydrax->mReflectionPlane->getParentNode()->translate(0,mCameraPlaneDiff,0); + } + + mHydrax->mReflectionPlane->getParentNode()->translate(0,-mHydrax->mPlanesError,0); + + mHydrax->mCamera->disableReflection(); + mHydrax->mCamera->disableCustomNearClipPlane(); + + mCReflectionQueueListener.mActive = false; + } + + void Hydrax::CRefractionListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) + { + mHydrax->mMesh->getEntity()->setVisible(false); + mHydrax->mRefractionPlane->getParentNode()->translate(0,mHydrax->mPlanesError,0); + + if (mHydrax->mCamera->getPosition().y < mHydrax->mRefractionPlane->getParentNode()->getPosition().y) + { + mCameraPlaneDiff = mHydrax->mRefractionPlane->getParentNode()->getPosition().y-mHydrax->mCamera->getPosition().y+0.05; + mHydrax->mRefractionPlane->getParentNode()->translate(0,-mCameraPlaneDiff,0); + } + else + { + mCameraPlaneDiff = 0; + } + + mHydrax->mCamera->enableCustomNearClipPlane(mHydrax->mRefractionPlane); + } + + void Hydrax::CRefractionListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) + { + mHydrax->mMesh->getEntity()->setVisible(true); + mHydrax->mRefractionPlane->getParentNode()->translate(0,-mHydrax->mPlanesError,0); + + if (mCameraPlaneDiff != 0) + { + mHydrax->mRefractionPlane->getParentNode()->translate(0,mCameraPlaneDiff,0); + } + + mHydrax->mCamera->disableCustomNearClipPlane(); + } + + void Hydrax::CDepthListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) + { + mHydrax->mMesh->getEntity()->setVisible(false); + + Ogre::SceneManager::MovableObjectIterator EntityIterator = + mHydrax->mSceneManager->getMovableObjectIterator("Entity"); + Ogre::Entity* CurrentEntity; + unsigned int k; + + mMaterials.empty(); + + while (EntityIterator.hasMoreElements()) + { + CurrentEntity = static_cast<Ogre::Entity*>(EntityIterator.peekNextValue()); + + for(k = 0; k < CurrentEntity->getNumSubEntities(); k++) + { + mMaterials.push(CurrentEntity->getSubEntity(k)->getMaterialName()); + + CurrentEntity->getSubEntity(k)->setMaterialName(mHydrax->getMaterialManager()->getMaterial(MaterialManager::MAT_DEPTH)->getName()); + } + + EntityIterator.moveNext(); + } + + mHydrax->mDepthPlane->getParentNode()->translate(0,mHydrax->mPlanesError,0); + + if (mHydrax->mCamera->getPosition().y < mHydrax->mDepthPlane->getParentNode()->getPosition().y) + { + mCameraPlaneDiff = mHydrax->mDepthPlane->getParentNode()->getPosition().y-mHydrax->mCamera->getPosition().y+0.05; + mHydrax->mDepthPlane->getParentNode()->translate(0,-mCameraPlaneDiff,0); + } + else + { + mCameraPlaneDiff = 0; + } + + mHydrax->mCamera->enableCustomNearClipPlane(mHydrax->mDepthPlane); + } + + void Hydrax::CDepthListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) + { + Ogre::SceneManager::MovableObjectIterator EntityIterator = + mHydrax->mSceneManager->getMovableObjectIterator("Entity"); + Ogre::Entity* CurrentEntity; + unsigned int k; + + while (EntityIterator.hasMoreElements()) + { + CurrentEntity = static_cast<Ogre::Entity*>(EntityIterator.peekNextValue()); + + for(k = 0; k < CurrentEntity->getNumSubEntities(); k++) + { + CurrentEntity->getSubEntity(k)->setMaterialName(mMaterials.front()); + + mMaterials.pop(); + } + + EntityIterator.moveNext(); + } + + mHydrax->mMesh->getEntity()->setVisible(true); + + mHydrax->mCamera->disableCustomNearClipPlane(); + + if (mCameraPlaneDiff != 0) + { + mHydrax->mDepthPlane->getParentNode()->translate(0,mCameraPlaneDiff,0); + } + + mHydrax->mDepthPlane->getParentNode()->translate(0,-mHydrax->mPlanesError,0); + } + + void Hydrax::setRttOptions(const RttOptions &RttOptions) + { + mRttOptions = RttOptions; + + if (mCreated) + { + HydraxLOG("Updating Rtt options."); + + Ogre::RenderTarget* mRT_TextureRefraction = mTextureRefraction->getBuffer()->getRenderTarget(); + mRT_TextureRefraction->removeAllListeners(); + mRT_TextureRefraction->removeAllViewports(); + + Ogre::RenderTarget* mRT_TextureReflection = mTextureReflection->getBuffer()->getRenderTarget(); + mRT_TextureReflection->removeAllListeners(); + mRT_TextureReflection->removeAllViewports(); + + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + Ogre::RenderTarget* mRT_TextureDepth = mTextureDepth->getBuffer()->getRenderTarget(); + mRT_TextureDepth->removeAllListeners(); + mRT_TextureDepth->removeAllViewports(); + + Ogre::TextureManager::getSingleton().remove("HydraxDepthMap"); + } + + Ogre::TextureManager::getSingleton().remove("HydraxReflectionMap"); + Ogre::TextureManager::getSingleton().remove("HydraxRefractionMap"); + + _createRttListeners(); + + mMaterialManager->reload(MaterialManager::MAT_WATER); + + HydraxLOG("Rtt options updated."); + } + } + + void Hydrax::setPolygonMode(const int &Tipe) + { + Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(mMesh->getMaterialName()); + + if (Tipe == 0) + { + mat->getTechnique(0)->getPass(0)->setPolygonMode(Ogre::PM_SOLID); + } + else if (Tipe == 1) + { + mat->getTechnique(0)->getPass(0)->setPolygonMode(Ogre::PM_WIREFRAME); + } + else if (Tipe == 2) + { + mat->getTechnique(0)->getPass(0)->setPolygonMode(Ogre::PM_POINTS); + } + } + + void Hydrax::setShaderMode(const MaterialManager::ShaderMode& ShaderMode) + { + mShaderMode = ShaderMode; + + if (mCreated && mModule) + { + mMaterialManager->createMaterials(mComponents, MaterialManager::Options(mShaderMode, mModule->getNormalMode())); + + mMesh->setMaterialName(mMaterialManager->getMaterial(MaterialManager::MAT_WATER)->getName()); + } + } + + void Hydrax::update(const Ogre::Real &timeSinceLastFrame) + { + if (mCreated && mModule) + { + mModule->update(timeSinceLastFrame); + mDecalsManager->update(); + } + } + + void Hydrax::setComponents(const HydraxComponent &Components) + { + // Create/Delete depth rtt listeners if it's necesary + if (mCreated) + { + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + if (!(Components & HYDRAX_COMPONENT_DEPTH)) + { + _createDepthRttListener(false, true); + } + } + else + { + if (Components & HYDRAX_COMPONENT_DEPTH) + { + _createDepthRttListener(); + } + } + } + + mComponents = Components; + + if (isComponent(HYDRAX_COMPONENT_SMOOTH) || isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + if (!isComponent(HYDRAX_COMPONENT_DEPTH)) + { + // Delete smooth or caustics components + HydraxComponent s = HYDRAX_COMPONENTS_NONE, + f = HYDRAX_COMPONENTS_NONE; + + if(isComponent(HYDRAX_COMPONENT_SUN)) + { + s = HYDRAX_COMPONENT_SUN; + } + if(isComponent(HYDRAX_COMPONENT_FOAM)) + { + f = HYDRAX_COMPONENT_FOAM; + } + + if(isComponent(HYDRAX_COMPONENT_SMOOTH)) + { + HydraxLOG("Smooth component needs depth component... smooth component desactivated."); + } + if(isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + HydraxLOG("Caustics component needs depth component... cautics component desactivated."); + } + + mComponents = static_cast<HydraxComponent>(s|f); + } + } + + if (!mCreated || !mModule) + { + return; + } + + mMaterialManager->createMaterials(mComponents, MaterialManager::Options(mShaderMode, mModule->getNormalMode())); + + mMesh->setMaterialName(mMaterialManager->getMaterial(MaterialManager::MAT_WATER)->getName()); + } + + void Hydrax::setModule(Module::Module* Module) + { + if (mModule) + { + if (mModule->getNormalMode() != Module->getNormalMode()) + { + mMaterialManager->createMaterials(mComponents, MaterialManager::Options(mShaderMode, Module->getNormalMode())); + + mMesh->setMaterialName(mMaterialManager->getMaterial(MaterialManager::MAT_WATER)->getName()); + } + + delete mModule; + } + + mModule = Module; + + if (mCreated) + { + HydraxLOG("Updating water mesh."); + Ogre::String MaterialNameTmp = mMesh->getMaterialName(); + + HydraxLOG("Deleting water mesh."); + delete mMesh; + HydraxLOG("Water mesh deleted."); + + HydraxLOG("Creating water mesh."); + mMesh = new Mesh(this); + mMesh->setOptions(mModule->getMeshOptions()); + mMesh->setMaterialName(MaterialNameTmp); + mMesh->create(mSceneNode); + setPosition(mPosition); + HydraxLOG("Water mesh created"); + + HydraxLOG("Module set."); + } + } + + bool Hydrax::isComponent(const HydraxComponent &Component) + { + if (mComponents & Component) + { + return true; + } + + if (Component == HYDRAX_COMPONENTS_NONE && mComponents == HYDRAX_COMPONENTS_NONE) + { + return true; + } + + if (Component == HYDRAX_COMPONENTS_ALL && mComponents == HYDRAX_COMPONENTS_ALL) + { + return true; + } + + return false; + } + + void Hydrax::saveCfg(const Ogre::String &FileName) + { + FILE *cfgFile = fopen(FileName.c_str(), "w"); + + if (cfgFile) + { + Ogre::String tmpStr = ""; + + // Hydrax version + tmpStr += "#Version\n"; + tmpStr += "HydraxVersion="+ + // Major + Ogre::StringConverter::toString(HYDRAX_VERSION_MAJOR)+"."+ + // Minor + Ogre::StringConverter::toString(HYDRAX_VERSION_MINOR)+"."+ + // Patch + Ogre::StringConverter::toString(HYDRAX_VERSION_PATCH)+"\n\n"; + + /* // Mesh field + tmpStr += "#Mesh\n"; + tmpStr += "MeshSize="+ + // X + Ogre::StringConverter::toString(mMesh->getSize().Width)+"x"+ + // Z + Ogre::StringConverter::toString(mMesh->getSize().Height)+"\n"; + tmpStr += "MeshComplexity="+Ogre::StringConverter::toString(mMesh->getComplexity())+"\n\n"; +*/ + // Components field + tmpStr += "#Components\n"; + tmpStr += "ComponentSun=" +Ogre::StringConverter::toString(isComponent(HYDRAX_COMPONENT_SUN ))+"\n"; + tmpStr += "ComponentFoam=" +Ogre::StringConverter::toString(isComponent(HYDRAX_COMPONENT_FOAM ))+"\n"; + tmpStr += "ComponentDepth=" +Ogre::StringConverter::toString(isComponent(HYDRAX_COMPONENT_DEPTH ))+"\n"; + tmpStr += "ComponentSmooth=" +Ogre::StringConverter::toString(isComponent(HYDRAX_COMPONENT_SMOOTH ))+"\n"; + tmpStr += "ComponentCaustics="+Ogre::StringConverter::toString(isComponent(HYDRAX_COMPONENT_CAUSTICS))+"\n\n"; + + // Rtt quality field + tmpStr += "#Rtt quality\n"; + tmpStr += "RttReflection="+Ogre::StringConverter::toString(static_cast<int>(getRttOptions().ReflectionQuality))+"\n"; + tmpStr += "RttRefraction="+Ogre::StringConverter::toString(static_cast<int>(getRttOptions().RefractionQuality))+"\n"; + tmpStr += "RttDepth=" +Ogre::StringConverter::toString(static_cast<int>(getRttOptions().DepthQuality)) +"\n\n"; + + // Params fields + // Main + tmpStr += "#Main parameters\n"; + tmpStr += "FullReflectionDistance="+Ogre::StringConverter::toString(getFullReflectionDistance())+"\n"; + tmpStr += "GlobalTransparency=" +Ogre::StringConverter::toString(getGlobalTransparency() )+"\n"; + tmpStr += "NormalDistortion=" +Ogre::StringConverter::toString(getNormalDistortion() )+"\n\n"; + // Sun + if (isComponent(HYDRAX_COMPONENT_SUN)) + { + tmpStr += "#Sun parameters\n"; + tmpStr += "Sun_Position=" + + Ogre::StringConverter::toString(getSunPosition().x)+"x"+ + Ogre::StringConverter::toString(getSunPosition().y)+"x"+ + Ogre::StringConverter::toString(getSunPosition().z)+"\n"; + tmpStr += "Sun_Strength="+Ogre::StringConverter::toString(getSunStrength())+"\n"; + tmpStr += "Sun_Area=" +Ogre::StringConverter::toString(getSunArea() )+"\n"; + tmpStr += "Sun_Color=" + + Ogre::StringConverter::toString(getSunColor().x)+"x"+ + Ogre::StringConverter::toString(getSunColor().y)+"x"+ + Ogre::StringConverter::toString(getSunColor().z)+"\n\n"; + } + // Foam + if (isComponent(HYDRAX_COMPONENT_FOAM)) + { + tmpStr += "#Foam parameters\n"; + tmpStr += "Foam_MaxDistance=" +Ogre::StringConverter::toString(getFoamMaxDistance() )+"\n"; + tmpStr += "Foam_Scale=" +Ogre::StringConverter::toString(getFoamScale() )+"\n"; + tmpStr += "Foam_Start=" +Ogre::StringConverter::toString(getFoamStart() )+"\n"; + tmpStr += "Foam_Transparency="+Ogre::StringConverter::toString(getFoamTransparency())+"\n\n"; + } + // Depth + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + tmpStr += "#Depth parameters\n"; + tmpStr += "Depth_Limit=" +Ogre::StringConverter::toString(getDepthLimit())+"\n"; + tmpStr += "Depth_Color=" + + Ogre::StringConverter::toString(getDepthColor().x)+"x"+ + Ogre::StringConverter::toString(getDepthColor().y)+"x"+ + Ogre::StringConverter::toString(getDepthColor().z)+"\n\n"; + } + // Smooth + if (isComponent(HYDRAX_COMPONENT_SMOOTH)) + { + tmpStr += "#Smooth parameters\n"; + tmpStr += "Smooth_Power=" +Ogre::StringConverter::toString(getSmoothPower())+"\n\n"; + } + // Caustics + if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + tmpStr += "#Caustics parameters\n"; + tmpStr += "Caustics_Scale=" +Ogre::StringConverter::toString(getCausticsScale())+"\n"; + tmpStr += "Caustics_Power=" +Ogre::StringConverter::toString(getCausticsPower())+"\n"; + tmpStr += "Caustics_End=" +Ogre::StringConverter::toString(getCausticsEnd()) +"\n\n"; + } + + // Save module config + if (mModule) + { + mModule->saveCfg(tmpStr); + } + + fprintf(cfgFile, "%s", tmpStr.c_str()); + fclose(cfgFile); + + try + { + Ogre::ResourceGroupManager::getSingleton().removeResourceLocation(FileName, HYDRAX_RESOURCE_GROUP); + } + catch(...) + { + } + + Ogre::ResourceGroupManager::getSingleton().addResourceLocation(FileName, "FileSystem", HYDRAX_RESOURCE_GROUP); + } + + HydraxLOG(FileName + " saved."); + } + + void Hydrax::loadCfg(const Ogre::String &FileName) + { + Ogre::ConfigFile CfgFile; + + CfgFile.load(FileName); + + // Check version + if(CfgFile.getSetting("HydraxVersion") != ( + // Major + Ogre::StringConverter::toString(HYDRAX_VERSION_MAJOR)+"."+ + // Minor + Ogre::StringConverter::toString(HYDRAX_VERSION_MINOR)+"."+ + // Patch + Ogre::StringConverter::toString(HYDRAX_VERSION_PATCH))) + { + HydraxLOG("Config file version doesn't correspond with Hydrax version."); + + return; + } + + // Load components + HydraxComponent s = HYDRAX_COMPONENTS_NONE, + f = HYDRAX_COMPONENTS_NONE, + d = HYDRAX_COMPONENTS_NONE, + sm = HYDRAX_COMPONENTS_NONE, + c = HYDRAX_COMPONENTS_NONE; + + if (Ogre::StringConverter::parseBool(CfgFile.getSetting("ComponentSun"))) + { + s = HYDRAX_COMPONENT_SUN; + } + if (Ogre::StringConverter::parseBool(CfgFile.getSetting("ComponentFoam"))) + { + f = HYDRAX_COMPONENT_FOAM; + } + if (Ogre::StringConverter::parseBool(CfgFile.getSetting("ComponentDepth"))) + { + d = HYDRAX_COMPONENT_DEPTH; + } + if (Ogre::StringConverter::parseBool(CfgFile.getSetting("ComponentSmooth"))) + { + sm = HYDRAX_COMPONENT_SMOOTH; + } + if (Ogre::StringConverter::parseBool(CfgFile.getSetting("ComponentCaustics"))) + { + c = HYDRAX_COMPONENT_CAUSTICS; + } + + setComponents(static_cast<HydraxComponent>(s | f | d | sm | c)); + + // Load Rtt options + setRttOptions( + RttOptions( + // Reflection + static_cast<TextureQuality>(Ogre::StringConverter::parseInt(CfgFile.getSetting("RttReflection"))), + // Refraction + static_cast<TextureQuality>(Ogre::StringConverter::parseInt(CfgFile.getSetting("RttRefraction"))), + // Depth + static_cast<TextureQuality>(Ogre::StringConverter::parseInt(CfgFile.getSetting("RttDepth"))))); + + // Load params options + // Main + setFullReflectionDistance(Ogre::StringConverter::parseReal(CfgFile.getSetting("FullReflectionDistance"))); + setGlobalTransparency(Ogre::StringConverter::parseReal(CfgFile.getSetting("GlobalTransparency"))); + setNormalDistortion(Ogre::StringConverter::parseReal(CfgFile.getSetting("NormalDistortion"))); + // Sun + if (isComponent(HYDRAX_COMPONENT_SUN)) + { + setSunPosition( + Ogre::Vector3( + // X + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Sun_Position"), "x")[0]), + // Y + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Sun_Position"), "x")[1]), + // Z + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Sun_Position"), "x")[2]))); + + setSunStrength(Ogre::StringConverter::parseReal(CfgFile.getSetting("Sun_Strength"))); + setSunArea(Ogre::StringConverter::parseReal(CfgFile.getSetting("Sun_Area"))); + + setSunColor( + Ogre::Vector3( + // X + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Sun_Color"), "x")[0]), + // Y + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Sun_Color"), "x")[1]), + // Z + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Sun_Color"), "x")[2]))); + } + // Foam + if (isComponent(HYDRAX_COMPONENT_FOAM)) + { + setFoamMaxDistance(Ogre::StringConverter::parseReal(CfgFile.getSetting("Foam_MaxDistance"))); + setFoamScale(Ogre::StringConverter::parseReal(CfgFile.getSetting("Foam_Scale"))); + setFoamStart(Ogre::StringConverter::parseReal(CfgFile.getSetting("Foam_Start"))); + setFoamTransparency(Ogre::StringConverter::parseReal(CfgFile.getSetting("Foam_Transparency"))); + } + // Depth + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + setDepthLimit(Ogre::StringConverter::parseReal(CfgFile.getSetting("Depth_Limit"))); + + setDepthColor( + Ogre::Vector3( + // X + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Depth_Color"), "x")[0]), + // Y + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Depth_Color"), "x")[1]), + // Z + Ogre::StringConverter::parseReal( + Ogre::StringUtil::split(CfgFile.getSetting("Depth_Color"), "x")[2]))); + } + // Depth + if (isComponent(HYDRAX_COMPONENT_SMOOTH)) + { + setSmoothPower(Ogre::StringConverter::parseReal(CfgFile.getSetting("Smooth_Power"))); + } + // Caustics + if (isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + setCausticsScale(Ogre::StringConverter::parseReal(CfgFile.getSetting("Caustics_Scale"))); + setCausticsPower(Ogre::StringConverter::parseReal(CfgFile.getSetting("Caustics_Power"))); + setCausticsEnd(Ogre::StringConverter::parseReal(CfgFile.getSetting("Caustics_End"))); + } + + // Load module config + if (mModule) + { + mModule->loadCfg(CfgFile); + } + + HydraxLOG(FileName + " loaded."); + } + + void Hydrax::setPosition(const Ogre::Vector3 &Position) + { + mPosition = Position; + + if (isComponent(HYDRAX_COMPONENT_DEPTH)) + { + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_VERTEX, MaterialManager::MAT_DEPTH, + "uPlaneYPos", Position.y); + } + + mSceneNode->setPosition(Position); + mPlanesSceneNode->setPosition(Position); + } + + void Hydrax::rotate(const Ogre::Quaternion &q) + { + mSceneNode->rotate(q); + mPlanesSceneNode->rotate(q); + } + + void Hydrax::setPlanesError(const Ogre::Real &PlanesError) + { + mPlanesError = PlanesError; + } + + void Hydrax::_setStrength(const Ogre::Real &Strength) + { + if (isComponent(HYDRAX_COMPONENT_FOAM)) + { + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uFoamRange", Strength); + } + + mDecalsManager->_setWaterStrength(Strength); + } + + void Hydrax::setFullReflectionDistance(const Ogre::Real &FullReflectionDistance) + { + mFullReflectionDistance = FullReflectionDistance; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uFullReflectionDistance", FullReflectionDistance); + } + + void Hydrax::setGlobalTransparency(const Ogre::Real &GlobalTransparency) + { + mGlobalTransparency = GlobalTransparency; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uGlobalTransparency", GlobalTransparency); + } + + void Hydrax::setNormalDistortion(const Ogre::Real &NormalDistortion) + { + mNormalDistortion = NormalDistortion; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uNormalDistortion", NormalDistortion); + } + + void Hydrax::setSunPosition(const Ogre::Vector3 &SunPosition) + { + if (!isComponent(HYDRAX_COMPONENT_SUN)) + { + return; + } + + mSunPosition = SunPosition; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uSunPosition", SunPosition); + } + + void Hydrax::setSunStrength(const Ogre::Real &SunStrength) + { + if (!isComponent(HYDRAX_COMPONENT_SUN)) + { + return; + } + + mSunStrength = SunStrength; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uSunStrength", SunStrength); + } + + void Hydrax::setSunArea(const Ogre::Real &SunArea) + { + if (!isComponent(HYDRAX_COMPONENT_SUN)) + { + return; + } + + mSunArea = SunArea; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uSunArea", SunArea); + } + + void Hydrax::setSunColor(const Ogre::Vector3 &SunColor) + { + if (!isComponent(HYDRAX_COMPONENT_SUN)) + { + return; + } + + mSunColor = SunColor; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uSunColor", SunColor); + } + + void Hydrax::setFoamMaxDistance(const Ogre::Real &FoamMaxDistance) + { + if (!isComponent(HYDRAX_COMPONENT_FOAM)) + { + return; + } + + mFoamMaxDistance = FoamMaxDistance; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uFoamMaxDistance", FoamMaxDistance); + } + + void Hydrax::setFoamScale(const Ogre::Real &FoamScale) + { + if (!isComponent(HYDRAX_COMPONENT_FOAM)) + { + return; + } + + mFoamScale = FoamScale; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uFoamScale", FoamScale); + } + + void Hydrax::setFoamStart(const Ogre::Real &FoamStart) + { + if (!isComponent(HYDRAX_COMPONENT_FOAM)) + { + return; + } + + mFoamStart = FoamStart; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uFoamStart", FoamStart); + } + + void Hydrax::setFoamTransparency(const Ogre::Real &FoamTransparency) + { + if (!isComponent(HYDRAX_COMPONENT_FOAM)) + { + return; + } + + mFoamTransparency = FoamTransparency; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uFoamTransparency", FoamTransparency); + } + + void Hydrax::setDepthColor(const Ogre::Vector3 &DepthColor) + { + if (!isComponent(HYDRAX_COMPONENT_DEPTH)) + { + return; + } + + mDepthColor = DepthColor; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uDepthColor", DepthColor); + } + + void Hydrax::setDepthLimit(const Ogre::Real &DepthLimit) + { + if (!isComponent(HYDRAX_COMPONENT_DEPTH)) + { + return; + } + + mDepthLimit = DepthLimit; + + if (mDepthLimit <= 0) + { + mDepthLimit = 1; + } + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_DEPTH, + "uDepthLimit", 1/mDepthLimit); + } + + void Hydrax::setSmoothPower(const Ogre::Real &SmoothPower) + { + if (!isComponent(HYDRAX_COMPONENT_SMOOTH)) + { + return; + } + + mSmoothPower = SmoothPower; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uSmoothPower", SmoothPower); + } + + void Hydrax::setCausticsScale(const Ogre::Real &CausticsScale) + { + if (!isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + return; + } + + mCausticsScale = CausticsScale; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_DEPTH, + "uCausticsScale", CausticsScale); + } + + void Hydrax::setCausticsPower(const Ogre::Real &CausticsPower) + { + if (!isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + return; + } + + mCausticsPower = CausticsPower; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uCausticsPower", CausticsPower); + } + + void Hydrax::setCausticsEnd(const Ogre::Real &CausticsEnd) + { + if (!isComponent(HYDRAX_COMPONENT_CAUSTICS)) + { + return; + } + + mCausticsEnd = CausticsEnd; + + mMaterialManager->setGpuProgramParameter( + MaterialManager::GPUP_FRAGMENT, MaterialManager::MAT_WATER, + "uCausticsEnd", CausticsEnd); + } +} Added: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,736 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#ifndef _Hydrax_Hydrax_H_ +#define _Hydrax_Hydrax_H_ + +#include "Prerequisites.h" + +#include "Enums.h" +#include "Structs.h" +#include "Help.h" +#include "Mesh.h" +#include "Image.h" +#include "MaterialManager.h" +#include "TextureManager.h" +#include "DecalsManager.h" +#include "Modules/Module.h" + +namespace Hydrax +{ + /** Main Hydrax class. + Hydrax is a plugin for the Ogre3D engine whose aim is rendering realistic water scenes. + Do not use two instances of the Hydrax class. + */ + class DllExport Hydrax + { + public: + /** Constructor + @param sm Ogre SceneManager pointer + @param c Ogre Camera pointer + */ + Hydrax(Ogre::SceneManager *sm, Ogre::Camera *c); + + /** Destructor + */ + ~Hydrax(); + + /** Call when all params are set, creates grid water + and perlin / normal map textures + @remarks Call when all params are set + */ + void create(); + + /** Call every frame + @todo Add listener interface + */ + void update(const Ogre::Real &timeSinceLastFrame); + + /** Returns if the especified component is active + @param Component Component that we want to check + */ + bool isComponent(const HydraxComponent &Component); + + /** Set Rtt options + @param RttOptions Options + @remarks It can be called after create(), Rtt's will be updated + */ + void setRttOptions(const RttOptions &RttOptions); + + /** Set Hydrax components + @param Components Components + @remarks It can be called after create(), Components will be updated + */ + void setComponents(const HydraxComponent &Components); + + /** Set Hydrax module + @param Module Hydrax module + @remark Module will be set before call create() + */ + void setModule(Module::Module* Module); + + /** Set polygon mode: 1-Solid, 2-Wireframe, 3-Points + @param Time polygon mode: 1-Solid, 2-Wireframe, 3-Points + */ + void setPolygonMode(const int &Tipe); + + /** Set shader mode + @param ShaderMode Shader mode + */ + void setShaderMode(const MaterialManager::ShaderMode &ShaderMode); + + /** Set water position + @param Position Water position + */ + void setPosition(const Ogre::Vector3 &Position); + + /** Rotate water and planes + @param q const Ogre::Quaternion& + */ + void rotate(const Ogre::Quaternion &q); + + /** Save hydrax config to file + @param FileName File name + @remarks If module isn't set, module options won't be saved. + */ + void saveCfg(const Ogre::String &FileName); + + /** Load config from file + @param FileName File name + @remarks if module isn't set, or module isn't the same from + config file, module options won't be loaded. + */ + void loadCfg(const Ogre::String &FileName); + + /** Set clip planes error + @param PlanesError Clip planes error + */ + void setPlanesError(const Ogre::Real &PlanesError); + + /** Set water strength GPU param + @param Strength Water strength GPU param + */ + void _setStrength(const Ogre::Real &Strength); + + /** Set full reflection distance + @param FullReflectionDistance Full reflection distance + */ + void setFullReflectionDistance(const Ogre::Real &FullReflectionDistance); + + /** Set global transparency + @param GlobalTransparency Global transparency distance + */ + void setGlobalTransparency(const Ogre::Real &GlobalTransparency); + + /** Set normal distortion + @param NormalDistortion Normal distortion + @remarks Value will bi very short, like 0.025 + */ + void setNormalDistortion(const Ogre::Real &NormalDistortion); + + /** Set sun position + @param SunPosition Sun position + */ + void setSunPosition(const Ogre::Vector3 &SunPosition); + + /** Set sun strength + @param SunStrength Sun strength + */ + void setSunStrength(const Ogre::Real &SunStrength); + + /** Set sun area + @param SunArea Sun area + */ + void setSunArea(const Ogre::Real &SunArea); + + /** Set sun color + @param SunColor Sun color + */ + void setSunColor(const Ogre::Vector3 &SunColor); + + /** Set foam max distance + @param FoamMaxDistance Foam max distance + */ + void setFoamMaxDistance(const Ogre::Real &FoamMaxDistance); + + /** Set foam scale + @param FoamScale Foam scale + */ + void setFoamScale(const Ogre::Real &FoamScale); + + /** Set foam start + @param FoamStart Foam start + */ + void setFoamStart(const Ogre::Real &FoamStart); + + /** Set foam transparency + @param FoamTransparency Foam transparency + */ + void setFoamTransparency(const Ogre::Real &FoamTransparency); + + /** Set depth limit + @param DepthLimit Depth limit + */ + void setDepthLimit(const Ogre::Real &DepthLimit); + + /** Set depth color + @param DepthColor Foam color + */ + void setDepthColor(const Ogre::Vector3 &DepthColor); + + /** Set smooth power + @param SmoothPower Smooth power + @remarks Less values more transition distance, hight values short transition values, 1-50 range(aprox.) + */ + void setSmoothPower(const Ogre::Real &SmoothPower); + + /** Set caustics scale + @param CausticsScale Caustics scale + */ + void setCausticsScale(const Ogre::Real &CausticsScale); + + /** Set caustics power + @param CausticsPower Caustics power + */ + void setCausticsPower(const Ogre::Real &CausticsPower); + + /** Set caustics end + @param CausticsEnd Caustics end + */ + void setCausticsEnd(const Ogre::Real &CausticsEnd); + + /** Has create() already called? + @return Has create() already called? + */ + inline const bool& isCreated() const + { + return mCreated; + } + + /** Get rendering camera + @return Ogre::Camera pointer + */ + inline Ogre::Camera* getCamera() + { + return mCamera; + } + + /** Get scene manager + @return Ogre::SceneManager pointer + */ + inline Ogre::SceneManager* getSceneManager() + { + return mSceneManager; + } + + /** Get Hydrax::Mesh + @return Hydrax::Mesh pointer + */ + inline Mesh* getMesh() + { + return mMesh; + } + + /** Get Hydrax::MaterialManager + @return Hydrax::MaterialManager pointer + */ + inline MaterialManager* getMaterialManager() + { + return mMaterialManager; + } + + /** Get Hydrax::TextureManager + @return Hydrax::TextureManager pointer + */ + inline TextureManager* getTextureManager() + { + return mTextureManager; + } + + /** Get Hydrax::DecalsManager + @return Hydrax::DecalsManager pointer + */ + inline DecalsManager* getDecalsManager() + { + return mDecalsManager; + } + + /** Get our Hydrax::Module::Module + @return Hydrax::Module::Module pointer or NULL if Module isn't set. + */ + inline Module::Module* getModule() + { + return mModule; + } + + /** Get rtt options + @return Hydrax rtt options + */ + inline const RttOptions& getRttOptions() const + { + return mRttOptions; + } + + /** Get hydrax components selected + @return Hydrax components + */ + inline const HydraxComponent& getComponents() const + { + return mComponents; + } + + /** Get current polygon mode + @return Current polygon mode: 1-Solid, 2-Wireframe, 3-Points + */ + inline const int& getPolygonMode() const + { + return mPolygonMode; + } + + /** Get current shader mode + @return Current shader mode + */ + inline const MaterialManager::ShaderMode& getShaderMode() const + { + return mShaderMode; + } + + /** Get water position + @return Water position + */ + inline const Ogre::Vector3& getPosition() const + { + return mPosition; + } + + /** Get the current heigth at a especified world-space point + @param Position X/Z World position + @return Heigth at the given position in y-World coordinates, if it's outside of the water return -1 + */ + inline float getHeigth(const Ogre::Vector2 &Position) + { + if (mModule) + { + return mModule->getHeigth(Position); + } + + return -1; + } + + /** Get the current heigth at a especified world-space point + @param Position X/(Y)/Z World position + @return Heigth at the given position in y-World coordinates, if it's outside of the water return -1 + */ + inline float getHeigth(const Ogre::Vector3 &Position) + { + return getHeigth(Ogre::Vector2(Position.x, Position.z)); + } + + /** Get full reflection distance + @return Hydrax water full reflection distance + */ + inline const Ogre::Real& getFullReflectionDistance() const + { + return mFullReflectionDistance; + } + + /** Get global transparency + @return Hydrax water global transparency + */ + inline const Ogre::Real& getGlobalTransparency() const + { + return mGlobalTransparency; + } + + /** Get sun position + @return Sun position + */ + inline const Ogre::Vector3& getSunPosition() const + { + return mSunPosition; + } + + /** Get normal distortion + @return Hydrax normal distortion + */ + inline const Ogre::Real& getNormalDistortion() const + { + return mNormalDistortion; + } + + /** Get water strength + @return Hydrax water strength + */ + inline const Ogre::Real& getSunStrength() const + { + return mSunStrength; + } + + /** Get sun area + @return Sun area + */ + inline const Ogre::Real& getSunArea() const + { + return mSunArea; + } + + /** Get sun color + @return Sun color + */ + inline const Ogre::Vector3& getSunColor() const + { + return mSunColor; + } + + /** Get foam max distance + @return Foam max distance + */ + inline const Ogre::Real& getFoamMaxDistance() const + { + return mFoamMaxDistance; + } + + /** Get foam scale + @return Foam scale + */ + inline const Ogre::Real& getFoamScale() const + { + return mFoamScale; + } + + /** Get foam start + @return Foam start + */ + inline const Ogre::Real& getFoamStart() const + { + return mFoamStart; + } + + /** Get foam transparency + @return Foam scale + */ + inline const Ogre::Real& getFoamTransparency() const + { + return mFoamTransparency; + } + + /** Get depth limit + @return Depth limit + */ + inline const Ogre::Real& getDepthLimit() const + { + return mDepthLimit; + } + + /** Get depth color + @return Depth color + */ + inline const Ogre::Vector3& getDepthColor() const + { + return mDepthColor; + } + + /** Get smooth power + @return Smooth power + */ + inline const Ogre::Real& getSmoothPower() const + { + return mSmoothPower; + } + + /** Get caustics scale + @return Caustics scale + */ + inline const Ogre::Real& getCausticsScale() const + { + return mCausticsScale; + } + + /** Get caustics power + @return Caustics power + */ + inline const Ogre::Real& getCausticsPower() const + { + return mCausticsPower; + } + + /** Get caustics end + @return Caustics end + */ + inline const Ogre::Real& getCausticsEnd() const + { + return mCausticsEnd; + } + + private: + + /** Restore water mesh after device listener restored event + */ + class DllExport DeviceRestoredListener : public Ogre::RenderSystem::Listener + { + public: + /// Hydrax manager pointer + Hydrax* mHydrax; + + /** Event occurred + @param eventName Name of the event + @param parameters Ogre::NameValuePairList pointer + */ + void eventOccurred(const Ogre::String& eventName, const Ogre::NameValuePairList *parameters); + }; + + /** Hydrax::CRefractionListener class + */ + class DllExport CRefractionListener : public Ogre::RenderTargetListener + { + public: + /// Hydrax manager pointer + Hydrax* mHydrax; + + /// Camera.y - Plane.y difference + Ogre::Real mCameraPlaneDiff; + + /** Funtion that is called before the Rtt will render + @param evt Ogre RenderTargetEvent + @remarks We've to override it + */ + void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + + /** Funtion that is called after the Rtt will render + @param evt Ogre RenderTargetEvent + @remarks We've to override it + */ + void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + }; + + /** Hydrax::CReflectionListener class + */ + class DllExport CReflectionListener : public Ogre::RenderTargetListener + { + public: + /** Hydrax::CReflectionListener::CReflectionQueueListener class + Used for avoid near clip plane clipping during the reflection Rtt + */ + class CReflectionQueueListener : public Ogre::RenderQueueListener + { + public: + /** Called at the start of the queue + */ + void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation) + { + if ((queueGroupId == Ogre::RENDER_QUEUE_SKIES_EARLY || queueGroupId == Ogre::RENDER_QUEUE_SKIES_LATE) + && mActive) + { + mHydrax->getCamera()->disableCustomNearClipPlane(); + Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mHydrax->getCamera()->getProjectionMatrixRS()); + } + } + + /** Called on the end of the queue + */ + void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation) + { + if ((queueGroupId == Ogre::RENDER_QUEUE_SKIES_EARLY || queueGroupId == Ogre::RENDER_QUEUE_SKIES_LATE) + && mActive) + { + mHydrax->getCamera()->enableCustomNearClipPlane(mHydrax->mReflectionPlane); + Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mHydrax->getCamera()->getProjectionMatrixRS()); + } + } + + /// Hydrax pointer + Hydrax* mHydrax; + /// Is the reflection Rtt active? + bool mActive; + }; + + /// CReflectionQueueListener + CReflectionQueueListener mCReflectionQueueListener; + + /// Hydrax manager pointer + Hydrax* mHydrax; + + /// Camera.y - Plane.y difference + Ogre::Real mCameraPlaneDiff; + + /** Funtion that is called before the Rtt will render + @param evt Ogre RenderTargetEvent + @remarks We've to override it + */ + void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + + /** Funtion that is called after the Rtt will render + @param evt Ogre RenderTargetEvent + @remarks We've to override it + */ + void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + }; + + /** Hydrax::CDepthListener class + */ + class DllExport CDepthListener : public Ogre::RenderTargetListener + { + public: + /// Hydrax manager pointer + Hydrax* mHydrax; + + /// std::string to store entity's original materials name + std::queue<std::string> mMaterials; + + /// Camera.y - Plane.y difference + Ogre::Real mCameraPlaneDiff; + + /** Funtion that is called before the Rtt will render + @param evt Ogre RenderTargetEvent + @remarks We've to override it + */ + void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + + /** Funtion that is called after the Rtt will render + @param evt Ogre RenderTargetEvent + @remarks We've to override it + */ + void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + }; + + /** Update normal map textures + */ + void _updateNM(); + + /** Create all rtt listeners + */ + void _createRttListeners(); + + /** Create/Delete depth rtt listener + @param Create Create depth rtt listener? + @param Delete Delete depth rtt listener? + @remarks Don't call with (Delete = true) if before we haven't call it with (Create = true) + */ + void _createDepthRttListener(const bool &Create = true, const bool &Delete = false); + + /// Has create() already called? + bool mCreated; + + /// Rtt options + RttOptions mRttOptions; + /// Hydrax components + HydraxComponent mComponents; + /// Current shader mode + MaterialManager::ShaderMode mShaderMode; + + /// Restored device listener + DeviceRestoredListener mDeviceRestoredListener; + + /// Polygon mode: 1-Solid, 2-Wireframe, 3-Points + int mPolygonMode; + /// Water position + Ogre::Vector3 mPosition; + /// Planes error, y axis clipplanes displacement + Ogre::Real mPlanesError; + + /// Full reflection distance param + Ogre::Real mFullReflectionDistance; + /// Global transparency param + Ogre::Real mGlobalTransparency; + /// Normal distortion param + Ogre::Real mNormalDistortion; + + /// Sun position + Ogre::Vector3 mSunPosition; + /// Sun strength param + Ogre::Real mSunStrength; + /// Sun area + Ogre::Real mSunArea; + /// Sun color + Ogre::Vector3 mSunColor; + + /// Foam max distance param + Ogre::Real mFoamMaxDistance; + /// Foam scale param + Ogre::Real mFoamScale; + /// Foam start param + Ogre::Real mFoamStart; + /// Foam transparency param + Ogre::Real mFoamTransparency; + + /// Depth limit param + Ogre::Real mDepthLimit; + /// Depth color param + Ogre::Vector3 mDepthColor; + + /// Smooth power param + Ogre::Real mSmoothPower; + + /// Caustics scale param + Ogre::Real mCausticsScale; + /// Caustics power + Ogre::Real mCausticsPower; + /// Caustics end + Ogre::Real mCausticsEnd; + + /// Our Hydrax::Mesh pointer + Mesh *mMesh; + /// Our Hydrax::MaterialManager + MaterialManager *mMaterialManager; + /// Our Hydrax::TextureManager pointer + TextureManager *mTextureManager; + /// Out Hydrax::DecalsManager pointer + DecalsManager *mDecalsManager; + /// Our Hydrax::Module::Module pointer + Module::Module *mModule; + + /// Refraction Plane pointer + Ogre::MovablePlane* mRefractionPlane; + /// Reflection Plane pointer + Ogre::MovablePlane* mReflectionPlane; + /// Depth Plane pointer + Ogre::MovablePlane* mDepthPlane; + + /// Refraction texture + Ogre::TexturePtr mTextureRefraction; + /// Reflection texture + Ogre::TexturePtr mTextureReflection; + /// Depth texture + Ogre::TexturePtr mTextureDepth; + + /// Refraction listener + CRefractionListener mRefractionListener; + /// Reflection listener + CReflectionListener mReflectionListener; + /// Depth listener + CDepthListener mDepthListener; + + /// SceneNode to attach our Hydrax::Mesh entity + Ogre::SceneNode *mSceneNode; + /// SceneNode to attach our planes + Ogre::SceneNode *mPlanesSceneNode; + + /// Pointer to Ogre::SceneManager + Ogre::SceneManager *mSceneManager; + /// Pointer to Ogre::Camera + Ogre::Camera *mCamera; + }; +} + +#endif Added: trunk/python-ogre/ThirdParty/Hydrax/Image.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Image.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Image.cpp 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,258 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#include "Image.h" + +namespace Hydrax +{ + Image::Image(const Size &Size) + : mSize(Hydrax::Size(Size.Width+1,Size.Height+1)) + , mChannels(static_cast<int>(TYPE_RGBA)) + , mData(0) + { + _Initialize(0); + } + + Image::Image(const Size &Size, const Type &Type) + : mSize(Hydrax::Size(Size.Width+1,Size.Height+1)) + , mChannels(static_cast<int>(Type)) + , mData(0) + { + _Initialize(0); + } + + Image::Image(const Size &Size, const Type &Type, const float &v) + : mSize(Hydrax::Size(Size.Width+1,Size.Height+1)) + , mChannels(static_cast<int>(Type)) + , mData(0) + { + _Initialize(v); + } + + Image::~Image() + { + delete mData; + } + + const float& Image::getValue(const int &x, const int &y, const int &c) const + { +#if HYDRAX_IMAGE_CHECK_PIXELS == 1 + if (c < 0 || c > mChannels || + x < 0 || x > mSize.Width || + y < 0 || y > mSize.Height) + { + HydraxLOG("Error in Image::getValue, x = " + Ogre::StringConverter::toString(x) + + " y = " + Ogre::StringConverter::toString(y) + + " Channel = " + Ogre::StringConverter::toString(c)); + + return 0; + } +#endif + + return mData[(y*mSize.Width+x)*mChannels+c]; + } + + float Image::getValueLI(const float &x, const float &y, const int &c) const + { +#if HYDRAX_IMAGE_CHECK_PIXELS == 1 + if (c < 0 || c > mChannels || + x < 0 || x > mSize.Width || + y < 0 || y > mSize.Height) + { + HydraxLOG("Error in Image::getValue, x = " + Ogre::StringConverter::toString(x) + + " y = " + Ogre::StringConverter::toString(y) + + " Channel = " + Ogre::StringConverter::toString(c)); + + return 0; + } +#endif + + int xINT = static_cast<int>(x), + yINT = static_cast<int>(y); + + float xDIFF = x-xINT, + yDIFF = y-yINT, + _xDIFF = 1-xDIFF, + _yDIFF = 1-yDIFF; + + // A B + // + // + // C D + float A = mData[(yINT*mSize.Width+xINT)*mChannels+c], + B = mData[(yINT*mSize.Width+xINT+1)*mChannels+c], + C = mData[((yINT+1)*mSize.Width+xINT)*mChannels+c], + D = mData[((yINT+1)*mSize.Width+xINT+1)*mChannels+c]; + + return A*_xDIFF*_yDIFF + + B* xDIFF*_yDIFF + + C*_xDIFF* yDIFF + + D* xDIFF* yDIFF; + } + + Image::Pixel Image::getPixel(const int &x, const int &y) const + { +#if HYDRAX_IMAGE_CHECK_PIXELS == 1 + if (x < 0 || x > mSize.Width || + y < 0 || y > mSize.Height) + { + HydraxLOG("Error in Image::getPixel, x = " + Ogre::StringConverter::toString(x) + + " y = " + Ogre::StringConverter::toString(y)); + + return Pixel(0); + } +#endif + + float v[4]; + + for(int k = 0; k < 4; k++) + { + if (mChannels >= k) + { + v[k] = getValue(x, y, k); + } + else + { + v[k] = 0; + } + } + + return Pixel(v[0], v[1], v[2], v[3]); + } + + Image::Pixel Image::getPixelLI(const float &x, const float &y) const + { +#if HYDRAX_IMAGE_CHECK_PIXELS == 1 + if (x < 0 || x > mSize.Width || + y < 0 || y > mSize.Height) + { + HydraxLOG("Error in Image::getPixel, x = " + Ogre::StringConverter::toString(x) + + " y = " + Ogre::StringConverter::toString(y)); + + return Pixel(0); + } +#endif + + float v[4]; + + for(int k = 0; k < 4; k++) + { + if (mChannels >= k) + { + v[k] = getValueLI(x, y, k); + } + else + { + v[k] = 0; + } + } + + return Pixel(v[0], v[1], v[2], v[3]); + } + + void Image::setValue(const int &x, const int &y, const int &c, const float &v) + { +#if HYDRAX_IMAGE_CHECK_PIXELS == 1 + if (c < 0 || c > mChannels || + x < 0 || x > mSize.Width || + y < 0 || y > mSize.Height) + { + HydraxLOG("Error in Image::setValue, x = " + Ogre::StringConverter::toString(x) + + " y = " + Ogre::StringConverter::toString(y) + + " Channel = " + Ogre::StringConverter::toString(c)); + + return; + } +#endif + + mData[(y*mSize.Width+x)*mChannels+c] = v; + } + + void Image::setPixel(const int &x, const int &y, const Pixel &p) + { +#if HYDRAX_IMAGE_CHECK_PIXELS == 1 + if (x < 0 || x > mSize.Width || + y < 0 || y > mSize.Height) + { + HydraxLOG("Error in Image::setPixel, x = " + Ogre::StringConverter::toString(x) + + " y = " + Ogre::StringConverter::toString(y)); + + return; + } +#endif + + switch(mChannels) + { + case 1: + { + setValue(x, y, 0, p.red); + } + break; + + case 2: + { + setValue(x, y, 0, p.red); + setValue(x, y, 1, p.green); + } + break; + + case 3: + { + setValue(x, y, 0, p.red); + setValue(x, y, 1, p.green); + setValue(x, y, 2, p.blue); + } + break; + + case 4: + { + setValue(x, y, 0, p.red); + setValue(x, y, 1, p.green); + setValue(x, y, 2, p.blue); + setValue(x, y, 3, p.alpha); + } + break; + } + } + + void Image::_Initialize(const float &v) + { + mData = new float[(mSize.Width) * + (mSize.Height) * + mChannels]; + + int x,y,c; + + for (x = 0; x < mSize.Width; x++) + { + for (y = 0; y < mSize.Height; y++) + { + for(c = 0; c < mChannels; c++) + { + mData[(y*mSize.Width+x)*mChannels+c] = v; + } + } + } + } +} Added: trunk/python-ogre/ThirdParty/Hydrax/Image.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Image.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/Image.h 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,268 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#ifndef _Hydrax_Image_H_ +#define _Hydrax_Image_H_ + +#include "Prerequisites.h" + +#include "Help.h" + +namespace Hydrax +{ + /** Class for store variable channels of an image + */ + class DllExport Image + { + public: + /** Image type enum + */ + enum Type + { + TYPE_ONE_CHANNEL = 1, + TYPE_TWO_CHANNELS = 2, + TYPE_RGB = 3, + /// Default + TYPE_RGBA = 4 + }; + + /** Channel enum + */ + enum Channel + { + CHANNEL_R = 0, // Red + CHANNEL_G = 1, // Green + CHANNEL_B = 2, // Blue + CHANNEL_A = 3 // Alpha + }; + + /** Pixel structure + */ + struct Pixel + { + /** Default constructor + */ + Pixel() + : red(0) + , green(0) + , blue(0) + , alpha(0) + { + } + + /** Constructor + @param v RGBA Value + */ + Pixel(const float &v) + : red(v) + , green(v) + , blue(v) + , alpha(v) + { + } + + /** Constructor + @param r Red value + @param g Green value + @param b Blue value + @remarks Alpha component = 0 + */ + Pixel(const float &r, + const float &g, + const float &b) + : red(r) + , green(g) + , blue(b) + , alpha(0) + { + } + + /** Constructor + @param r Red value + @param g Green value + @param b Blue value + @param a Alpha value + */ + Pixel(const float &r, + const float &g, + const float &b, + const float &a) + : red(r) + , green(g) + , blue(b) + , alpha(a) + { + } + + /// Pixel values (RGBA) + float red, + green, + blue, + alpha; + }; + + /** Constructor + @param Size Image size + */ + Image(const Size &Size); + + /** Constructor + @param Size Image size + @param Type Image type + */ + Image(const Size &Size, const Type &Type); + + /** Constructor + @param Size Image size + @param Type Image type + @param v Initial channel values + */ + Image(const Size &Size, const Type &Type, const float &v); + + /** Destructor + */ + ~Image(); + + /** Get a pixel value + @param x X value + @param y Y value + @param c Channel + @return Pixel channel value + */ + const float& getValue(const int &x, const int &y, const int &c) const; + + /** Get a pixel value with linear interpolation, + like x = 4.56, y = 8.34 + @param x X value + @param y Y value + @param c Channel + @return Pixel channel value + */ + float getValueLI(const float &x, const float &y, const int &c) const; + + /** Get a pixel value + @param x X value + @param y Y value + @param c Channel + @return Pixel channel value + */ + inline const float& getValue(const int &x, const int &y, const Channel &c) const + { + return getValue(x, y, static_cast<int>(c)); + } + + /** Get a pixel value with linear interpolation, + like x = 4.56, y = 8.34 + @param x X value + @param y Y value + @param c Channel + @return Pixel channel value + */ + inline float getValueLI(const float &x, const float &y, const Channel &c) const + { + return getValueLI(x, y, static_cast<int>(c)); + } + + /** Get a pixel + @param x X value + @param y Y value + @return Pixel + */ + Pixel getPixel(const int &x, const int &y) const; + + /** Get a pixel with linear interpolation, + like x = 4.56, y = 8.34 + @param x X value + @param y Y value + @return Pixel + */ + Pixel getPixelLI(const float &x, const float &y) const; + + /** Set a pixel value + @param x X value + @param y Y value + @param c Channel + @param v Value + */ + void setValue(const int &x, const int &y, const int &c, const float &v); + + /** Set a pixel value + @param x X value + @param y Y value + @param c Channel + @param v Value + */ + inline void setValue(const int &x, const int &y, const Channel &c, const float &v) + { + setValue(x, y, static_cast<int>(c), v); + } + + /** Set a pixel + @param x X value + @param y Y value + @param p Pixel + */ + void setPixel(const int &x, const int &y, const Pixel &p); + + /** Get image size + @return Image size + */ + inline Size getSize() const + { + return Size(mSize.Width-1,mSize.Height-1); + } + + /** Get image type + @return Image type + */ + inline Type getType() const + { + return static_cast<Type>(mChannels); + } + + /** Get number of channels + @return Number of channels + */ + inline const int& getNumberOfChannels() const + { + return mChannels; + } + + private: + /** Initialize array (Reserve dynamic memory) + @param v Initial values + */ + void _Initialize(const float &v); + + /// Image size + Size mSize; + /// Number of channels + int mChannels; + + /// Our image data + float *mData; + }; +} + +#endif \ No newline at end of file Added: trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.cpp 2008-08-15 08:08:10 UTC (rev 688) @@ -0,0 +1,1072 @@ +/* +-------------------------------------------------------------------------------- +This source file is part of Hydrax. +Visit --- + +Copyright (C) 2008 Xavier Vergu\xEDn Gonz\xE1lez <xavierverguin@...> + <xavyiy@...> + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA, or go to +http://www.gnu.org/copyleft/lesser.txt. +-------------------------------------------------------------------------------- +*/ + +#include "MaterialManager.h" + +#include "Hydrax.h" + +#define _def_Water_Material_Name "_Hydrax_Water_Material" +#define _def_Water_Shader_VP_Name "_Hydrax_Water_VP" +#define _def_Water_Shader_FP_Name "_Hydrax_Water_FP" + +#define _def_Depth_Material_Name "_Hydrax_Depth_Material" @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-17 12:57:19
|
Revision: 690 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=690&view=rev Author: andy_miller Date: 2008-08-17 12:57:28 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Hydra Demo added (hydrax 0.3) and working Modified Paths: -------------- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h trunk/python-ogre/code_generators/hydrax/customization_data.py trunk/python-ogre/code_generators/hydrax/generate_code.py trunk/python-ogre/code_generators/hydrax/python_hydrax.h trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py Modified: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp 2008-08-17 12:57:28 UTC (rev 690) @@ -178,8 +178,6 @@ Ogre::String MaterialNameTmp = mHydrax->mMesh->getMaterialName(); Mesh::Options MeshOptionsTmp = mHydrax->mMesh->getOptions(); - HydraxLOG("Updating water mesh."); - HydraxLOG("Deleting water mesh."); delete mHydrax->mMesh; HydraxLOG("Water mesh deleted."); @@ -200,6 +198,7 @@ void Hydrax::_createRttListeners() { if (!mCreated) + { mRefractionPlane = new Ogre::MovablePlane("RefractionPlane"); mReflectionPlane = new Ogre::MovablePlane("ReflectionPlane"); @@ -554,6 +553,7 @@ void Hydrax::update(const Ogre::Real &timeSinceLastFrame) { + if (mCreated && mModule) { mModule->update(timeSinceLastFrame); Modified: trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h 2008-08-17 12:57:28 UTC (rev 690) @@ -537,7 +537,7 @@ public: /** Called at the start of the queue */ - void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation) + bool renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool skipThisInvocation) { if ((queueGroupId == Ogre::RENDER_QUEUE_SKIES_EARLY || queueGroupId == Ogre::RENDER_QUEUE_SKIES_LATE) && mActive) @@ -545,11 +545,12 @@ mHydrax->getCamera()->disableCustomNearClipPlane(); Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mHydrax->getCamera()->getProjectionMatrixRS()); } + return skipThisInvocation; } /** Called on the end of the queue */ - void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation) + bool renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool skipThisInvocation) { if ((queueGroupId == Ogre::RENDER_QUEUE_SKIES_EARLY || queueGroupId == Ogre::RENDER_QUEUE_SKIES_LATE) && mActive) @@ -557,6 +558,7 @@ mHydrax->getCamera()->enableCustomNearClipPlane(mHydrax->mReflectionPlane); Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mHydrax->getCamera()->getProjectionMatrixRS()); } + return skipThisInvocation; } /// Hydrax pointer @@ -731,6 +733,6 @@ /// Pointer to Ogre::Camera Ogre::Camera *mCamera; }; -} +}; #endif Modified: trunk/python-ogre/code_generators/hydrax/customization_data.py =================================================================== --- trunk/python-ogre/code_generators/hydrax/customization_data.py 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/code_generators/hydrax/customization_data.py 2008-08-17 12:57:28 UTC (rev 690) @@ -1,6 +1,10 @@ def header_files( version ): - return [ 'Hydrax.h'] + return [ 'Hydrax.h', + "ProjectedGrid.h", + "SimpleGrid.h", + "Perlin.h" + ] def huge_classes( version ): return [] Modified: trunk/python-ogre/code_generators/hydrax/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/hydrax/generate_code.py 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/code_generators/hydrax/generate_code.py 2008-08-17 12:57:28 UTC (rev 690) @@ -226,7 +226,8 @@ global_ns.exclude() main_ns = global_ns.namespace( MAIN_NAMESPACE ) main_ns.include() - + + common_utils.AutoExclude ( mb, MAIN_NAMESPACE ) ManualExclude ( mb ) common_utils.AutoInclude ( mb, MAIN_NAMESPACE ) Modified: trunk/python-ogre/code_generators/hydrax/python_hydrax.h =================================================================== --- trunk/python-ogre/code_generators/hydrax/python_hydrax.h 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/code_generators/hydrax/python_hydrax.h 2008-08-17 12:57:28 UTC (rev 690) @@ -1,5 +1,8 @@ #include "Hydrax.h" +#include "ProjectedGrid.h" +#include "SimpleGrid.h" +#include "Perlin.h" // First we create a magic namespace to hold all our aliases namespace pyplusplus { namespace aliases { Added: trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py =================================================================== --- trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py (rev 0) +++ trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py 2008-08-17 12:57:28 UTC (rev 690) @@ -0,0 +1,208 @@ +# This code is in the Public Domain +# ----------------------------------------------------------------------------- +# This source file is part of Python-ogre +# For the latest info, see http:#python-ogre.org/ +# +# It is likely based on original code from OGRE and/or Pyogre +# For the latest info, see http:#www.ogre3d.org/ +# +# You may use this sample code for anything you like, it is not covered by the +# LGPL. +# ----------------------------------------------------------------------------- +import sys +sys.path.insert(0,'..') +import PythonOgreConfig +import ogre.renderer.OGRE as ogre +import SampleFramework as sf + +import ogre.addons.hydrax as Hydrax + +_def_SkyBoxNum = 5 +_def_PGComplexity = 256 + +mSkyBoxes = [ "Sky/ClubTropicana", + "Sky/Stormy", + "Sky/EarlyMorning", + "Sky/Evening", + "Sky/Clouds"] + +mSunPosition = [ogre.Vector3(0,10000,-90000), + ogre.Vector3(0,10000,-90000)/2.5, + ogre.Vector3(13000,0,120000)/3, + ogre.Vector3(-50000,-5000,50000), + ogre.Vector3(0,0,0)] + +mSunColor = [ogre.Vector3(1, 0.9, 0.6)/5, + ogre.Vector3(0.75, 0.65, 0.45)/2, + ogre.Vector3(1,0.6,0.4), + ogre.Vector3(1,0.4,0.1), + ogre.Vector3(0,0,0)] + +# print dir (Hydrax) +# print dir( Hydrax.Module) +# print dir ( Hydrax.Noise) +mPGOptions = [Hydrax.ProjectedGrid.Options(_def_PGComplexity), + Hydrax.ProjectedGrid.Options(_def_PGComplexity, 45.5, 7.0, False), + Hydrax.ProjectedGrid.Options(_def_PGComplexity, 32.5, 7.0, False), + Hydrax.ProjectedGrid.Options(_def_PGComplexity, 32.5, 7.0, False), + Hydrax.ProjectedGrid.Options(_def_PGComplexity, 20.0, 7.0, False)] + +mPerlinOptions = [ Hydrax.Perlin.Options(8, 0.085, 0.49, 1.4, 1.27), + Hydrax.Perlin.Options(8, 0.085, 0.49, 1.4, 1.27), + Hydrax.Perlin.Options(8, 0.085, 0.49, 1.4, 1.27), + Hydrax.Perlin.Options(8, 0.075, 0.49, 1.4, 1.27), + Hydrax.Perlin.Options(8, 0.085, 0.49, 1.4, 1.27)] + +mCurrentSkyBox = 0 + +## Event handler to add ability to alter subdivision +class HydraxListener(sf.FrameListener): + def __init__(self, rw, cam, sm , app): + sf.FrameListener.__init__(self, rw, cam) + self.sceneManager=sm + self.renderWindow =rw + self.camera=cam + self.app = app + self.mKeyBuffer=-1 + + def frameStarted(self, e): + if sf.FrameListener.frameStarted(self, e) == False: + return False + self.app.hydrax.update(e.timeSinceLastFrame) +# +# mKeyboard->capture() +# +# if (mKeyboard->isKeyDown(OIS::KC_M) && mKeyBuffer < 0) +# { +# mCurrentSkyBox++ +# +# if(mCurrentSkyBox > (_def_SkyBoxNum-1)) +# { +# mCurrentSkyBox = 0 +# } +# +# changeSkyBox() +# +# mKeyBuffer = 0.5f +# } +# +# mKeyBuffer -= e.timeSinceLastFrame +# + return True + + def changeSkyBox( self ): + # Change skybox + self.sceneManager.setSkyBox(true, mSkyBoxes[mCurrentSkyBox], 99999*3, true) + + # Update Hydrax sun position and colour + app.hydrax.setSunPosition(mSunPosition[mCurrentSkyBox]) + app.hydrax.setSunColor(mSunColor[mCurrentSkyBox]) + + # Update light 0 light position and colour + self.sceneManager.getLight("Light0").setPosition(mSunPosition[mCurrentSkyBox]) + self.sceneManager.getLight("Light0").setSpecularColour(mSunColor[mCurrentSkyBox].x,mSunColor[mCurrentSkyBox].y,mSunColor[mCurrentSkyBox].z) + + # Update perlin noise options + app.hydrax.getModule().getNoise().setOptions(mPerlinOptions[mCurrentSkyBox]) + + # Update projected grid options + app.hydrax.getModule().setOptions(mPGOptions[mCurrentSkyBox]) + +# ogre.LogManager.getSingleton().logMessage("Skybox " + mSkyBoxes[mCurrentSkyBox] + " selected. ("+Ogre::StringConverter::toString(mCurrentSkyBox+1)+"/"+Ogre::StringConverter::toString(_def_SkyBoxNum)+")") + + + +class HydraxApplication(sf.Application): + + def _createScene(self): + sceneManager = self.sceneManager + camera = self.camera + + # Create the SkyBox + sceneManager.setSkyBox(True, mSkyBoxes[mCurrentSkyBox], 99999*3, True) + + # Set some camera params + camera.setFarClipDistance(99999*6) + camera.setPosition(4897.61,76.8614,4709.9) + camera.setOrientation(ogre.Quaternion(0.487431, -0.0391184, 0.869485, 0.0697797)) + + # Create Hydrax object + self.hydrax = Hydrax.Hydrax(sceneManager, camera) + + # Set RTT textures quality + self.hydrax.setRttOptions( + Hydrax.RttOptions(# Reflection tex quality + Hydrax.TEX_QUA_1024, + # Refraction tex quality + Hydrax.TEX_QUA_1024, + # Depth tex quality + Hydrax.TEX_QUA_1024)) + + # Set components + self.hydrax.setComponents( Hydrax.HydraxComponent( Hydrax.HYDRAX_COMPONENT_SUN | + Hydrax.HYDRAX_COMPONENT_FOAM | + Hydrax.HYDRAX_COMPONENT_DEPTH | + Hydrax.HYDRAX_COMPONENT_SMOOTH | + Hydrax.HYDRAX_COMPONENT_CAUSTICS )) + + # Create our projected grid module + self.noise= Hydrax.Perlin() ## Default options (8, 0.085, 0.49, 1.4, 1.27f) + self.Module = Hydrax.ProjectedGrid(# Hydrax parent pointer + self.hydrax, + # Noise module + self.noise, + # Base plane + ogre.Plane(ogre.Vector3(0,1,0), ogre.Vector3(0,0,0)), + # Projected grid options (Can be updated each frame . setOptions(...)) + Hydrax.ProjectedGrid.Options(_def_PGComplexity )) + + # Set our module + self.hydrax.setModule(self.Module) + + # Set our shader mode + self.hydrax.setShaderMode(Hydrax.MaterialManager.SM_HLSL) + + # Create water + self.hydrax.create() + + # Adjust some options + self.hydrax.setPosition(ogre.Vector3(0,0,0)) + self.hydrax.setPlanesError(37.5) + self.hydrax.setDepthLimit(110) + self.hydrax.setSunPosition(mSunPosition[mCurrentSkyBox]) + self.hydrax.setSunColor(mSunColor[mCurrentSkyBox]) + self.hydrax.setNormalDistortion(0.025) + self.hydrax.setDepthColor(ogre.Vector3(0.04,0.135,0.185)) + self.hydrax.setSmoothPower(5) + self.hydrax.setCausticsScale(12) + self.hydrax.setGlobalTransparency(0.1) + self.hydrax.setFullReflectionDistance(99999997952.0) + self.hydrax.setGlobalTransparency(0) + self.hydrax.setPolygonMode(0) + + # Lights + sceneManager.setAmbientLight(ogre.ColourValue(1, 1, 1)) + Light = sceneManager.createLight("Light0") + Light.setPosition(mSunPosition[mCurrentSkyBox]) + Light.setDiffuseColour(1, 1, 1) + Light.setSpecularColour(mSunColor[mCurrentSkyBox].x,mSunColor[mCurrentSkyBox].y,mSunColor[mCurrentSkyBox].z) + + # Island + IslandEntity = sceneManager.createEntity("Island", "Island.mesh") + IslandEntity.setMaterialName("Examples/OffsetMapping/Specular") + IslandSceneNode = sceneManager.getRootSceneNode().createChildSceneNode(ogre.Vector3(5000, -175, 5000)) + IslandSceneNode.setScale(23, 13.5, 23) + IslandSceneNode.attachObject(IslandEntity) + + def _createFrameListener(self): + self.frameListener = HydraxListener(self.renderWindow, self.camera, self.sceneManager, self) + self.root.addFrameListener(self.frameListener) + self.frameListener.showDebugOverlay( True ) + + +if __name__ == '__main__': + try: + application = HydraxApplication() + application.go() + except ogre.OgreException, e: + print e Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/demos/plugins.cfg 2008-08-17 12:57:28 UTC (rev 690) @@ -10,8 +10,8 @@ Plugin=Plugin_BSPSceneManager.dll Plugin=Plugin_OctreeSceneManager.dll Plugin=Plugin_CgProgramManager.dll -Plugin=Plugin_PCZSceneManager.dll -Plugin=Plugin_OctreeZone.dll +#Plugin=Plugin_PCZSceneManager.dll +#Plugin=Plugin_OctreeZone.dll #Plugin=Plugin_OctreeSceneManager.dll Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-15 10:44:11 UTC (rev 689) +++ trunk/python-ogre/environment.py 2008-08-17 12:57:28 UTC (rev 690) @@ -1628,7 +1628,7 @@ class hydrax: active = True pythonModule = True - version="0.1" + version="0.3" name='hydrax' parent="ogre/addons" cflags = "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-18 08:33:02
|
Revision: 695 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=695&view=rev Author: andy_miller Date: 2008-08-18 08:33:08 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Cleaned up some older files Added Particle universe patch Small updates to NxOgre demos -- more is required Modified Paths: -------------- trunk/python-ogre/demos/nxogre/CakeFramework.py trunk/python-ogre/demos/nxogre/Demo_101.py trunk/python-ogre/demos/nxogre/Lesson701.py trunk/python-ogre/demos/nxogre/resources.cfg Added Paths: ----------- trunk/python-ogre/demos/nxogre/media_old/ trunk/python-ogre/demos/nxogre/media_old/ComplexMeshes/ trunk/python-ogre/demos/nxogre/media_old/Env/ trunk/python-ogre/demos/nxogre/media_old/Essential/ trunk/python-ogre/demos/nxogre/media_old/SimpleMeshes/ trunk/python-ogre/demos/nxogre/media_old/resources.cfg trunk/python-ogre/patch/ParticleUniverse_0.8.patch Removed Paths: ------------- trunk/python-ogre/demos/nxogre/media/ trunk/python-ogre/demos/nxogre/media_old/ComplexMeshes/ trunk/python-ogre/demos/nxogre/media_old/Env/ trunk/python-ogre/demos/nxogre/media_old/Essential/ trunk/python-ogre/demos/nxogre/media_old/SimpleMeshes/ trunk/python-ogre/demos/nxogre/media_old/resources.cfg trunk/python-ogre/demos/ogre/plugins.cfg trunk/python-ogre/patch/ogre_svn.patch trunk/python-ogre/scripts_V2/ trunk/python-ogre/setup_dist.py Modified: trunk/python-ogre/demos/nxogre/CakeFramework.py =================================================================== --- trunk/python-ogre/demos/nxogre/CakeFramework.py 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/demos/nxogre/CakeFramework.py 2008-08-18 08:33:08 UTC (rev 695) @@ -21,7 +21,7 @@ import ogre.gui.betagui as BetaGUI import ogre.io.OIS as OIS import ogre.physics.PhysX as PhysX -import ogre.physics.NxOgre_09 as nxogre +import ogre.physics.NxOgre as nxogre from Enums import * @@ -489,11 +489,11 @@ ##/ Grid ##self.SceneMgr.getRootSceneNode().attachObject(self.SceneMgr.createEntity("nx.floor","nx.floor.mesh")) - self.StaticGeom= self.SceneMgr.createStaticGeometry("Grid") - self.StaticGeom.addEntity(self.SceneMgr.createEntity("nx.floor", "nx.floor.mesh"), ogre.Vector3(0,-0.05,0)) - self.StaticGeom.addEntity(self.SceneMgr.createEntity("nx.axis", "nx.body.axis.mesh"), ogre.Vector3(0,0.01,0)) - self.StaticGeom.build() - self.StaticGeom.setCastShadows(False) +# self.StaticGeom= self.SceneMgr.createStaticGeometry("Grid") +# self.StaticGeom.addEntity(self.SceneMgr.createEntity("nx.floor", "nx.floor.mesh"), ogre.Vector3(0,-0.05,0)) +# self.StaticGeom.addEntity(self.SceneMgr.createEntity("nx.axis", "nx.body.axis.mesh"), ogre.Vector3(0,0.01,0)) +# self.StaticGeom.build() +# self.StaticGeom.setCastShadows(False) ## Light mSunLight = self.SceneMgr.createLight("SunLight") Modified: trunk/python-ogre/demos/nxogre/Demo_101.py =================================================================== --- trunk/python-ogre/demos/nxogre/Demo_101.py 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/demos/nxogre/Demo_101.py 2008-08-18 08:33:08 UTC (rev 695) @@ -7,7 +7,7 @@ import ogre.renderer.OGRE as ogre import ogre.physics.PhysX as physx -import ogre.physics.NxOgre_09 as nxogre +import ogre.physics.NxOgre as nxogre import CakeFramework as cf class NxTutorial ( cf.Cake ): @@ -17,9 +17,10 @@ ##//////////////////////////////////////////////////////////////////////////////////////////////// def start(self ): - self.World = nxogre.World("Log: html") + self.World = nxogre.World(nxogre.PhysXParams("Log: html")) - self.Scene = self.World.createScene("Main", self.SceneMgr,"gravity: yes, floor: yes") + self.Scene = self.World.createScene("Main", nxogre.SceneParams("renderer: ogre, controller: accumulator, gravity: yes, floor: yes")) + ### self.SceneMgr,"gravity: yes, floor: yes") self.Scene.createBody('sphere.50cm.mesh',nxogre.SphereShape(0.5), ogre.Vector3(3,1.5,0), "mass: 10" ) @@ -71,4 +72,3 @@ except ogre.OgreException, e: print e - Modified: trunk/python-ogre/demos/nxogre/Lesson701.py =================================================================== --- trunk/python-ogre/demos/nxogre/Lesson701.py 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/demos/nxogre/Lesson701.py 2008-08-18 08:33:08 UTC (rev 695) @@ -1,8 +1,8 @@ ## =============================================================================== -## AGEIA PHYSX SDK TRAINING PROGRAMS -## LESSON 701: WHEEL SHAPES +## AGEIA PHYSX SDK TRAINING PROGRAMS +## LESSON 701: WHEEL SHAPES ## -## Written by Bob Schade, 5-1-06 +## Written by Bob Schade, 5-1-06 ## =============================================================================== @@ -60,29 +60,13 @@ ##//////////////////////////////////////////////////////////////////////////////////////////////// -if __name__ == '__main__': - import exceptions,sys - try: - application = NxTutorial () - application.pre() - application.start() - application.WorldInstance = application.getWorld() - application.startRendering(application) - application.stop() - application.post() +def PrintControls(): - except ogre.OgreException, e: - print e + print("\n Flight Controls:\n ----------------\n w = forward, s = back\n a = strafe left, d = strafe right\n q = up, z = down\n") + print("\n Force Controls:\n ---------------\n i = +z, k = -z\n j = +x, l = -x\n u = +y, m = -y\n") + print("\n Miscellaneous:\n --------------\n p = Pause\n r = Select Next Actor\n f = Toggle Force Mode\n b = Toggle Debug Wireframe Mode\n x = Toggle Shadows\n t = Move Focus Actor to (0,5,0)\n") - -# # # def PrintControls(): -# # # -# # # print("\n Flight Controls:\n ----------------\n w = forward, s = back\n a = strafe left, d = strafe right\n q = up, z = down\n") -# # # print("\n Force Controls:\n ---------------\n i = +z, k = -z\n j = +x, l = -x\n u = +y, m = -y\n") -# # # print("\n Miscellaneous:\n --------------\n p = Pause\n r = Select Next Actor\n f = Toggle Force Mode\n b = Toggle Debug Wireframe Mode\n x = Toggle Shadows\n t = Move Focus Actor to (0,5,0)\n") -# # # -# # # # # # def RenderActors(bool shadows) # # # # # # ## Render all the actors in the scene @@ -91,12 +75,12 @@ # # # while (nbActors--) # # # # # # NxActor* actor = *actors++ -# # # DrawActor(actor, self.SelectedActor, False) +# # # DrawActor(actor, self.SelectedActor, False) # # # # # # ## Handle shadows # # # if (shadows): # # # -# # # DrawActorShadow(actor, False) +# # # DrawActorShadow(actor, False) # # # @@ -107,226 +91,229 @@ actors = self.Scene.getActors() while nbActors > 0: nbActors -= 1 - nbShapes = actors[nbActors].getNbShapes() - shapes = actors[nbActors].getShapes() - while nbShapes > 0: - nbShapes -= 1 + nbShapes = actors[nbActors].getNbShapes() + shapes = actors[nbActors].getShapes() + while nbShapes > 0: + nbShapes -= 1 - shape = shapes[nbShapes] - if (shape.getType() == nxogre.NX_SHAPE_WHEEL): + shape = shapes[nbShapes] + if (shape.getType() == nxogre.NX_SHAPE_WHEEL): -# NxWheelShape* ws = (NxWheelShape*)shape -# ShapeUserData* sud = (ShapeUserData*)(shape.userData) - ws = shape - sud = shape.userData - if sud: - ## Need to save away roll angle in wheel shape user data - rollAngle = sud.wheelShapeRollAngle -## rollAngle += ws.getAxleSpeed() * 1.0/60.0f - rollAngle += ws.getAxleSpeed() * gDeltaTime - while (rollAngle > nxogre.NxTwoPi) ##normally just 1x - rollAngle -= nxogre.NxTwoPi - while (rollAngle < -nxogre.NxTwoPi) ##normally just 1x - rollAngle += nxogre.NxTwoPi +# NxWheelShape* ws = (NxWheelShape*)shape +# ShapeUserData* sud = (ShapeUserData*)(shape.userData) + ws = shape + sud = shape.userData + if sud: + ## Need to save away roll angle in wheel shape user data + rollAngle = sud.wheelShapeRollAngle +## rollAngle += ws.getAxleSpeed() * 1.0/60.0f + rollAngle += ws.getAxleSpeed() * gDeltaTime + while (rollAngle > nxogre.NxTwoPi): ##normally just 1x + rollAngle -= nxogre.NxTwoPi + while (rollAngle < -nxogre.NxTwoPi): ##normally just 1x + rollAngle += nxogre.NxTwoPi - ## We have the roll angle for the wheel now - sud.wheelShapeRollAngle = rollAngle + ## We have the roll angle for the wheel now + sud.wheelShapeRollAngle = rollAngle - pose = ws.getGlobalPose() + pose = ws.getGlobalPose() - wcd = nxogre.NxWheelContactData () - s = ws.getContact(wcd) + wcd = nxogre.NxWheelContactData () + s = ws.getContact(wcd) - r = ws.getRadius() - st = ws.getSuspensionTravel() - steerAngle = ws.getSteerAngle() + r = ws.getRadius() + st = ws.getSuspensionTravel() + steerAngle = ws.getSteerAngle() -## NxWheelShapeDesc state -## ws.saveToDesc(state) +## NxWheelShapeDesc state +## ws.saveToDesc(state) - dir_ = NxVec3 () -# # /* -# # getWorldSegmentFast(seg) -# # seg.computeDirection(dir) -# # dir.normalize() -# # */ - p0 = pose.t ##cast from shape origin - pose.M.getColumn(1, dir_) - dir_ = -dir_ ##cast along -Y. - castLength = r + st ##cast ray self long + dir_ = NxVec3 () +# # /* +# # getWorldSegmentFast(seg) +# # seg.computeDirection(dir) +# # dir.normalize() +# # */ + p0 = pose.t ##cast from shape origin + pose.M.getColumn(1, dir_) + dir_ = -dir_ ##cast along -Y. + castLength = r + st ##cast ray self long -## renderer.addArrow(p0, dir, castLength, 1.0) - - ##have ground contact? - ## This code is from WheelShape.cpp in SDKs/core/common/src - ## if (contactPosition != nxogre.NX_MAX_REAL) : - if s and (wcd.contactForce > -1000) : +## renderer.addArrow(p0, dir, castLength, 1.0) + + ##have ground contact? + ## This code is from WheelShape.cpp in SDKs/core/common/src + ## if (contactPosition != nxogre.NX_MAX_REAL) : + if s and (wcd.contactForce > -1000) : -## pose.t = p0 + dir * wcd.contactPoint -## pose.t -= dir * state.radius //go from contact pos to center pos. - pose.t = wcd.contactPoint - pose.t -= dir_ * r ##go from contact pos to center pos. +## pose.t = p0 + dir * wcd.contactPoint +## pose.t -= dir * state.radius //go from contact pos to center pos. + pose.t = wcd.contactPoint + pose.t -= dir_ * r ##go from contact pos to center pos. - rot = nxogre.NxMat33() - axisRot = nxogre.NxMat33 () - rot.rotY(steerAngle) - axisRot.rotY(0) + rot = nxogre.NxMat33() + axisRot = nxogre.NxMat33 () + rot.rotY(steerAngle) + axisRot.rotY(0) -## NxReal rollAngle = ((ShapeUserData*)(wheel.userData)).rollAngle +## NxReal rollAngle = ((ShapeUserData*)(wheel.userData)).rollAngle - rollRot = nxogre.NxMat33 () - rollRot.rotX(rollAngle) + rollRot = nxogre.NxMat33 () + rollRot.rotX(rollAngle) - pose.M = rot * pose.M * axisRot * rollRot + pose.M = rot * pose.M * axisRot * rollRot - sud.wheelShapePose = pose + sud.wheelShapePose = pose - else: + else: - pose.t = p0 + dir * st - sud.wheelShapePose = pose + pose.t = p0 + dir * st + sud.wheelShapePose = pose def AddWheelToActor(self, actor, wheelDesc): - wheelShapeDesc = nxogre.NxWheelShapeDesc () + wheelShapeDesc = nxogre.NxWheelShapeDesc () - ## Create a shared car wheel material to be used by all wheels - if (!self.wsm): + ## Create a shared car wheel material to be used by all wheels + if not self.wsm: - m = nxogre.NxMaterialDesc () - m.flags |= nxogre.NX_MF_DISABLE_FRICTION - self.wsm = self.Scene.createMaterial(m) + m = nxogre.NxMaterialDesc () + m.flags |= nxogre.NX_MF_DISABLE_FRICTION + self.wsm = self.Scene.createMaterial(m) - wheelShapeDesc.materialIndex = self.wsm.getMaterialIndex() + wheelShapeDesc.materialIndex = self.wsm.getMaterialIndex() - wheelShapeDesc.localPose.t = wheelDesc.position - q = nxogre.NxQuat () - q.fromAngleAxis(90, nxogre.NxVec3(0,1,0)) - wheelShapeDesc.localPose.M.fromQuat(q) + wheelShapeDesc.localPose.t = wheelDesc.position + q = nxogre.NxQuat () + q.fromAngleAxis(90, nxogre.NxVec3(0,1,0)) + wheelShapeDesc.localPose.M.fromQuat(q) - heightModifier = (wheelDesc.wheelSuspension + wheelDesc.wheelRadius) / wheelDesc.wheelSuspension + heightModifier = (wheelDesc.wheelSuspension + wheelDesc.wheelRadius) / wheelDesc.wheelSuspension - wheelShapeDesc.suspension.spring = wheelDesc.springRestitution*heightModifier - wheelShapeDesc.suspension.damper = 0 ##wheelDesc.springDamping*heightModifier; - wheelShapeDesc.suspension.targetValue = wheelDesc.springBias*heightModifier + wheelShapeDesc.suspension.spring = wheelDesc.springRestitution*heightModifier + wheelShapeDesc.suspension.damper = 0 ##wheelDesc.springDamping*heightModifier; + wheelShapeDesc.suspension.targetValue = wheelDesc.springBias*heightModifier - wheelShapeDesc.radius = wheelDesc.wheelRadius - wheelShapeDesc.suspensionTravel = wheelDesc.wheelSuspension - wheelShapeDesc.inverseWheelMass = 0.1 ##not given!? TODO + wheelShapeDesc.radius = wheelDesc.wheelRadius + wheelShapeDesc.suspensionTravel = wheelDesc.wheelSuspension + wheelShapeDesc.inverseWheelMass = 0.1 ##not given!? TODO - ## wheelShapeDesc.lateralTireForceFunction = //TODO - ## wheelShapeDesc.longitudalTireForceFunction = //TODO + ## wheelShapeDesc.lateralTireForceFunction = //TODO + ## wheelShapeDesc.longitudalTireForceFunction = //TODO # # NxWheelShape* wheelShape -# # wheelShape = static_cast<NxWheelShape *>(actor.createShape(wheelShapeDesc)) +# # wheelShape = static_cast<NxWheelShape *>(actor.createShape(wheelShapeDesc)) def CreateCab( self, pos): """ create the cab from a box """ - actor = self.CreateBox(pos + nxogre.NxVec3(0,1,0), nxogre.NxVec3(1,0.5,0.5), 10) - actor.raiseBodyFlag(nxogre.NX_BF_FROZEN_ROT_X) - actor.raiseBodyFlag(nxogre.NX_BF_FROZEN_ROT_Z) - actor.setAngularDamping(0.5) + actor = self.CreateBox(pos + nxogre.NxVec3(0,1,0), nxogre.NxVec3(1,0.5,0.5), 10) + actor.raiseBodyFlag(nxogre.NX_BF_FROZEN_ROT_X) + actor.raiseBodyFlag(nxogre.NX_BF_FROZEN_ROT_Z) + actor.setAngularDamping(0.5) - wheelDesc =nxogre.NxWheelDesc - ##wheelDesc.wheelAxis.set(0,0,1) - ##wheelDesc.downAxis.set(0,-1,0) + wheelDesc =nxogre.NxWheelDesc + ##wheelDesc.wheelAxis.set(0,0,1) + ##wheelDesc.downAxis.set(0,-1,0) wheelDesc.wheelApproximation = 10 - wheelDesc.wheelRadius = 0.5 - wheelDesc.wheelWidth = 0.1 - wheelDesc.wheelSuspension = 0.2 - wheelDesc.springRestitution = 7000 - wheelDesc.springDamping = 800 - wheelDesc.springBias = 0 - wheelDesc.maxBrakeForce = 1 - wheelDesc.frictionToFront = 0.1 - wheelDesc.frictionToSide = 0.99 - wheelDesc.position = nxogre.NxVec3(0,-0.4,0) - wheelDesc.wheelFlags = nxogre.NX_WF_USE_WHEELSHAPE | nxogre.NX_WF_BUILD_LOWER_HALF | nxogre.NX_WF_ACCELERATED | - nxogre.NX_WF_AFFECTED_BY_HANDBRAKE | nxogre.NX_WF_STEERABLE_INPUT | nxogre.NX_WF_BUILD_LOWER_HALF + wheelDesc.wheelRadius = 0.5 + wheelDesc.wheelWidth = 0.1 + wheelDesc.wheelSuspension = 0.2 + wheelDesc.springRestitution = 7000 + wheelDesc.springDamping = 800 + wheelDesc.springBias = 0 + wheelDesc.maxBrakeForce = 1 + wheelDesc.frictionToFront = 0.1 + wheelDesc.frictionToSide = 0.99 + wheelDesc.position = nxogre.NxVec3(0,-0.4,0) + wheelDesc.wheelFlags = nxogre.NX_WF_USE_WHEELSHAPE | nxogre.NX_WF_BUILD_LOWER_HALF | nxogre.NX_WF_ACCELERATED |\ + nxogre.NX_WF_AFFECTED_BY_HANDBRAKE | nxogre.NX_WF_STEERABLE_INPUT | nxogre.NX_WF_BUILD_LOWER_HALF self.AddWheelToActor(actor, wheelDesc) - return actor + return actor -def InitNx() +def InitNx(): - ## Create a memory allocator - gAllocator = new UserAllocator + ## Create a memory allocator + gAllocator = nxogre.UserAllocator () ## Create the physics SDK self.gPhysicsSDK = NxCreatePhysicsSDK(nxogre.NX_PHYSICS_SDK_VERSION, gAllocator) - if (!self.gPhysicsSDK) return : + if not self.gPhysicsSDK : return - ## Set the physics parameters - self.gPhysicsSDK.setParameter(nxogre.NX_SKIN_WIDTH, 0.05) + ## Set the physics parameters + self.gPhysicsSDK.setParameter(nxogre.NX_SKIN_WIDTH, 0.05) - ## Set the debug visualization parameters - self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZATION_SCALE, 1) - self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_ACTOR_AXES, 1) - self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_COLLISION_SHAPES, 1) + ## Set the debug visualization parameters + self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZATION_SCALE, 1) + self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_ACTOR_AXES, 1) + self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_COLLISION_SHAPES, 1) - self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_CONTACT_POINT, 1) - self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_CONTACT_NORMAL, 1) + self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_CONTACT_POINT, 1) + self.gPhysicsSDK.setParameter(nxogre.NX_VISUALIZE_CONTACT_NORMAL, 1) ## Create the scene sceneDesc = nxogre.NxSceneDesc () sceneDesc.gravity = gDefaultGravity - sceneDesc.simType = nxogre.NX_SIMULATION_HW - self.Scene = self.gPhysicsSDK.createScene(sceneDesc) - if(!self.Scene){ : - sceneDesc.simType = nxogre.NX_SIMULATION_SW - self.Scene = self.gPhysicsSDK.createScene(sceneDesc) - if(!self.Scene) return : + sceneDesc.simType = nxogre.NX_SIMULATION_HW + self.Scene = self.gPhysicsSDK.createScene(sceneDesc) + if not self.Scene: + sceneDesc.simType = nxogre.NX_SIMULATION_SW + self.Scene = self.gPhysicsSDK.createScene(sceneDesc) + if not self.Scene :return - ## Create the default material - NxMaterial* defaultMaterial = self.Scene.getMaterialFromIndex(0) - defaultMaterial.setRestitution(0.5) - defaultMaterial.setStaticFriction(0.5) - defaultMaterial.setDynamicFriction(0.5) + ## Create the default material + defaultMaterial = self.Scene.getMaterialFromIndex(0) + defaultMaterial.setRestitution(0.5) + defaultMaterial.setStaticFriction(0.5) + defaultMaterial.setDynamicFriction(0.5) - ## Create the objects in the scene - groundPlane = CreateGroundPlane() + ## Create the objects in the scene + groundPlane = CreateGroundPlane() - self.box = CreateBox(NxVec3(5,0,0), NxVec3(0.5,1,0.5), 20) - self.sphere = CreateSphere(NxVec3(0,0,5), 1, 10) - self.capsule = CreateCapsule(NxVec3(-5,0,0), 2, 0.5, 10) + self.box = CreateBox(NxVec3(5,0,0), NxVec3(0.5,1,0.5), 20) + self.sphere = CreateSphere(NxVec3(0,0,5), 1, 10) + self.capsule = CreateCapsule(NxVec3(-5,0,0), 2, 0.5, 10) - ## Reset wheel material - self.wsm = None + ## Reset wheel material + self.wsm = None - self.cab = CreateCab(NxVec3(0,0,0)) + self.cab = CreateCab(NxVec3(0,0,0)) - self.SelectedActor = cab - self.gForceStrength = 35000 + self.SelectedActor = cab + self.gForceStrength = 35000 - ## Turn on all contact notifications - self.Scene.setActorGroupPairFlags(0, 0, NX_NOTIFY_ON_TOUCH) + ## Turn on all contact notifications + self.Scene.setActorGroupPairFlags(0, 0, NX_NOTIFY_ON_TOUCH) AddUserDataToActors(self.Scene) - ## Initialize HUD - InitializeHUD() + ## Initialize HUD + InitializeHUD() - ## Get the current time - UpdateTime() + ## Get the current time + UpdateTime() - ## Start the first frame of the simulation - if (self.Scene) StartPhysics() : + ## Start the first frame of the simulation + if self.Scene :StartPhysics() -int main(int argc, char** argv) +if __name__ == '__main__': + import exceptions,sys + try: + PrintControls() + InitGlut(argc, argv, "Lesson 701: Wheel Shapes") + InitNx() + glutMainLoop() + ReleaseNx() - PrintControls() - InitGlut(argc, argv, "Lesson 701: Wheel Shapes") - InitNx() - glutMainLoop() - ReleaseNx() - return 0 + except ogre.OgreException, e: + print e Deleted: trunk/python-ogre/demos/nxogre/media_old/resources.cfg =================================================================== --- trunk/python-ogre/demos/nxogre/media/resources.cfg 2008-08-17 13:10:15 UTC (rev 691) +++ trunk/python-ogre/demos/nxogre/media_old/resources.cfg 2008-08-18 08:33:08 UTC (rev 695) @@ -1,15 +0,0 @@ -# Resource locations to be added to the 'boostrap' path -# This also contains the minimum you need to use the Ogre example framework -[Bootstrap] -FileSystem=Media/Essential/Boot/ - -# Resource locations to be added to the default path -[General] -FileSystem=Media/ -FileSystem=Media/Essential/ -FileSystem=Media/Essential/BetaGUI/ -FileSystem=Media/Essential/BetaGUIExtended/ -FileSystem=Media/Essential/Fonts/ -FileSystem=Media/SimpleMeshes/ -FileSystem=Media/ComplexMeshes/ -FileSystem=Media/Env/ \ No newline at end of file Copied: trunk/python-ogre/demos/nxogre/media_old/resources.cfg (from rev 694, trunk/python-ogre/demos/nxogre/media/resources.cfg) =================================================================== --- trunk/python-ogre/demos/nxogre/media_old/resources.cfg (rev 0) +++ trunk/python-ogre/demos/nxogre/media_old/resources.cfg 2008-08-18 08:33:08 UTC (rev 695) @@ -0,0 +1,15 @@ +# Resource locations to be added to the 'boostrap' path +# This also contains the minimum you need to use the Ogre example framework +[Bootstrap] +FileSystem=Media/Essential/Boot/ + +# Resource locations to be added to the default path +[General] +FileSystem=Media/ +FileSystem=Media/Essential/ +FileSystem=Media/Essential/BetaGUI/ +FileSystem=Media/Essential/BetaGUIExtended/ +FileSystem=Media/Essential/Fonts/ +FileSystem=Media/SimpleMeshes/ +FileSystem=Media/ComplexMeshes/ +FileSystem=Media/Env/ \ No newline at end of file Modified: trunk/python-ogre/demos/nxogre/resources.cfg =================================================================== --- trunk/python-ogre/demos/nxogre/resources.cfg 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/demos/nxogre/resources.cfg 2008-08-18 08:33:08 UTC (rev 695) @@ -1,15 +1,23 @@ # Resource locations to be added to the 'boostrap' path # This also contains the minimum you need to use the Ogre example framework [Bootstrap] -FileSystem=./media/Essential/Boot/ +#FileSystem=./media/Essential/Boot/ +Zip=../media/packs/OgreCore.zip +Zip=./media_new/cake.zip # Resource locations to be added to the default path [General] -FileSystem=./media/ -FileSystem=./media/Essential/ -FileSystem=./media/Essential/BetaGUI/ -FileSystem=./media/Essential/BetaGUIExtended/ -FileSystem=./media/Essential/Fonts/ -FileSystem=./media/SimpleMeshes/ -FileSystem=./media/ComplexMeshes/ -FileSystem=./media/Env/ \ No newline at end of file +FileSystem=./media_old/ +FileSystem=./media_old/Essential/ +FileSystem=./media_old/Essential/BetaGUI/ +FileSystem=./media_old/Essential/BetaGUIExtended/ +FileSystem=./media_old/Essential/Fonts/ +#FileSystem=./media_old/SimpleMeshes/ +#F#ileSystem=./media_old/ComplexMeshes/ +#F#ileSystem=./media_old/Env/ + +FileSystem=./media_new/gui +FileSystem=./media_new/images +FileSystem=./media_new/materials +FileSystem=./media_new/meshes +FileSystem=./media_new/programs Deleted: trunk/python-ogre/demos/ogre/plugins.cfg =================================================================== --- trunk/python-ogre/demos/ogre/plugins.cfg 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/demos/ogre/plugins.cfg 2008-08-18 08:33:08 UTC (rev 695) @@ -1,15 +0,0 @@ -# Defines plugins to load -# Defines plugins to load - -# Define plugin folder -# CHANGE THIS TO YOUR PATH -PluginFolder=/home/andy/development/root/usr/lib/OGRE - -# Define D3D rendering implementation plugin -Plugin=RenderSystem_GL.so -Plugin=Plugin_ParticleFX.so -Plugin=Plugin_BSPSceneManager.so -Plugin=Plugin_OctreeSceneManager.so -Plugin=Plugin_CgProgramManager.so - - Added: trunk/python-ogre/patch/ParticleUniverse_0.8.patch =================================================================== --- trunk/python-ogre/patch/ParticleUniverse_0.8.patch (rev 0) +++ trunk/python-ogre/patch/ParticleUniverse_0.8.patch 2008-08-18 08:33:08 UTC (rev 695) @@ -0,0 +1,167 @@ +Only in \development\Particle Universe V0.8\Plugins\ParticleUniverse\Docs: desktop.ini +Only in \development\Particle Universe V0.8\Plugins\ParticleUniverse\Docs\html: class_particle_universe_1_1_align_affector_tokens_1_1_resize_token-members.html +Only in \development\Particle Universe V0.8\Plugins\ParticleUniverse\Docs\manual\files\images: Thumbs.db +Only in \development\Particle Universe V0.8\Plugins\ParticleUniverse\Docs: Thumbs.db +diff -r -U 3 .\include\ParticleUniverseHook.h \development\Particle Universe V0.8\Plugins\ParticleUniverse\include\ParticleUniverseHook.h +--- .\include\ParticleUniverseHook.h Mon Aug 18 14:57:32 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\include\ParticleUniverseHook.h Fri Jun 13 09:31:50 2008 +@@ -36,8 +36,8 @@ + if (list->empty()) + return; + +- typename std::vector<T*>::iterator it; +- typename std::vector<T*>::iterator itEnd = list->end(); ++ std::vector<T*>::iterator it; ++ std::vector<T*>::iterator itEnd = list->end(); + for (it = list->begin(); it != itEnd; ++it) + { + (*it)->_prepare(technique); +@@ -51,8 +51,8 @@ + if (list->empty()) + return; + +- typename std::vector<T*>::iterator it; +- typename std::vector<T*>::iterator itEnd = list->end(); ++ std::vector<T*>::iterator it; ++ std::vector<T*>::iterator itEnd = list->end(); + for (it = list->begin(); it != itEnd; ++it) + { + (*it)->_notifyStart(); +@@ -66,8 +66,8 @@ + if (list->empty()) + return; + +- typename std::vector<T*>::iterator it; +- typename std::vector<T*>::iterator itEnd = list->end(); ++ std::vector<T*>::iterator it; ++ std::vector<T*>::iterator itEnd = list->end(); + for (it = list->begin(); it != itEnd; ++it) + { + (*it)->_notifyStop(); +@@ -83,8 +83,8 @@ + if (list->empty()) + return; + +- typename std::vector<T*>::iterator it; +- typename std::vector<T*>::iterator itEnd = list->end(); ++ std::vector<T*>::iterator it; ++ std::vector<T*>::iterator itEnd = list->end(); + for (it = list->begin(); it != itEnd; ++it) + { + (*it)->_preProcessParticles(technique, timeElapsed); +@@ -102,8 +102,8 @@ + if (list->empty()) + return; + +- typename std::vector<T*>::iterator it; +- typename std::vector<T*>::iterator itEnd = list->end(); ++ std::vector<T*>::iterator it; ++ std::vector<T*>::iterator itEnd = list->end(); + for (it = list->begin(); it != itEnd; ++it) + { + (*it)->_processParticle(particleTechnique, particle, timeElapsed, firstParticle); +@@ -119,8 +119,8 @@ + if (list->empty()) + return; + +- typename std::vector<T*>::iterator it; +- typename std::vector<T*>::iterator itEnd = list->end(); ++ std::vector<T*>::iterator it; ++ std::vector<T*>::iterator itEnd = list->end(); + for (it = list->begin(); it != itEnd; ++it) + { + (*it)->_postProcessParticles(technique, timeElapsed); +diff -r -U 3 .\include\ParticleUniverseSpatialHashTable.h \development\Particle Universe V0.8\Plugins\ParticleUniverse\include\ParticleUniverseSpatialHashTable.h +--- .\include\ParticleUniverseSpatialHashTable.h Mon Aug 18 14:59:01 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\include\ParticleUniverseSpatialHashTable.h Fri Jun 13 09:31:51 2008 +@@ -35,7 +35,7 @@ + SpatialHashTable(void) : + mTableSize(50), + mCellDimension(15), +- mCellOverlap(5) ++ mCellOverlap(5), + { + _initialise(); + }; +Only in \development\Particle Universe V0.8\Plugins\ParticleUniverse\misc: Thumbs.db +Only in .: obj +Only in .\scripts: ParticleUniverse.vcproj.JNPR.amiller.user +diff -r -U 3 .\src\Externs\ParticleUniverseBoxColliderExtern.cpp \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseBoxColliderExtern.cpp +--- .\src\Externs\ParticleUniverseBoxColliderExtern.cpp Mon Aug 18 15:02:13 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseBoxColliderExtern.cpp Fri Jun 13 09:31:51 2008 +@@ -29,7 +29,7 @@ + if (isAttached()) + { + // Use the position of the parent node in this case. +- position = getParentNode()->getPosition(); ++ position = getParentNode()->getWorldPosition(); + mDerivedPosition = position; + populateAlignedBox(mBox, mDerivedPosition, mWidth, mHeight, mDepth); + _calculateBounds(); +diff -r -U 3 .\src\Externs\ParticleUniverseGravityExtern.cpp \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseGravityExtern.cpp +--- .\src\Externs\ParticleUniverseGravityExtern.cpp Mon Aug 18 15:02:15 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseGravityExtern.cpp Fri Jun 13 09:31:51 2008 +@@ -29,7 +29,7 @@ + // Use the position of the parent node in this case. + if (isAttached()) + { +- position = getParentNode()->getPosition(); ++ position = getParentNode()->getWorldPosition(); + mDerivedPosition = position; + } + } +diff -r -U 3 .\src\Externs\ParticleUniverseSphereColliderExtern.cpp \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseSphereColliderExtern.cpp +--- .\src\Externs\ParticleUniverseSphereColliderExtern.cpp Mon Aug 18 15:02:16 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseSphereColliderExtern.cpp Fri Jun 13 09:31:51 2008 +@@ -29,7 +29,7 @@ + if (isAttached()) + { + // Use the position of the parent node in this case. +- position = getParentNode()->getPosition(); ++ position = getParentNode()->getWorldPosition(); + mDerivedPosition = position; + mSphere.setCenter(mDerivedPosition); + } +diff -r -U 3 .\src\Externs\ParticleUniverseVortexExtern.cpp \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseVortexExtern.cpp +--- .\src\Externs\ParticleUniverseVortexExtern.cpp Mon Aug 18 15:02:16 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\Externs\ParticleUniverseVortexExtern.cpp Fri Jun 13 09:31:51 2008 +@@ -28,7 +28,7 @@ + { + if (isAttached()) + { +- position = getParentNode()->getPosition(); ++ position = getParentNode()->getWorldPosition(); + mDerivedPosition = position; + } + } +diff -r -U 3 .\src\ParticleUniverseSystem.cpp \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\ParticleUniverseSystem.cpp +--- .\src\ParticleUniverseSystem.cpp Mon Aug 18 15:17:00 2008 ++++ \development\Particle Universe V0.8\Plugins\ParticleUniverse\src\ParticleUniverseSystem.cpp Fri Jun 13 09:32:00 2008 +@@ -392,7 +392,7 @@ + if (!mTimeController) + { + mTimeSinceLastVisible = 0; +- mLastVisibleFrame = Ogre::Root::getSingleton().getNextFrameNumber(); ++ mLastVisibleFrame = Ogre::Root::getSingleton().getCurrentFrameNumber(); + Ogre::ControllerManager& controllerManager = Ogre::ControllerManager::getSingleton(); + Ogre::ControllerValueRealPtr particleSystemUpdateValue(new ParticleSystemUpdateValue(this)); + mTimeController = controllerManager.createFrameTimePassthroughController(particleSystemUpdateValue); +@@ -409,7 +409,7 @@ + void ParticleSystem::_notifyCurrentCamera(Ogre::Camera* cam) + { + Ogre::MovableObject::_notifyCurrentCamera(cam); +- mLastVisibleFrame = Ogre::Root::getSingleton().getNextFrameNumber(); ++ mLastVisibleFrame = Ogre::Root::getSingleton().getCurrentFrameNumber(); + mTimeSinceLastVisible = 0.0f; + + // Notify all techniques +@@ -500,7 +500,7 @@ + { + if (mNonvisibleUpdateTimeoutSet) + { +- long frameDiff = Ogre::Root::getSingleton().getNextFrameNumber() - mLastVisibleFrame; ++ long frameDiff = Ogre::Root::getSingleton().getCurrentFrameNumber() - mLastVisibleFrame; + if (frameDiff > 1 || frameDiff < 0) + { + mTimeSinceLastVisible += timeElapsed; +Only in \development\Particle Universe V0.8\Plugins\ParticleUniverse: Thumbs.db Deleted: trunk/python-ogre/patch/ogre_svn.patch =================================================================== --- trunk/python-ogre/patch/ogre_svn.patch 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/patch/ogre_svn.patch 2008-08-18 08:33:08 UTC (rev 695) @@ -1,98 +0,0 @@ -Index: OgreMovableObject.h -=================================================================== ---- OgreMovableObject.h (revision 7604) -+++ OgreMovableObject.h (working copy) -@@ -479,7 +479,7 @@ - included too. - */ - virtual void visitRenderables(Renderable::Visitor* visitor, -- bool debugRenderables = false) = 0; -+ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } - - /** Sets whether or not the debug display of this object is enabled. - @remarks -Index: OgreRenderQueueListener.h -=================================================================== ---- OgreRenderQueueListener.h (revision 7604) -+++ OgreRenderQueueListener.h (working copy) -@@ -31,7 +31,9 @@ - - #include "OgrePrerequisites.h" - #include "OgreRenderQueue.h" -+#include <stdexcept> - -+ - namespace Ogre { - - /** Abstract interface which classes must implement if they wish to receive -@@ -65,7 +67,7 @@ - for this queue group. - */ - virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, -- bool& skipThisInvocation) = 0; -+ bool& skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } - - /** Event raised after a queue group is rendered. - @remarks -@@ -80,7 +82,7 @@ - events will also be fired for it again. - */ - virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, -- bool& repeatThisInvocation) = 0; -+ bool& repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } - }; - - } -Index: OgreDataStream.h -=================================================================== ---- OgreDataStream.h (revision 7604) -+++ OgreDataStream.h (working copy) -@@ -33,6 +33,7 @@ - #include "OgreString.h" - #include "OgreSharedPtr.h" - #include <istream> -+#include <stdexcept> - - namespace Ogre { - -@@ -79,7 +80,7 @@ - @param count Number of bytes to read - @returns The number of bytes read - */ -- virtual size_t read(void* buf, size_t count) = 0; -+ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } - /** Get a single line from the stream. - @remarks - The delimiter character is not included in the data -@@ -146,7 +147,7 @@ - /** Returns the total size of the data to be read from the stream, - or 0 if this is indeterminate for this stream. - */ -- size_t size(void) const { return mSize; } -+ virtual size_t size(void) const { return mSize; } - - /** Close the stream; this makes further operations invalid. */ - virtual void close(void) = 0; -Index: OgreHardwareBuffer.h -=================================================================== ---- OgreHardwareBuffer.h (revision 7604) -+++ OgreHardwareBuffer.h (working copy) -@@ -31,7 +31,9 @@ - - // Precompiler options - #include "OgrePrerequisites.h" -+#include <stdexcept> - -+ - namespace Ogre { - - /** Abstract class defining common features of hardware buffers. -@@ -244,7 +246,7 @@ - @param pDest The area of memory in which to place the data, must be large enough to - accommodate the data! - */ -- virtual void readData(size_t offset, size_t length, void* pDest) = 0; -+ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } - /** Writes data to the buffer from an area of system memory; note that you must - ensure that your buffer is big enough. - @param offset The byte offset from the start of the buffer to start writing Deleted: trunk/python-ogre/setup_dist.py =================================================================== --- trunk/python-ogre/setup_dist.py 2008-08-18 04:12:37 UTC (rev 694) +++ trunk/python-ogre/setup_dist.py 2008-08-18 08:33:08 UTC (rev 695) @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# This is the distutils setup script for python-ogre. -# Full instructions are in "install.txt" or "install.html" -# -# To configure, compile, install, just run this script. - -DESCRIPTION = """Python-Ogre is a Python wrapper module for the -OGRE 3D Graphics library. It contains python functions and classes -that will allow you to fully utilitize the Ogre library. It is -Unique in that the python wrappers are created automatically by -Py++, hence making maintainence etc very simple. -This version is built against the Ogre CVS""" - -METADATA = { - "name": "Python-Ogre", - "version": "0.65 CVS", - "license": "LGPL", - "url": "http://python-ogre.python-hosting.com/";, - "author": "Lakin Wecker, Roman Yakovenko, Andy", - "author_email": "python-ogre-developers@...", - "description": "Py++ Ogre Python Binding: For CVS version of Ogre", - "long_description": DESCRIPTION, -} -from distutils.core import setup -import os, sys - -def GetFileList ( basepath ): - filesout = [] - for root, dirs, files in os.walk(basepath): - for name in files: - filesout.append(os.path.join(root, name)) - return filesout - -base = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]) ) -demofiles = GetFileList ( os.path.join (base, "demos") ) - -PACKAGEDATA = { - "packages": ['Ogre', 'OIS', 'CEGUI', 'OgreRefApp', 'OgreNewt'], - "package_dir": {'': 'packages'}, - "package_data": {'': ['*.pyd', '*.dll']}, -# "data_files": [(base+'Demos', demofiles),] - -} - -PACKAGEDATA.update(METADATA) -setup(**PACKAGEDATA) - - - \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-08-18 08:56:34
|
Revision: 697 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=697&view=rev Author: mithro Date: 2008-08-18 08:56:44 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Fix up the way boost_python_index target is built. Modified Paths: -------------- trunk/python-ogre/boost/Makefile trunk/python-ogre/boost/debian/control trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/boost/debian/dsc Modified: trunk/python-ogre/boost/Makefile =================================================================== --- trunk/python-ogre/boost/Makefile 2008-08-18 08:35:42 UTC (rev 696) +++ trunk/python-ogre/boost/Makefile 2008-08-18 08:56:44 UTC (rev 697) @@ -1,19 +1,43 @@ -export GCC_VERSION=`gcc --version | head -1 | sed -e's/.*) \([0-9]\)\.\([0-9]\).*/\1\2/'` -export PYTHON_VERSION=`python -V 2>&1 | sed -e's/Python \(2\.[45]\).*/\1/'` +PREFIX := '/usr' +GCC_VERSION=`gcc --version | head -1 | sed -e's/.*) \([0-9]\)\.\([0-9]\).*/\1\2/'` +PYTHON_VERSION=`python -V 2>&1 | sed -e's/Python \(2\.[45]\).*/\1/'` +MT_VERSION=`if [ x${MT} = True ]; then echo "mt-"; fi` +MT_FLAGS=`if [ x${MT} = True ]; then echo "-D_MT"; fi` +CXXFLAGS=-I. \ + -I/usr/include/python${PYTHON_VERSION} \ + -shared \ + -Wl,-soname,libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so \ + -o libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so -fPIC \ + -lboost_python-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION} \ + -L${PREFIX}/lib/ \ + -lpython${PYTHON_VERSION} \ + $(MT_FLAGS) + + all: libs/python/src/indexing/indexing_slice.cpp libs/python/src/indexing/python_iterator.cpp - g++ $? \ - -I . \ - -I /usr/include/python${PYTHON_VERSION} \ - -shared -Wl,-soname,libboost_python_index-gcc${GCC_VERSION}-1_34_1.so -o libboost_python_index-gcc${GCC_VERSION}-1_34_1.so -fPIC \ - -lboost_python \ - -lpython${PYTHON_VERSION} + @make version + @echo "Current CXXFLAGS: ${CXXFLAGS}" + @echo "Running g++ ${CXXFLAGS} $?" + @g++ ${CXXFLAGS} $? +version: + @if [ x${BOOST_VERSION} = x ]; then \ + echo "You have not specified a BOOST_VERSION, please do so!"; \ + exit 1; \ + fi + install: + @make version mkdir -p ${PREFIX}/usr/lib - cp libboost_python_index-gcc${GCC_VERSION}-1_34_1.so ${PREFIX}/usr/lib - ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-1_34_1.so ${PREFIX}/usr/lib/libboost_python_index.so + if [ x${MT} = xTrue ]; then \ + cp libboost_python_index-gcc${GCC_VERSION}-mt-${BOOST_VERSION}.so ${PREFIX}/usr/lib; \ + ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-mt-${BOOST_VERSION}.so ${PREFIX}/usr/lib/libboost_python_index.so; \ + else \ + cp libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so ${PREFIX}/usr/lib; \ + ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so ${PREFIX}/usr/lib/libboost_python_index.so; \ + fi mkdir -p ${PREFIX}/usr/include cp -rvf boost ${PREFIX}/usr/include @@ -22,4 +46,4 @@ clean: rm *.so -.PHONY: install clean +.PHONY: install clean version Modified: trunk/python-ogre/boost/debian/control =================================================================== --- trunk/python-ogre/boost/debian/control 2008-08-18 08:35:42 UTC (rev 696) +++ trunk/python-ogre/boost/debian/control 2008-08-18 08:56:44 UTC (rev 697) @@ -1,7 +1,7 @@ Source: boost-python1.34.1-index Priority: extra Maintainer: Tim Ansell <tim@...> -Build-Depends: debhelper (>= 5) +Build-Depends: debhelper (>= 5), libboost-python-dev (>= 1.34), libstdc++6-4.1-dev | libstdc++6-4.2-dev, python-dev Standards-Version: 3.7.2 Section: libs Added: trunk/python-ogre/boost/debian/dsc =================================================================== --- trunk/python-ogre/boost/debian/dsc (rev 0) +++ trunk/python-ogre/boost/debian/dsc 2008-08-18 08:56:44 UTC (rev 697) @@ -0,0 +1,10 @@ +Format: 1.0 +Source: boost-python1.34.1-index +Binary: libboost-python1.34.1-index-dev, libboost-python1.34.1-index +Architecture: any +Version: 0.0.0-1 +Maintainer: Tim 'Mithro' Ansell <mithro@...> +Standards-Version: 3.7.2 +%%BUILDDEPS%% +Files: + %%MD5SUM%% %%SIZE%% Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-18 08:35:42 UTC (rev 696) +++ trunk/python-ogre/environment.py 2008-08-18 08:56:44 UTC (rev 697) @@ -518,18 +518,19 @@ class boost_python_index: active = True - version = "1.34.1" + version = boost.base[6:] pythonModule = False ModuleName = "" - base = "libboost-python%s-index" % boost.base[6:].replace("_",".") + base = "libboost-python%s-index" % version.replace("_",".") if isLinux() or isMac(): + FLAGS = "PREFIX=%s BOOST_VERSION=%s" % (PREFIX, version) source = [ ["rm","-rf %s" % (base,), os.getcwd()], ["cp",'-rvf %s/ %s' % (os.path.join('python-ogre','boost'), base), os.getcwd()], ] buildCmds = [ - [0,'make all', os.path.join(os.getcwd(), base)], - [0,'PREFIX=%s make install' % PREFIX, os.path.join(os.getcwd(), base)], + [0,'make all %s' % FLAGS, os.path.join(os.getcwd(), base)], + [0,'make install %s' % FLAGS, os.path.join(os.getcwd(), base)], ] lib = boost.lib.replace("python", "python_index") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-08-18 09:03:49
|
Revision: 698 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=698&view=rev Author: mithro Date: 2008-08-18 09:03:58 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Fix the MT version and make it the default. Modified Paths: -------------- trunk/python-ogre/boost/Makefile trunk/python-ogre/environment.py Modified: trunk/python-ogre/boost/Makefile =================================================================== --- trunk/python-ogre/boost/Makefile 2008-08-18 08:56:44 UTC (rev 697) +++ trunk/python-ogre/boost/Makefile 2008-08-18 09:03:58 UTC (rev 698) @@ -2,14 +2,14 @@ PREFIX := '/usr' GCC_VERSION=`gcc --version | head -1 | sed -e's/.*) \([0-9]\)\.\([0-9]\).*/\1\2/'` PYTHON_VERSION=`python -V 2>&1 | sed -e's/Python \(2\.[45]\).*/\1/'` -MT_VERSION=`if [ x${MT} = True ]; then echo "mt-"; fi` -MT_FLAGS=`if [ x${MT} = True ]; then echo "-D_MT"; fi` +MT_VERSION=`if [ x${MT} = xTrue ]; then echo "mt-"; fi` +MT_FLAGS=`if [ x${MT} = xTrue ]; then echo "-D_MT"; fi` CXXFLAGS=-I. \ -I/usr/include/python${PYTHON_VERSION} \ -shared \ -Wl,-soname,libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so \ - -o libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so -fPIC \ + -o libboost_python_index-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION}.so -fPIC \ -lboost_python-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION} \ -L${PREFIX}/lib/ \ -lpython${PYTHON_VERSION} \ @@ -31,13 +31,10 @@ install: @make version mkdir -p ${PREFIX}/usr/lib - if [ x${MT} = xTrue ]; then \ - cp libboost_python_index-gcc${GCC_VERSION}-mt-${BOOST_VERSION}.so ${PREFIX}/usr/lib; \ - ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-mt-${BOOST_VERSION}.so ${PREFIX}/usr/lib/libboost_python_index.so; \ - else \ - cp libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so ${PREFIX}/usr/lib; \ - ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-${BOOST_VERSION}.so ${PREFIX}/usr/lib/libboost_python_index.so; \ - fi + @echo cp libboost_python_index-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION}.so ${PREFIX}/usr/lib + @cp libboost_python_index-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION}.so ${PREFIX}/usr/lib + @echo ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION}.so ${PREFIX}/usr/lib/libboost_python_index.so + @ln -sf /usr/lib/libboost_python_index-gcc${GCC_VERSION}-${MT_VERSION}${BOOST_VERSION}.so ${PREFIX}/usr/lib/libboost_python_index.so mkdir -p ${PREFIX}/usr/include cp -rvf boost ${PREFIX}/usr/include Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-18 08:56:44 UTC (rev 697) +++ trunk/python-ogre/environment.py 2008-08-18 09:03:58 UTC (rev 698) @@ -523,7 +523,7 @@ ModuleName = "" base = "libboost-python%s-index" % version.replace("_",".") if isLinux() or isMac(): - FLAGS = "PREFIX=%s BOOST_VERSION=%s" % (PREFIX, version) + FLAGS = "PREFIX=%s BOOST_VERSION=%s MT=True" % (PREFIX, version) source = [ ["rm","-rf %s" % (base,), os.getcwd()], ["cp",'-rvf %s/ %s' % (os.path.join('python-ogre','boost'), base), os.getcwd()], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-08-20 10:01:10
|
Revision: 704 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=704&view=rev Author: mithro Date: 2008-08-20 10:01:18 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Make deb install both multithreaded and non-multithreaded versions. Fixed deb building when building against boost 1.35.1 (and other versions). Modified Paths: -------------- trunk/python-ogre/BuildModule.py trunk/python-ogre/boost/debian/control trunk/python-ogre/boost/debian/dsc trunk/python-ogre/boost/debian/rules trunk/python-ogre/environment.py Modified: trunk/python-ogre/BuildModule.py =================================================================== --- trunk/python-ogre/BuildModule.py 2008-08-20 09:59:34 UTC (rev 703) +++ trunk/python-ogre/BuildModule.py 2008-08-20 10:01:18 UTC (rev 704) @@ -179,12 +179,12 @@ exit("Was not able to copy the debian directory over") # Rewrite any place holders - ret = spawnTask( "sed --in-place "+debiandir+"/changelog -e \"s|%%SHORTDATE%%|`date +%Y%m%d`|\" -e \"s|%%LONGDATE%%|`date +'%a, %d %b %Y %H:%m:%S %z'`|\"", srcdir) - if ret != 0: - exit("Was not able to update the debian change log.") - ret = spawnTask( "sed --in-place "+debiandir+"/control -e \"s|%%SHORTDATE%%|`date +%Y%m%d`|\" -e \"s|%%LONGDATE%%|`date +'%a, %d %b %Y %H:%m:%S %z'`|\"", srcdir) - if ret != 0: - exit("Was not able to update the debian control file.") + for file in os.listdir(debiandir): + if not os.path.isfile(os.path.join(debiandir, file)): + continue + ret = spawnTask( "sed --in-place "+os.path.join(debiandir,file)+" -e\"s|%%SHORTDATE%%|`date +%Y%m%d`|\" -e\"s|%%LONGDATE%%|`date +'%a, %d %b %Y %H:%m:%S %z'`|\" -e\"s|%%VERSION%%|"+module.source_version+"|\"", srcdir) + if ret != 0: + exit("Was not able to update the debian change log.") # Check that all the dependencies for this package are avaliable c = StringIO() @@ -304,5 +304,3 @@ compileCode ( classList[ moduleName ] ) else: print ( "Module specificed does not need compiling (%s is a supporting module)" % moduleName ) - - Modified: trunk/python-ogre/boost/debian/control =================================================================== --- trunk/python-ogre/boost/debian/control 2008-08-20 09:59:34 UTC (rev 703) +++ trunk/python-ogre/boost/debian/control 2008-08-20 10:01:18 UTC (rev 704) @@ -1,20 +1,20 @@ -Source: boost-python1.34.1-index +Source: boost-python%%VERSION%%-index Priority: extra Maintainer: Tim Ansell <tim@...> -Build-Depends: debhelper (>= 5), libboost-python-dev (>= 1.34), libstdc++6-4.1-dev | libstdc++6-4.2-dev, python-dev +Build-Depends: debhelper (>= 5), libboost-python-dev (>= %%VERSION%%), libstdc++6-4.1-dev | libstdc++6-4.2-dev, python-dev Standards-Version: 3.7.2 Section: libs -Package: libboost-python1.34.1-index-dev +Package: libboost-python%%VERSION%%-index-dev Section: libdevel Architecture: any -Depends: libboost-python1.34.1-index (= ${Source-Version}) +Depends: libboost-python%%VERSION%%-index (= ${Source-Version}) Description: Extra index stuff for boost-python This package is the extra index stuff needed by python-ogre (and possibly others). It does not refer to a real upstream object, we expect this to go way once boost-python is updated. -Package: libboost-python1.34.1-index +Package: libboost-python%%VERSION%%-index Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Modified: trunk/python-ogre/boost/debian/dsc =================================================================== --- trunk/python-ogre/boost/debian/dsc 2008-08-20 09:59:34 UTC (rev 703) +++ trunk/python-ogre/boost/debian/dsc 2008-08-20 10:01:18 UTC (rev 704) @@ -1,6 +1,6 @@ Format: 1.0 -Source: boost-python1.34.1-index -Binary: libboost-python1.34.1-index-dev, libboost-python1.34.1-index +Source: boost-python%%VERSION%%-index +Binary: libboost-python%%VERSION%%-index-dev, libboost-python%%VERSION%%-index Architecture: any Version: 0.0.0-1 Maintainer: Tim 'Mithro' Ansell <mithro@...> Modified: trunk/python-ogre/boost/debian/rules =================================================================== --- trunk/python-ogre/boost/debian/rules 2008-08-20 09:59:34 UTC (rev 703) +++ trunk/python-ogre/boost/debian/rules 2008-08-20 10:01:18 UTC (rev 704) @@ -11,6 +11,7 @@ export DH_COMPAT=2 export GCC_VERSION=`gcc --version | head -1 | sed -e's/.*) \([0-9]\)\.\([0-9]\).*/\1\2/'` export PYTHON_VERSION=`python -V 2>&1 | sed -e's/Python \(2\.[45]\).*/\1/'` +export BOOST_VERSION=`echo %%VERSION%% | sed -e's/\./_/g'` # shared library versions, option 1 #version=2.0.5 @@ -33,6 +34,7 @@ dh_testdir make all + make all MT=True touch $@ @@ -53,7 +55,8 @@ dh_installdirs # Add here commands to install the package into debian/tmp - PREFIX=$(CURDIR)/debian/tmp make install + make install PREFIX=$(CURDIR)/debian/tmp + make install PREFIX=$(CURDIR)/debian/tmp MT=True # Build architecture-independent files here. binary-indep: build install @@ -67,8 +70,8 @@ dh_installdocs dh_installexamples - dh_movefiles -plibboost-python1.34.1-index-dev /usr/include/boost - dh_movefiles -plibboost-python1.34.1-index /usr/lib + dh_movefiles -plibboost-python%%VERSION%%-index-dev /usr/include/boost + dh_movefiles -plibboost-python%%VERSION%%-index /usr/lib # dh_install # dh_installmenu Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-20 09:59:34 UTC (rev 703) +++ trunk/python-ogre/environment.py 2008-08-20 10:01:18 UTC (rev 704) @@ -304,10 +304,12 @@ active = True base = 'pyplusplus' if _STABLE: + source_version = "1300" source = [ [svn, " co -r 1300 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev "+base, os.getcwd()] ] else: + source_version = "1362" source = [ [svn, " co -r 1362 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev "+base, os.getcwd()] ] @@ -518,12 +520,12 @@ class boost_python_index: active = True - version = boost.base[6:] + source_version = boost.base[6:].replace("_",".") pythonModule = False ModuleName = "" - base = "libboost-python%s-index" % version.replace("_",".") + base = "libboost-python%s-index" % source_version #.replace(".", "_") if isLinux() or isMac(): - FLAGS = "PREFIX=%s BOOST_VERSION=%s MT=True" % (PREFIX, version) + FLAGS = "PREFIX=%s BOOST_VERSION=%s MT=True" % (PREFIX, source_version) source = [ ["rm","-rf %s" % (base,), os.getcwd()], ["cp",'-rvf %s/ %s' % (os.path.join('python-ogre','boost'), base), os.getcwd()], @@ -1766,4 +1768,3 @@ cls.PydName = cls.PydName + '.so' elif os.name =='mac': print "WARNING - check the last line of environment.py!!" - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-22 08:22:52
|
Revision: 710 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=710&view=rev Author: andy_miller Date: 2008-08-22 08:23:01 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Update to Ogre code based upon Py++ improvements bullet support for 2.70 Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/code_generators/bullet/generate_code.py trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py trunk/python-ogre/demos/bullet/test01.py trunk/python-ogre/environment.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-22 08:23:01 UTC (rev 710) @@ -74,7 +74,7 @@ PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') PATH_ogrevideoffmpeg = os.path.join(PATH_THIRDPARTY,'ffmpeg') -PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.69') +PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.70') PATH_PhysX= "c:/program files/NVIDIA Corporation/NVIDIA Physx SDK/v2.8.1/SDKs" PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') PATH_ffmpeg= os.path.join(PATH_THIRDPARTY,'extra') Modified: trunk/python-ogre/code_generators/bullet/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/bullet/generate_code.py 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/code_generators/bullet/generate_code.py 2008-08-22 08:23:01 UTC (rev 710) @@ -94,6 +94,7 @@ ,'::btAxisSweep3Internal<unsigned short>::processAllOverlappingPairs' ,'::btMultiSapBroadphase::createProxy' ,'::btMultiSapBroadphase::quicksort' + ,'::btBvhTriangleMeshShape::setOptimizedBvh' # new in 2.70 ] @@ -114,7 +115,7 @@ ,'btAlignedAllocator<btRaycastVehicle*, 16u>' ,'btAlignedAllocator<btBroadphaseInterface*, 16u>' - ,'btAlignedAllocator<btDbvt::Node const*, 16u>' + ,'btAlignedAllocator<btDbvtNode const*, 16u>' # ,'btAlignedObjectArray<short>' # ,'btAlignedAllocator<btDbvt::sStkNN, 16u>' # ,'btAlignedAllocator<btDbvt::sStkNP, 16u>' @@ -126,7 +127,8 @@ # ,'btAlignedAllocator<btOdeSolverBody, 16u>' ,'btAlignedAllocator<btOdeSolverBody*, 16u>' # ,'btAlignedAllocator<btOdeTypedJoint, 16u>' - ,'btAlignedAllocator<short, 16u>' + ,'btAlignedAllocator<unsigned int, 16u>' + ,'btAlignedAllocator<unsigned short, 16u>' # ,'btAlignedObjectArray<btDbvt::Node const*>' # ,'btAlignedObjectArray<btDbvt::sStkNN>' # ,'btAlignedObjectArray<btDbvt::sStkNP>' @@ -197,6 +199,12 @@ for a in c.arguments: if a.default_value and "&0.0" in a.default_value: a.default_value = "::btVector3( (0.0), (0.0), (0.0) )" + + ## Bug ingccxml where it doesn't get the namespace for default values + ## btCollisionWorld::addCollisionObject + f=main_ns.class_('btCollisionWorld').mem_fun('addCollisionObject') + f.arguments[1].default_value = 'btBroadphaseProxy::DefaultFilter' # (short int)(btBroadphaseProxy::DefaultFilter) + f.arguments[2].default_value = 'btBroadphaseProxy::AllFilter' # (short int)(btBroadphaseProxy::AllFilter) ############################################################ ## Modified: trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h =================================================================== --- trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h 2008-08-22 08:23:01 UTC (rev 710) @@ -25,7 +25,7 @@ typedef btAlignedAllocator<btBroadphaseInterface*, 16> BroadphaseInterfacePtr16; // new changes -typedef btAlignedAllocator<btDbvt::Node const*, 16u> AlignedAllocatorDbvtNode; +typedef btAlignedAllocator<btDbvtNode const*, 16u> AlignedAllocatorDbvtNode; typedef btAlignedObjectArray<short> AlignedObjectArrayShort; typedef btAlignedAllocator<btDbvt::sStkNN, 16u> AlignedAllocatorsStkNN; typedef btAlignedAllocator<btDbvt::sStkNP, 16u> AlignedAllocatorsStkNP; @@ -38,7 +38,7 @@ typedef btAlignedAllocator<btOdeSolverBody*, 16u> AlignedAllocatorOdeSolverBodyPtr; typedef btAlignedAllocator<btOdeTypedJoint, 16u> AlignedAllocatorOdeTypedJoint; typedef btAlignedAllocator<short, 16u> AlignedAllocatorShort16; -typedef btAlignedObjectArray<btDbvt::Node const*> AlignedObjectArrayDbvtNode; +typedef btAlignedObjectArray<btDbvtNode const*> AlignedObjectArrayDbvtNode; typedef btAlignedObjectArray<btDbvt::sStkNN> AlignedObjectArrayDbvtsStkNN; typedef btAlignedObjectArray<btDbvt::sStkNP> AlignedObjectArrayDbvtsStkNP; typedef btAlignedObjectArray<btDbvt::sStkNPS> AlignedObjectArrayDbvtsStkNPS; Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-08-22 08:23:01 UTC (rev 710) @@ -764,7 +764,11 @@ def Fix_NT ( mb ): """ fixup for NT systems """ - mb.global_ns.class_( 'vector<Ogre::Vector4, std::allocator<Ogre::Vector4> >' ).exclude( ) + try: + # change in py++ so this doesn't get found? + mb.global_ns.class_( 'vector<Ogre::Vector4, std::allocator<Ogre::Vector4> >' ).exclude( ) + except: + pass Skeleton = mb.namespace( MAIN_NAMESPACE ).class_( 'Skeleton' ).constructors().exclude() ## handle the hashmaps -- TODO FIX under LINUX ??? Modified: trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py 2008-08-22 08:23:01 UTC (rev 710) @@ -887,7 +887,19 @@ Input: None\\n\\ Ouput: List containing particles" );""" ] - + +# ################################################################################################# +# WRAPPER_DEFINITION_Vector3 =\ +# """ +# int Vector3_len( Ogre::Vector3 & me ) { +# return 3; +# } +# """ +# WRAPPER_REGISTRATION_Vector3 = [ +# """def( "__len__", &Vector3_len, +# "Python-Ogre Helper Function: return length of Vector3");""", +# ] +# ################################################################################################# def iter_as_generator_vector( cls ): @@ -928,6 +940,10 @@ rt.add_declaration_code( WRAPPER_DEFINITION_RenderTarget ) apply_reg (rt, WRAPPER_REGISTRATION_RenderTarget ) +# rt = mb.class_( 'Vector3' ) +# rt.add_declaration_code( WRAPPER_DEFINITION_Vector3 ) +# apply_reg (rt, WRAPPER_REGISTRATION_Vector3 ) + rt = mb.class_( 'ResourceManager' ) rt.add_declaration_code( WRAPPER_DEFINITION_ResourceManager ) apply_reg (rt, WRAPPER_REGISTRATION_ResourceManager ) Modified: trunk/python-ogre/demos/bullet/test01.py =================================================================== --- trunk/python-ogre/demos/bullet/test01.py 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/demos/bullet/test01.py 2008-08-22 08:23:01 UTC (rev 710) @@ -22,13 +22,18 @@ solver = bullet.btSequentialImpulseConstraintSolver() -world = bullet.btDiscreteDynamicsWorld(dispatcher, broadphase , solver) +world = bullet.btDiscreteDynamicsWorld(dispatcher, broadphase , solver, collisionConfiguration) world.getDispatchInfo().m_enableSPU = True world.setGravity(bullet.btVector3(0,-10,0)) print world +print dir(world) print solver print broadphase print dispatcher print collisionConfiguration - +for x in range (30): + world.stepSimulation( x * 1/30) + +world.stepSimulation(0) +world.stepSimulation(-0.333) Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-21 02:26:07 UTC (rev 709) +++ trunk/python-ogre/environment.py 2008-08-22 08:23:01 UTC (rev 710) @@ -1426,7 +1426,7 @@ class bullet: active = True pythonModule = True - version= "2.69" + version= "2.70" name='bullet' base = "bullet-" + version baseDir = os.path.join(os.getcwd(), base) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-22 10:45:16
|
Revision: 711 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=711&view=rev Author: andy_miller Date: 2008-08-22 10:45:22 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Fix to OgreBullet due to api change in bullet 2.70 Fixed compiler options as extra command ignored on windows Modified Paths: -------------- trunk/python-ogre/BuildModule.py trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.cpp trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.h trunk/python-ogre/demos/bullet/test01.py trunk/python-ogre/environment.py Modified: trunk/python-ogre/BuildModule.py =================================================================== --- trunk/python-ogre/BuildModule.py 2008-08-22 08:23:01 UTC (rev 710) +++ trunk/python-ogre/BuildModule.py 2008-08-22 10:45:22 UTC (rev 711) @@ -83,7 +83,11 @@ for FLAGS in "CFLAGS", "CXXFLAGS", "CCFLAGS", "LDFLAGS": if not FLAGS in env: env[FLAGS] = "" - env["CFLAGS"]+=" "+"-I"+os.path.join(PREFIX,"include")+ " -L"+os.path.join(PREFIX,"lib") + if environment.isWindows(): + env["CFLAGS"]+=" "+"-I"+os.path.join(PREFIX,"include") + else: + env["CFLAGS"]+=" "+"-I"+os.path.join(PREFIX,"include")+ " -L"+os.path.join(PREFIX,"lib") + env["CXXFLAGS"]+=" "+env["CFLAGS"] env["CCFLAGS"]+=" "+env["CFLAGS"] env["LDFLAGS"]+="-Wl,-rpath='$$ORIGIN/../../lib' -Wl,-rpath='$$ORIGIN' -Wl,-z,origin" Modified: trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp 2008-08-22 08:23:01 UTC (rev 710) +++ trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp 2008-08-22 10:45:22 UTC (rev 711) @@ -75,7 +75,7 @@ // ------------------------------------------------------------------------- bool CollisionRayResultCallback::doesCollide() const { - return mRayResultCallback->HasHit(); + return mRayResultCallback->hasHit(); } // ------------------------------------------------------------------------- Object *CollisionClosestRayResultCallback::getCollidedObject () const Modified: trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.cpp =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.cpp 2008-08-22 08:23:01 UTC (rev 710) +++ trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.cpp 2008-08-22 10:45:22 UTC (rev 711) @@ -213,13 +213,12 @@ } // ------------------------------------------------------------------------- - void CollisionsWorld::launchRay(CollisionRayResultCallback &rayresult, short int collisionFilterMask) + void CollisionsWorld::launchRay(CollisionRayResultCallback &rayresult) { mWorld->rayTest( OgreBtConverter::to(rayresult.getRayStartPoint()), OgreBtConverter::to(rayresult.getRayEndPoint()), - *rayresult.getBulletRay (), - collisionFilterMask); + *rayresult.getBulletRay ()); } } Modified: trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.h =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.h 2008-08-22 08:23:01 UTC (rev 710) +++ trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsWorld.h 2008-08-22 10:45:22 UTC (rev 711) @@ -64,7 +64,7 @@ Ogre::SceneManager *getSceneManager() const {return mScnMgr;} btCollisionWorld *getBulletCollisionWorld() const {return mWorld;} - void launchRay (CollisionRayResultCallback &ray, short int collisionFilterMask = -1); + void launchRay (CollisionRayResultCallback &ray); protected: btCollisionWorld* mWorld; Modified: trunk/python-ogre/demos/bullet/test01.py =================================================================== --- trunk/python-ogre/demos/bullet/test01.py 2008-08-22 08:23:01 UTC (rev 710) +++ trunk/python-ogre/demos/bullet/test01.py 2008-08-22 10:45:22 UTC (rev 711) @@ -2,7 +2,7 @@ sys.path.insert(0,'..') import PythonOgreConfig -import ogre.renderer.OGRE +import ogre.renderer.OGRE as ogre import ogre.physics.bullet as bullet t = bullet.btTransform() ms = bullet.btDefaultMotionState (t) @@ -37,3 +37,21 @@ world.stepSimulation(0) world.stepSimulation(-0.333) + + +class OgreMotionState(bullet.btMotionState): + def __init__(self, initalPosition): + bullet.btMotionState.__init__(self) + self.Pos=initalPosition + self.Position=ogre.Vector3() + self.Quaternion=ogre.Quaternion() + def getWorldTransform(self, WorldTrans): + worldTrans=self.Pos + def setWorldTransform(WorldTrans): + self.Position=ogre.Vector3(WorldTrans.getOrigin().x(),WorldTrans.getOrigin().y(),WorldTrans.getOrigin().z()) + self.Quaternion=ogre.Quaternion(WorldTrans.getRoation().w(),WorldTrans.getRoation().x(),WorldTrans.getRoation().y(),WorldTrans.getRoation().z()) + +shape=bullet.btCapsuleShape(10, 20) +motionState=OgreMotionState(bullet.btTransform()) +Object=bullet.btRigidBody(10.0, motionState, shape) # ...this should work in my eyes +#Object=bullet.btRigidBody(bullet.btRigidBodyConstructionInfo()) ...well obviously not in bullet 2.6.9 \ No newline at end of file Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-22 08:23:01 UTC (rev 710) +++ trunk/python-ogre/environment.py 2008-08-22 10:45:22 UTC (rev 711) @@ -1472,7 +1472,7 @@ libs = [boost.lib, 'OgreMain', 'LibBulletCollision', 'LibBulletDynamics' ] - if os.name == 'nt': + if isWindows(): libs.append('LibBulletMath') include_dirs = [Config.PATH_Boost , Config.PATH_INCLUDE_Bullet @@ -1484,7 +1484,7 @@ ,Config.PATH_LIB_Bullet , Config.PATH_LIB_Ogre_OgreMain ] - if os.name=="nt": + if isWindows(): CCFLAGS = ' -DWIN32 -DNDEBUG -D_WINDOWS -D_PRECOMP ' else: CCFLAGS = ' -D_PRECOMP ' @@ -1501,7 +1501,7 @@ libs = [boost.lib, 'OgreMain', 'LibBulletCollision', 'LibBulletDynamics' ] - if os.name == 'nt': + if isWindows(): libs.append('LibBulletMath') include_dirs = [Config.PATH_Boost , Config.PATH_INCLUDE_Bullet @@ -1514,7 +1514,7 @@ ,Config.PATH_LIB_Bullet , Config.PATH_LIB_Ogre_OgreMain ] - if os.name=="nt": + if isWindows(): CCFLAGS = ' -DWIN32 -DNDEBUG -D_WINDOWS -D_PRECOMP ' else: CCFLAGS = ' -D_PRECOMP ' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <andy_miller@us...> - 2008-08-31 01:29:08
|
Revision: 713 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=713&view=rev Author: andy_miller Date: 2008-08-31 01:29:13 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Updates ready for next release (1.6 RC1) Fix to QuickGui due to OGRE api change (_setAlphaRejects) Depreciated Dshow and FFMPEG modules Disabled Navi module (issue with MSVC runtimes) Support for hikari module Modified Paths: -------------- trunk/python-ogre/ChangeLog.txt trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertexBuffer.cpp trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/demos/bullet/test01.py trunk/python-ogre/environment.py trunk/python-ogre/patch/ogre_1.6.patch trunk/python-ogre/scripts/compilesource.bat trunk/python-ogre/setup.py Added Paths: ----------- trunk/python-ogre/packages_2.5/ogre/gui/hikari/ trunk/python-ogre/packages_2.5/ogre/gui/hikari/__init__.py Modified: trunk/python-ogre/ChangeLog.txt =================================================================== --- trunk/python-ogre/ChangeLog.txt 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/ChangeLog.txt 2008-08-31 01:29:13 UTC (rev 713) @@ -1,10 +1,23 @@ -???? ?? 2008 : SVN Updates.. -============================ -Added CEGUI::Tree to handmadewrapper (Thanks Dermont) -Change to CEGUI_framework.py to force loading of CEGUIBase lib in the correct mode under Linux - means we don't need to -patch the CEGUI source... - - +August 29 2008 : Release 1.6 RC1 +================================ +Version numbering change to match the Ogre release versions. +Ogre 1.6 RC1 +OIS 1.2 +CEGUI 0.6.1 +Particle Universe 0.8 +Hydrax 0.3 +Bullet 2.70 +OgreBullet - patched to match API change in Bullet 2.7 +PhysX (NVIDA) 2.8.1 +ODE 0.10.1 +QuickGui R350 +OgreAL R115 + +Added CEGUI::Tree to handmadewrapper (Thanks Dermont) +Change to CEGUI_framework.py to force loading of CEGUIBase lib in the correct mode under Linux - means we don't need to +patch the CEGUI source... + + June 20 2008: Release 1.2 RC2 =============================' OK, so it's been a while -- what can I say, I have to live in the real world as well as the opensource one :) Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-08-31 01:29:13 UTC (rev 713) @@ -13,16 +13,14 @@ ## path to the root of your boost dir, should have 'libs', 'boost' subdirectories -# # # # # # PATH_Boost = os.path.join(BASE_DIR, 'boost_1_34_1') -# PATH_Boost = os.path.join(BASE_DIR, 'boost_1_35_0') -PATH_Boost = os.path.join(BASE_DIR, 'boost-trunk') +PATH_Boost = os.path.join(BASE_DIR, 'boost_1_36_0' ) #-trunk') ## Path to your boost_pythonxxxx lib file -# PATH_LIB_Boost = os.path.join(BASE_DIR, PATH_Boost,'bin.v2/libs/python/build/msvc-8.0/release/threading-multi') -# # # # # # # PATH_LIB_Boost = os.path.join(PATH_Boost, 'bin.v2/libs/python/build/msvc/release/threading-multi') PATH_LIB_Boost = os.path.join(PATH_Boost, 'bin.v2/libs/python/build/msvc-9.0/release/threading-multi') + ## and the name of the boost python library -LIB_Boost = r'boost_python-vc90-mt-1_36' +## now part of class boos tin environtment.py +# LIB_Boost = r'boost_python-vc90-mt-1_37' # # LIB_Boost = r'boost_python-vc80-mt-1_34_1' # LIB_Boost = r'boost_python-vc-mt-1_35' @@ -84,6 +82,7 @@ PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') +PATH_hikari = os.path.join(BASE_DIR, 'hikari', 'hikari') # it's time for the SDK version if SDK: @@ -130,6 +129,7 @@ PATH_LIB_CEGUI = os.path.join( PATH_Ogre, 'lib' ) PATH_LIB_opensteer = os.path.join(PATH_opensteer, 'win32','release') +PATH_LIB_hikari = os.path.join(PATH_hikari, 'lib') PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include') @@ -179,6 +179,7 @@ PATH_INCLUDE_particleuniverse = os.path.join(PATH_particleuniverse, 'include' ) PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_hydrax= PATH_hydrax +PATH_INCLUDE_hikari = os.path.join(PATH_hikari, 'include') PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include') ,os.path.join(BASE_DIR, 'vorbis', 'include') Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-08-31 01:29:13 UTC (rev 713) @@ -80,6 +80,7 @@ PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') +PATH_hikari = os.path.join(BASE_DIR, 'hikari', 'hikari') ### ### these paths assume you've left all the directory structure as standard @@ -118,8 +119,7 @@ PATH_LIB_navi= os.path.join(PATH_navi, 'lib') PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') PATH_LIB_opensteer = os.path.join(LOCAL_LIB) -PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') -PATH_INCLUDE_hydrax= PATH_hydrax +PATH_LIB_hikari = os.path.join(PATH_hikari, 'lib') PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_Ogre_Dependencies = PATH_INCLUDE_Ogre # os.path.join( PATH_Ogre, 'Dependencies/include') @@ -188,3 +188,7 @@ ] PATH_INCLUDE_opensteer = os.path.join(LOCAL_INCLUDE, 'OpenSteer') PATH_INCLUDE_opensteer_opensteer = os.path.join(LOCAL_INCLUDE, 'OpenSteer') +PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') +PATH_INCLUDE_hydrax= PATH_hydrax +PATH_INCLUDE_hikari = os.path.join(PATH_hikari, 'include') + Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertexBuffer.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertexBuffer.cpp 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertexBuffer.cpp 2008-08-31 01:29:13 UTC (rev 713) @@ -122,7 +122,7 @@ mRenderSystem->_setTextureUnitFiltering(0, Ogre::FO_LINEAR, Ogre::FO_LINEAR, Ogre::FO_POINT); mRenderSystem->_setTextureAddressingMode(0, mTextureAddressMode); mRenderSystem->_setTextureMatrix(0, Ogre::Matrix4::IDENTITY); - mRenderSystem->_setAlphaRejectSettings(Ogre::CMPF_ALWAYS_PASS, 0); + mRenderSystem->_setAlphaRejectSettings(Ogre::CMPF_ALWAYS_PASS, 0, false); mRenderSystem->_setTextureBlendMode(0, mColorBlendMode); mRenderSystem->_setTextureBlendMode(0, mAlphaBlendMode); mRenderSystem->_disableTextureUnitsFrom(1); Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-08-31 01:29:13 UTC (rev 713) @@ -238,8 +238,8 @@ main_ns.class_(c).noncopyable = True - # changes for Ogre 1.7 - if environment.ogre.version =="1.7": + # changes for Ogre 1.6 and on + if environment.ogre.version =="1.7" or environment.ogre.version =="1.6": # main_ns.class_("ResourceBackgroundQueue").exclude() # Ogre::ResourceBackgroundQueue::_fireBackgroundLoadingComplete isn't implemented main_ns.class_("ResourceGroupManager").mem_fun("_notifyWorldGeometryPrepareStageEnded").exclude() main_ns.class_("ResourceGroupManager").mem_fun("_notifyWorldGeometryPrepareStageStarted").exclude() Modified: trunk/python-ogre/demos/bullet/test01.py =================================================================== --- trunk/python-ogre/demos/bullet/test01.py 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/demos/bullet/test01.py 2008-08-31 01:29:13 UTC (rev 713) @@ -45,13 +45,34 @@ self.Pos=initalPosition self.Position=ogre.Vector3() self.Quaternion=ogre.Quaternion() + def getWorldTransform(self, WorldTrans): - worldTrans=self.Pos - def setWorldTransform(WorldTrans): + print WorldTrans + print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() + print self.Pos.getOrigin() + WorldTrans.setOrigin(self.Pos.getOrigin()) + WorldTrans.setBasis(self.Pos.getBasis()) + + print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() + print WorldTrans + print "Pos", self.Pos + t=self.Pos + print "T", t + t.setOrigin(WorldTrans.getOrigin()) + print "T1", t + + + + + def setWorldTransform(WorldTrans): + print "setWorldTrans", WorldTrans self.Position=ogre.Vector3(WorldTrans.getOrigin().x(),WorldTrans.getOrigin().y(),WorldTrans.getOrigin().z()) self.Quaternion=ogre.Quaternion(WorldTrans.getRoation().w(),WorldTrans.getRoation().x(),WorldTrans.getRoation().y(),WorldTrans.getRoation().z()) + print "setWorldTrans", WorldTrans shape=bullet.btCapsuleShape(10, 20) -motionState=OgreMotionState(bullet.btTransform()) +print "Creating motionState" +motionState=OgreMotionState(bullet.btTransform(bullet.btMatrix3x3(1.0,1.0,1.0,-1.0,-1.0,-1.0,2,-2,-1))) Object=bullet.btRigidBody(10.0, motionState, shape) # ...this should work in my eyes + #Object=bullet.btRigidBody(bullet.btRigidBodyConstructionInfo()) ...well obviously not in bullet 2.6.9 \ No newline at end of file Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/environment.py 2008-08-31 01:29:13 UTC (rev 713) @@ -452,13 +452,13 @@ version = "3.5" pythonModule = False ModuleName = "" - # AJM Changed so stable is 1.35 as this seems fine.... + if _STABLE: - base = 'boost_1_34_1' - lib= 'boost_python-vc90-mt-1_34_1' + base = 'boost_1_36_0' + lib= 'boost_python-vc90-mt-1_36' else: - base = 'boost_1_35_0' - lib = 'boost_python-vc90-mt-1_36' + base = 'boost_1_37' + lib = 'boost_python-vc90-mt-1_37' if isLinux() or isMac(): bjambase = 'boost-jam-3.1.16' @@ -506,7 +506,7 @@ [0,'sed -i s/"BOOST_PYTHON_MAX_ARITY 15"/"BOOST_PYTHON_MAX_ARITY 19"/ '+base+'/boost/python/detail/preprocessor.hpp', ''], [0,'sed -i s/"# include <boost\/preprocessor\/cat.hpp>"/"\\n#define BOOST_PYTHON_NO_PY_SIGNATURES\\n# include <boost\/preprocessor\/cat.hpp>"/ '+base+'/boost/python/detail/preprocessor.hpp', '' ], [0,'sed -i s/BJAM_CONFIG=\"\"/BJAM_CONFIG=release/ '+base+'/boost/python/detail/preprocessor.hpp', '' ], - [0,os.path.join(os.getcwd(), bjambase, "bjam.exe") + ' release --with-python --toolset=msvc-8',os.path.join(os.getcwd(),base)] + [0,os.path.join(os.getcwd(), bjambase, "bjam.exe") + ' release --with-python ',os.path.join(os.getcwd(),base)] # --toolset=msvc-8 ] if not isWindows(): # Figure out the gcc version we are running - this is needed by Boost @@ -547,7 +547,7 @@ active = True pythonModule = True if _STABLE: - version="1.4" + version="1.6" else: version = "1.7" name='ogre' @@ -562,16 +562,29 @@ if isWindows(): - source = [ - [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC8SP1_Eihort_20071227.zip";, downloadPath], - [ wget, "http://downloads.sourceforge.net/ogre/ogre-win32-v1-4-9.zip";, downloadPath], - ] - buildCmds = [ - [0, unzip + os.path.join(downloadPath,"ogre-win32-v1-4-9.zip"),os.getcwd() ], - [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC8SP1_Eihort_20071227.zip"), - os.path.join(os.getcwd(), 'ogrenew') ], - [0, "patch -s -N -i ./python-ogre/patch/ogre.patch -p0 ", os.getcwd()] - ] + if _STABLE: + source = [ + [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip";, downloadPath], + [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0RC1.zip";, downloadPath], + ] + buildCmds = [ + [0, unzip + os.path.join(downloadPath,"ogre-v1-6-0RC1.zip"),os.getcwd() ], + [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), + os.path.join(os.getcwd(), 'ogre') ], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], + [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] + ] + else: + source = [ + [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip";, downloadPath], + [ svn, "https://svn.ogre3d.org/svnroot/ogre/branches/v1-6";, os.path.join(os.getcwd(), 'ogre')] + ] + buildCmds = [ + [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), + os.path.join(os.getcwd(), 'ogre') ], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], + [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] + ] # requirements to build a precompiled header on the fly if _PreCompiled: @@ -591,7 +604,7 @@ ] CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 ' LINKFLAGS = '' - externalFiles=['OgreMain.dll', 'OgreGuiRender.dll', Config.LIB_Boost+'.dll'] + externalFiles=['OgreMain.dll', 'OgreGuiRender.dll', boost.lib+'.dll'] elif isLinux(): version = "1.4" #### UGLY OVERRIDE AT MOMENT... libs=[boost.lib, 'OgreMain' ] #, 'OgreGUIRenderer', 'CEGUIBase'] @@ -1351,7 +1364,7 @@ class ogrevideoffmpeg: - active = True + active = False pythonModule = True version="0.2.1" name='ogrevideoffmpeg' @@ -1378,7 +1391,7 @@ ModuleName="ogrevideoffmpeg" class ogredshow: - active = True + active = False pythonModule = True version="0.1" name='ogredshow' @@ -1646,7 +1659,26 @@ CheckIncludes=[] libs=[ boost.lib, 'OgreMain' ] ModuleName="hydrax" - + +class hikari: + active = True + pythonModule = True + version="0.22" + name='hikari' + parent="ogre/gui" + cflags = "" + include_dirs = [ Config.PATH_Boost, + Config.PATH_INCLUDE_hikari + , Config.PATH_INCLUDE_Ogre + ] + lib_dirs = [Config.PATH_LIB_Boost, + Config.PATH_LIB_Ogre_OgreMain, + Config.PATH_LIB_hikari + ] + CheckIncludes=[] + libs=[ boost.lib, 'OgreMain', 'hikari' ] + ModuleName="hikari" + ############################################################################################ ## Here is the master list.... @@ -1684,9 +1716,10 @@ , 'ofusion' : ofusion , 'particleuniverse' : particleuniverse , 'cadunetree' : cadunetree - ,'opensteer' : opensteer - ,'ogrepcz' : ogrepcz + , 'opensteer' : opensteer + , 'ogrepcz' : ogrepcz , 'hydrax' : hydrax + , 'hikari' : hikari } # Added: trunk/python-ogre/packages_2.5/ogre/gui/hikari/__init__.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/gui/hikari/__init__.py (rev 0) +++ trunk/python-ogre/packages_2.5/ogre/gui/hikari/__init__.py 2008-08-31 01:29:13 UTC (rev 713) @@ -0,0 +1 @@ +from _hikari_ import * Modified: trunk/python-ogre/patch/ogre_1.6.patch =================================================================== --- trunk/python-ogre/patch/ogre_1.6.patch 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/patch/ogre_1.6.patch 2008-08-31 01:29:13 UTC (rev 713) @@ -3,234 +3,234 @@ --- OgreMain/include/OgreMovableObject.h (revision 7873) +++ OgreMain/include/OgreMovableObject.h (working copy) @@ -482,7 +482,7 @@ - included too. - */ - virtual void visitRenderables(Renderable::Visitor* visitor, -- bool debugRenderables = false) = 0; -+ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } - - /** Sets whether or not the debug display of this object is enabled. - @remarks + included too. + */ + virtual void visitRenderables(Renderable::Visitor* visitor, +- bool debugRenderables = false) = 0; ++ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } + + /** Sets whether or not the debug display of this object is enabled. + @remarks Index: OgreMain/include/OgreRenderQueueListener.h =================================================================== --- OgreMain/include/OgreRenderQueueListener.h (revision 7873) +++ OgreMain/include/OgreRenderQueueListener.h (working copy) @@ -31,7 +31,9 @@ - - #include "OgrePrerequisites.h" - #include "OgreRenderQueue.h" -+#include <stdexcept> - -+ - namespace Ogre { - - /** Abstract interface which classes must implement if they wish to receive -@@ -64,8 +66,8 @@ - rendered. Note that in this case the renderQueueEnded event will not be raised - for this queue group. - */ -- virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, -- bool& skipThisInvocation) = 0; -+ virtual bool renderQueueStarted(uint8 queueGroupId, const String& invocation, -+ bool skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } - - /** Event raised after a queue group is rendered. - @remarks + + #include "OgrePrerequisites.h" + #include "OgreRenderQueue.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract interface which classes must implement if they wish to receive +@@ -66,8 +68,8 @@ + rendered. Note that in this case the renderQueueEnded event will not be raised + for this queue group. + */ +- virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, +- bool& skipThisInvocation) = 0; ++ virtual bool renderQueueStarted(uint8 queueGroupId, const String& invocation, ++ bool skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } + + /** Event raised after a queue group is rendered. + @remarks @@ -79,8 +81,8 @@ - rendered will be repeated, and the renderQueueStarted and renderQueueEnded - events will also be fired for it again. - */ -- virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, -- bool& repeatThisInvocation) = 0; -+ virtual bool renderQueueEnded(uint8 queueGroupId, const String& invocation, -+ bool repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } - }; - - } + rendered will be repeated, and the renderQueueStarted and renderQueueEnded + events will also be fired for it again. + */ +- virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, +- bool& repeatThisInvocation) = 0; ++ virtual bool renderQueueEnded(uint8 queueGroupId, const String& invocation, ++ bool repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } + }; + + } Index: OgreMain/include/OgreResourceGroupManager.h =================================================================== --- OgreMain/include/OgreResourceGroupManager.h (revision 7873) +++ OgreMain/include/OgreResourceGroupManager.h (working copy) @@ -37,6 +37,7 @@ - #include "OgreArchive.h" - #include "OgreIteratorWrappers.h" - #include <ctime> -+#include <stdexcept> - - namespace Ogre { - + #include "OgreArchive.h" + #include "OgreIteratorWrappers.h" + #include <ctime> ++#include <stdexcept> + + namespace Ogre { + @@ -92,7 +93,7 @@ - parsed. Note that in this case the scriptParseEnded event will not be raised - for this script. - */ -- virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0; -+ virtual bool scriptParseStarted(const String& scriptName, bool skipThisScript) { throw std::runtime_error ( std::string ("Virtual function ResourceGroupListener::scriptParseStarted called!") ); } - - /** This event is fired when the script has been fully parsed. - */ + parsed. Note that in this case the scriptParseEnded event will not be raised + for this script. + */ +- virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0; ++ virtual bool scriptParseStarted(const String& scriptName, bool skipThisScript) { throw std::runtime_error ( std::string ("Virtual function ResourceGroupListener::scriptParseStarted called!") ); } + + /** This event is fired when the script has been fully parsed. + */ @@ -350,7 +351,7 @@ - /// Internal event firing method - void fireResourceGroupScriptingStarted(const String& groupName, size_t scriptCount); - /// Internal event firing method -- void fireScriptStarted(const String& scriptName, bool &skipScript); -+ bool fireScriptStarted(const String& scriptName, bool skipScript); - /// Internal event firing method - void fireScriptEnded(const String& scriptName, bool skipped); - /// Internal event firing method + /// Internal event firing method + void fireResourceGroupScriptingStarted(const String& groupName, size_t scriptCount); + /// Internal event firing method +- void fireScriptStarted(const String& scriptName, bool &skipScript); ++ bool fireScriptStarted(const String& scriptName, bool skipScript); + /// Internal event firing method + void fireScriptEnded(const String& scriptName, bool skipped); + /// Internal event firing method Index: OgreMain/include/OgreDataStream.h =================================================================== --- OgreMain/include/OgreDataStream.h (revision 7873) +++ OgreMain/include/OgreDataStream.h (working copy) @@ -33,6 +33,7 @@ - #include "OgreString.h" - #include "OgreSharedPtr.h" - #include <istream> -+#include <stdexcept> - - namespace Ogre { - + #include "OgreString.h" + #include "OgreSharedPtr.h" + #include <istream> ++#include <stdexcept> + + namespace Ogre { + @@ -79,7 +80,7 @@ - @param count Number of bytes to read - @returns The number of bytes read - */ -- virtual size_t read(void* buf, size_t count) = 0; -+ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } - /** Get a single line from the stream. - @remarks - The delimiter character is not included in the data + @param count Number of bytes to read + @returns The number of bytes read + */ +- virtual size_t read(void* buf, size_t count) = 0; ++ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } + /** Get a single line from the stream. + @remarks + The delimiter character is not included in the data Index: OgreMain/include/OgreHardwareBuffer.h =================================================================== --- OgreMain/include/OgreHardwareBuffer.h (revision 7873) +++ OgreMain/include/OgreHardwareBuffer.h (working copy) @@ -31,7 +31,9 @@ - - // Precompiler options - #include "OgrePrerequisites.h" -+#include <stdexcept> - -+ - namespace Ogre { - - /** Abstract class defining common features of hardware buffers. + + // Precompiler options + #include "OgrePrerequisites.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract class defining common features of hardware buffers. @@ -244,7 +246,7 @@ - @param pDest The area of memory in which to place the data, must be large enough to - accommodate the data! - */ -- virtual void readData(size_t offset, size_t length, void* pDest) = 0; -+ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } - /** Writes data to the buffer from an area of system memory; note that you must - ensure that your buffer is big enough. - @param offset The byte offset from the start of the buffer to start writing + @param pDest The area of memory in which to place the data, must be large enough to + accommodate the data! + */ +- virtual void readData(size_t offset, size_t length, void* pDest) = 0; ++ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } + /** Writes data to the buffer from an area of system memory; note that you must + ensure that your buffer is big enough. + @param offset The byte offset from the start of the buffer to start writing @@ -254,7 +256,7 @@ - such that DMA stalls can be avoided; use if you can. - */ - virtual void writeData(size_t offset, size_t length, const void* pSource, -- bool discardWholeBuffer = false) = 0; -+ bool discardWholeBuffer = false) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::writeData called!") ); } - - /** Copy data from another buffer into this one. - @remarks + such that DMA stalls can be avoided; use if you can. + */ + virtual void writeData(size_t offset, size_t length, const void* pSource, +- bool discardWholeBuffer = false) = 0; ++ bool discardWholeBuffer = false) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::writeData called!") ); } + + /** Copy data from another buffer into this one. + @remarks Index: OgreMain/include/OgreCompositorChain.h =================================================================== --- OgreMain/include/OgreCompositorChain.h (revision 7873) +++ OgreMain/include/OgreCompositorChain.h (working copy) @@ -174,10 +174,10 @@ - public: - /** @copydoc RenderQueueListener::renderQueueStarted - */ -- virtual void renderQueueStarted(uint8 id, const String& invocation, bool& skipThisQueue); -+ virtual bool renderQueueStarted(uint8 id, const String& invocation, bool skipThisQueue); - /** @copydoc RenderQueueListener::renderQueueEnded - */ -- virtual void renderQueueEnded(uint8 id, const String& invocation, bool& repeatThisQueue); -+ virtual bool renderQueueEnded(uint8 id, const String& invocation, bool repeatThisQueue); - - /** Set current operation and target */ - void setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs); + public: + /** @copydoc RenderQueueListener::renderQueueStarted + */ +- virtual void renderQueueStarted(uint8 id, const String& invocation, bool& skipThisQueue); ++ virtual bool renderQueueStarted(uint8 id, const String& invocation, bool skipThisQueue); + /** @copydoc RenderQueueListener::renderQueueEnded + */ +- virtual void renderQueueEnded(uint8 id, const String& invocation, bool& repeatThisQueue); ++ virtual bool renderQueueEnded(uint8 id, const String& invocation, bool repeatThisQueue); + + /** Set current operation and target */ + void setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs); Index: OgreMain/src/OgreResourceGroupManager.cpp =================================================================== --- OgreMain/src/OgreResourceGroupManager.cpp (revision 7873) +++ OgreMain/src/OgreResourceGroupManager.cpp (working copy) @@ -929,7 +929,7 @@ - for (FileInfoList::iterator fii = (*flli)->begin(); fii != (*flli)->end(); ++fii) - { - bool skipScript = false; -- fireScriptStarted(fii->filename, skipScript); -+ skipScript = fireScriptStarted(fii->filename, skipScript); - if(skipScript) - { - LogManager::getSingleton().logMessage( + for (FileInfoList::iterator fii = (*flli)->begin(); fii != (*flli)->end(); ++fii) + { + bool skipScript = false; +- fireScriptStarted(fii->filename, skipScript); ++ skipScript = fireScriptStarted(fii->filename, skipScript); + if(skipScript) + { + LogManager::getSingleton().logMessage( @@ -1218,17 +1218,18 @@ - } - } - //----------------------------------------------------------------------- -- void ResourceGroupManager::fireScriptStarted(const String& scriptName, bool &skipScript) -+ bool ResourceGroupManager::fireScriptStarted(const String& scriptName, bool skipScript) - { - OGRE_LOCK_AUTO_MUTEX - for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin(); - l != mResourceGroupListenerList.end(); ++l) - { - bool temp = false; -- (*l)->scriptParseStarted(scriptName, temp); -+ temp = (*l)->scriptParseStarted(scriptName, temp); - if(temp) - skipScript = true; - } -+ return skipScript; - } - //----------------------------------------------------------------------- - void ResourceGroupManager::fireScriptEnded(const String& scriptName, bool skipped) + } + } + //----------------------------------------------------------------------- +- void ResourceGroupManager::fireScriptStarted(const String& scriptName, bool &skipScript) ++ bool ResourceGroupManager::fireScriptStarted(const String& scriptName, bool skipScript) + { + OGRE_LOCK_AUTO_MUTEX + for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin(); + l != mResourceGroupListenerList.end(); ++l) + { + bool temp = false; +- (*l)->scriptParseStarted(scriptName, temp); ++ temp = (*l)->scriptParseStarted(scriptName, temp); + if(temp) + skipScript = true; + } ++ return skipScript; + } + //----------------------------------------------------------------------- + void ResourceGroupManager::fireScriptEnded(const String& scriptName, bool skipped) Index: OgreMain/src/OgreCompositorChain.cpp =================================================================== --- OgreMain/src/OgreCompositorChain.cpp (revision 7873) +++ OgreMain/src/OgreCompositorChain.cpp (working copy) @@ -377,8 +377,8 @@ - mViewport = vp; - } - //----------------------------------------------------------------------- --void CompositorChain::RQListener::renderQueueStarted(uint8 id, -- const String& invocation, bool& skipThisQueue) -+bool CompositorChain::RQListener::renderQueueStarted(uint8 id, -+ const String& invocation, bool skipThisQueue) - { - // Skip when not matching viewport - // shadows update is nested within main viewport update + mViewport = vp; + } + //----------------------------------------------------------------------- +-void CompositorChain::RQListener::renderQueueStarted(uint8 id, +- const String& invocation, bool& skipThisQueue) ++bool CompositorChain::RQListener::renderQueueStarted(uint8 id, ++ const String& invocation, bool skipThisQueue) + { + // Skip when not matching viewport + // shadows update is nested within main viewport update @@ -392,11 +392,13 @@ - { - skipThisQueue = true; - } -+ return skipThisQueue; - } - //----------------------------------------------------------------------- --void CompositorChain::RQListener::renderQueueEnded(uint8 id, -- const String& invocation, bool& repeatThisQueue) -+bool CompositorChain::RQListener::renderQueueEnded(uint8 id, -+ const String& invocation, bool repeatThisQueue) - { -+ return repeatThisQueue; - } - //----------------------------------------------------------------------- - void CompositorChain::RQListener::setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs) + { + skipThisQueue = true; + } ++ return skipThisQueue; + } + //----------------------------------------------------------------------- +-void CompositorChain::RQListener::renderQueueEnded(uint8 id, +- const String& invocation, bool& repeatThisQueue) ++bool CompositorChain::RQListener::renderQueueEnded(uint8 id, ++ const String& invocation, bool repeatThisQueue) + { ++ return repeatThisQueue; + } + //----------------------------------------------------------------------- + void CompositorChain::RQListener::setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs) Index: OgreMain/src/OgreSceneManager.cpp =================================================================== --- OgreMain/src/OgreSceneManager.cpp (revision 7873) +++ OgreMain/src/OgreSceneManager.cpp (working copy) @@ -3651,7 +3651,7 @@ - iend = mRenderQueueListeners.end(); - for (i = mRenderQueueListeners.begin(); i != iend; ++i) - { -- (*i)->renderQueueStarted(id, invocation, skip); -+ skip = (*i)->renderQueueStarted(id, invocation, skip); - } - return skip; - } + iend = mRenderQueueListeners.end(); + for (i = mRenderQueueListeners.begin(); i != iend; ++i) + { +- (*i)->renderQueueStarted(id, invocation, skip); ++ skip = (*i)->renderQueueStarted(id, invocation, skip); + } + return skip; + } @@ -3664,7 +3664,7 @@ - iend = mRenderQueueListeners.end(); - for (i = mRenderQueueListeners.begin(); i != iend; ++i) - { -- (*i)->renderQueueEnded(id, invocation, repeat); -+ repeat = (*i)->renderQueueEnded(id, invocation, repeat); - } - return repeat; - } + iend = mRenderQueueListeners.end(); + for (i = mRenderQueueListeners.begin(); i != iend; ++i) + { +- (*i)->renderQueueEnded(id, invocation, repeat); ++ repeat = (*i)->renderQueueEnded(id, invocation, repeat); + } + return repeat; + } Modified: trunk/python-ogre/scripts/compilesource.bat =================================================================== --- trunk/python-ogre/scripts/compilesource.bat 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/scripts/compilesource.bat 2008-08-31 01:29:13 UTC (rev 713) @@ -10,7 +10,7 @@ rem %_VCBUILD% /useenv NxOgre.VC8.Windows.sln "Release|Win32" cd %_ROOT%\\ogreaddons\\ogreode\\scripts\\vc8 -%_VCBUILD% /useenv OgreOde_CVS.sln "Release|Win32" +%_VCBUILD% /useenv OgreOde_Source.sln "Release|Win32" cd %_ROOT%\\ogreaddons\\ogrenewt %_VCBUILD% /useenv OgreNewt.sln "Release|Win32" Modified: trunk/python-ogre/setup.py =================================================================== --- trunk/python-ogre/setup.py 2008-08-31 01:25:05 UTC (rev 712) +++ trunk/python-ogre/setup.py 2008-08-31 01:29:13 UTC (rev 713) @@ -67,12 +67,13 @@ 'ogre.physics.bullet','ogre.physics.PhysX','ogre.physics.NxOgre', 'ogre.physics.OgreBulletC', 'ogre.physics.OgreBulletD', 'ogre.addons','ogre.addons.theora', - 'ogre.addons.ogrevideoffmpeg', 'ogre.addons.ogredshow', - 'ogre.addons.plib','ogre.gui.navi', + # 'ogre.addons.ogrevideoffmpeg', 'ogre.addons.ogredshow', + 'ogre.addons.plib', # 'ogre.gui.navi', 'ogre.addons.ogreforests', 'ogre.addons.et', 'ogre.addons.caelum', - 'ogre.addons.noise', 'ogre.addons.watermesh', 'ogre.addons.ofusion', + 'ogre.addons.noise', 'ogre.addons.watermesh', # 'ogre.addons.ofusion', 'ogre.addons.particleuniverse', 'ogre.addons.cadunetree', - 'ogre.renderer.ogrepcz', 'ogre.addons.hydrax' ], + 'ogre.renderer.ogrepcz', 'ogre.addons.hydrax', + 'ogre.gui.hikari' ], "package_dir": {'': 'packages_'+ PythonVersionString }, "package_data": {'': ['*.pyd', '*.dll', '*.so']} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mithro@us...> - 2008-09-01 11:45:47
|
Revision: 715 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=715&view=rev Author: mithro Date: 2008-09-01 11:45:49 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Add support for Ogre 1.6RC1 in Linux. Fixed CEGUI pointing to version 0.6.0. Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/environment.py Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-09-01 06:06:29 UTC (rev 714) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-09-01 11:45:49 UTC (rev 715) @@ -39,7 +39,7 @@ PATH_THIRDPARTY = os.path.join(module_dir, 'ThirdParty' ) PATH_Ogre = os.path.join(BASE_DIR,'ogre') PATH_OgreAddons = os.path.join(BASE_DIR, 'ogreaddons') -PATH_CEGUI = os.path.join(BASE_DIR, 'CEGUI-0.6.0' ) +PATH_CEGUI = os.path.join(BASE_DIR, 'CEGUI-0.6.1' ) PATH_OIS = os.path.join(BASE_DIR, 'ois-1.0RC1') if SDK: Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-09-01 06:06:29 UTC (rev 714) +++ trunk/python-ogre/environment.py 2008-09-01 11:45:49 UTC (rev 715) @@ -546,10 +546,6 @@ class ogre: active = True pythonModule = True - if _STABLE: - version="1.6" - else: - version = "1.7" name='ogre' ModuleName='OGRE' cflags = "" @@ -563,6 +559,7 @@ if isWindows(): if _STABLE: + version="1.6" source = [ [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip";, downloadPath], [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0RC1.zip";, downloadPath], @@ -574,7 +571,9 @@ [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] ] - else: + else: + + version="1.7" source = [ [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip";, downloadPath], [ svn, "https://svn.ogre3d.org/svnroot/ogre/branches/v1-6";, os.path.join(os.getcwd(), 'ogre')] @@ -591,8 +590,8 @@ pchstop = 'python_ogre_precompiled.h' pchbuild = 'buildpch.cpp' pchincludes = ['python_ogre_precompiled.h'] -# - libs=[boost.lib, 'OgreMain' ] #, 'OgreGUIRenderer', 'CEGUIBase'] + + libs=[boost.lib, 'OgreMain'] lib_dirs = [ Config.PATH_LIB_Boost , Config.PATH_LIB_Ogre_CEGUIRenderer , Config.PATH_LIB_Ogre_OgreMain @@ -606,33 +605,33 @@ LINKFLAGS = '' externalFiles=['OgreMain.dll', 'OgreGuiRender.dll', boost.lib+'.dll'] elif isLinux(): - version = "1.4" #### UGLY OVERRIDE AT MOMENT... - libs=[boost.lib, 'OgreMain' ] #, 'OgreGUIRenderer', 'CEGUIBase'] - base = "ogre-v1-4-9" + if _STABLE: + version = "1.4" + base = "ogre-v1-4-9" + else: + version = "1.6" + base = "ogre-v1-6-0RC1" + + libs=[boost.lib, boost_python_index.lib, 'OgreMain'] + lib_dirs=[Config.LOCAL_LIB] + include_dirs=[Config.PATH_Boost, Config.PATH_INCLUDE_Ogre] + CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19' + source = [ [wget, "http://downloads.sourceforge.net/ogre/"+base+".tar.bz2",downloadPath], ] buildCmds = [ - # [0, "env >1", ''], - [0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ], - [0, "patch -s -N -i ./python-ogre/patch/ogre.patch -p0 ", os.getcwd()], - [0, "aclocal", os.path.join(os.getcwd(), 'ogre')], - [0, "./bootstrap", os.path.join(os.getcwd(), 'ogre')], - #[1, "import os\nos.environ['ZZIPLIB_LIBS']='-lzzip'", ''], - [0, "./configure --prefix=%s --with-gui=Xt --disable-devil" % PREFIX, os.path.join(os.getcwd(), 'ogre')], - #export ZZIPLIB_LIBS="-lzzip" - [0, "make", os.path.join(os.getcwd(), 'ogre')], - [0, "make install", os.path.join(os.getcwd(), 'ogre')], - ] - - libs=[boost.lib, boost_python_index.lib, 'OgreMain' ] #, 'OgreGUIRenderer', 'CEGUIBase'] - lib_dirs = [ Config.LOCAL_LIB - ] - include_dirs = [ Config.PATH_Boost - , Config.PATH_INCLUDE_Ogre - ] - CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19' + [0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ], + [0, "patch -s -N -i ./python-ogre/patch/ogre.patch -p0 ", os.getcwd()], + [0, "aclocal", os.path.join(os.getcwd(), 'ogre')], + [0, "./bootstrap", os.path.join(os.getcwd(), 'ogre')], + [0, "./configure --prefix=%s --with-gui=Xt --disable-devil" % PREFIX, os.path.join(os.getcwd(), 'ogre')], + [0, "make", os.path.join(os.getcwd(), 'ogre')], + [0, "make install", os.path.join(os.getcwd(), 'ogre')], + ] + elif isMac(): + version = "1.4" base = "ogre-linux_osx-v1-4-9" basedep = "OgreDependenciesOSX_20070929" source = [ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |