[Python-ogre-commit] SF.net SVN: python-ogre: [480] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
|
From: <and...@us...> - 2007-11-14 05:48:11
|
Revision: 480
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=480&view=rev
Author: andy_miller
Date: 2007-11-13 21:48:13 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
Added watermesh and ofusion
Modified Paths:
--------------
trunk/python-ogre/PythonOgreConfig_nt.py
trunk/python-ogre/PythonOgreInstallCreator.iss
trunk/python-ogre/code_generators/cleanIncrementalbuild.bat
trunk/python-ogre/code_generators/common_utils/__init__.py
trunk/python-ogre/docs/Python-Ogre.chm
Added Paths:
-----------
trunk/python-ogre/PythonOgreInstallCreator.nsi
trunk/python-ogre/ThirdParty/ofusion/
trunk/python-ogre/ThirdParty/ofusion/IOSMSceneCallbacks.h
trunk/python-ogre/ThirdParty/ofusion/OSMAnimSerializer.h
trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.cpp
trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.h
trunk/python-ogre/ThirdParty/ofusion/tinystr.cpp
trunk/python-ogre/ThirdParty/ofusion/tinystr.h
trunk/python-ogre/ThirdParty/ofusion/tinyxml.cpp
trunk/python-ogre/ThirdParty/ofusion/tinyxml.h
trunk/python-ogre/ThirdParty/ofusion/tinyxmlerror.cpp
trunk/python-ogre/ThirdParty/ofusion/tinyxmlparser.cpp
trunk/python-ogre/ThirdParty/watermesh/
trunk/python-ogre/ThirdParty/watermesh/WaterMesh.cpp
trunk/python-ogre/ThirdParty/watermesh/WaterMesh.h
trunk/python-ogre/code_generators/bullet/generate_code_1.py
trunk/python-ogre/code_generators/ofusion/
trunk/python-ogre/code_generators/ofusion/customization_data.py
trunk/python-ogre/code_generators/ofusion/generate_code.py
trunk/python-ogre/code_generators/ofusion/hand_made_wrappers.py
trunk/python-ogre/code_generators/ofusion/python_ofusion.h
trunk/python-ogre/code_generators/ofusion/python_ofusion_aliases.h
trunk/python-ogre/code_generators/ofusion/python_ofusion_sizeof.h
trunk/python-ogre/code_generators/ogrevideoffmpeg/SConstruct
trunk/python-ogre/code_generators/watermesh/
trunk/python-ogre/code_generators/watermesh/customization_data.py
trunk/python-ogre/code_generators/watermesh/generate_code.py
trunk/python-ogre/code_generators/watermesh/hand_made_wrappers.py
trunk/python-ogre/code_generators/watermesh/python_watermesh.h
trunk/python-ogre/code_generators/watermesh/python_watermesh_aliases.h
trunk/python-ogre/code_generators/watermesh/python_watermesh_sizeof.h
trunk/python-ogre/config.ini
trunk/python-ogre/convertonew.sed
trunk/python-ogre/makehelp.bat
trunk/python-ogre/ogre_cvs.sh
trunk/python-ogre/setup.py.dist
trunk/python-ogre/test.nsi
trunk/python-ogre/test.py
Modified: trunk/python-ogre/PythonOgreConfig_nt.py
===================================================================
--- trunk/python-ogre/PythonOgreConfig_nt.py 2007-11-14 03:30:52 UTC (rev 479)
+++ trunk/python-ogre/PythonOgreConfig_nt.py 2007-11-14 05:48:13 UTC (rev 480)
@@ -55,7 +55,7 @@
PATH_ogrevideoffmpeg = os.path.join(PATH_THIRDPARTY,'ffmpeg')
-PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.62')
+PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.64')
PATH_PhysX= "c:/program files/AGEIA Technologies/SDK/v2.7.2/SDKs"
PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo')
PATH_ffmpeg= os.path.join(BASE_DIR, 'ffmpeg')
@@ -148,7 +148,7 @@
PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include')
,os.path.join(BASE_DIR, 'vorbis', 'include')
,os.path.join(PATH_OgreAddons,'videoplugin','theora','include')
- ,os.path.join(PATH_OgreAddons,'videoplugin','ptypes-1.8.3','include')
+ ,os.path.join(PATH_OgreAddons,'videoplugin','ptypes-2.1.1','include')
]
PATH_INCLUDE_PhysX= [ os.path.join(PATH_PhysX, 'Physics','include')
Modified: trunk/python-ogre/PythonOgreInstallCreator.iss
===================================================================
--- trunk/python-ogre/PythonOgreInstallCreator.iss 2007-11-14 03:30:52 UTC (rev 479)
+++ trunk/python-ogre/PythonOgreInstallCreator.iss 2007-11-14 05:48:13 UTC (rev 480)
@@ -40,7 +40,10 @@
; the python modules - in the event we find python
Source: packages_2.5\*; DestDir: {code:GetPythonSiteDir}; Flags: recursesubdirs; Check: SelectedPython('2.5')
; the python modules again - if we don't find python we install both versions in the app directory
-Source: packages_2.5\*; DestDir: {app}\packages_2.5; Flags: recursesubdirs; Check: NoPythonFound
+;Source: packages_2.5\*; DestDir: {app}\packages_2.5; Flags: recursesubdirs; Check: NoPythonFound
+
+; I'm going to install here anyway to make updates easier...
+Source: packages_2.5\*; DestDir: {app}\packages_2.5; Flags: recursesubdirs
;
; we need to remove the .pyc files when we uninstall
;
@@ -196,11 +199,11 @@
Name: {group}\Ogre Demos\Transparency; Filename: {code:GetPythonExe}; Parameters: Demo_Transparency.py; WorkingDir: {app}\Demos\Ogre
Name: {group}\Ogre Demos\WX Gui; Filename: {code:GetPythonExe}; Parameters: Demo_WX.py; WorkingDir: {app}\Demos\Ogre
-Name: {group}\GUI\CEGUI - Basic; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_Gui.py; WorkingDir: {app}\Demos\gui
-Name: {group}\GUI\CEGUI Drag and Drop; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_DragnDrop.py; WorkingDir: {app}\Demos\gui
-Name: {group}\GUI\CEGUI - Nice; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_NewGui.py; WorkingDir: {app}\Demos\gui
-Name: {group}\GUI\QuickGUI-01; Filename: {code:GetPythonExe}; Parameters: Demo_QuickGUI01.py; WorkingDir: {app}\Demos\gui
-Name: {group}\GUI\Navi; Filename: {code:GetPythonExe}; Parameters: Demo_Navi.py; WorkingDir: {app}\Demos\gui
+Name: {group}\GUI\CEGUI - Basic; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_Gui.py; WorkingDir: {app}\Demos\cegui
+Name: {group}\GUI\CEGUI Drag and Drop; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_DragnDrop.py; WorkingDir: {app}\Demos\cegui
+Name: {group}\GUI\CEGUI - Nice; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_NewGui.py; WorkingDir: {app}\Demos\cegui
+Name: {group}\GUI\QuickGUI-01; Filename: {code:GetPythonExe}; Parameters: Demo_QuickGUI01.py; WorkingDir: {app}\Demos\qgui
+Name: {group}\GUI\Navi; Filename: {code:GetPythonExe}; Parameters: Demo_Navi.py; WorkingDir: {app}\Demos\navi
Name: {group}\ODE Demos\Multiple Scenes; Filename: {code:GetPythonExe}; Parameters: Demo_Scenes.py; WorkingDir: {app}\Demos\OgreOde
Name: {group}\ODE Demos\Gran Turism; Filename: {code:GetPythonExe}; Parameters: GranTurismOgre.py; WorkingDir: {app}\Demos\OgreOde
@@ -228,9 +231,10 @@
Name: {group}\Plib Demos\Networking - Server; Filename: {code:GetPythonExe}; Parameters: Demo_Server.py; WorkingDir: {app}\Demos\plib
Name: {group}\Plib Demos\Networking - Client; Filename: {code:GetPythonExe}; Parameters: Demo_Client.py; WorkingDir: {app}\Demos\plib
-Name: {group}\Plib Demos\Sound; Filename: {code:GetPythonExe}; Parameters: Demo_Sound.py; WorkingDir: {app}\Demos\plib
+;Name: {group}\Plib Demos\Sound; Filename: {code:GetPythonExe}; Parameters: Demo_Sound.py; WorkingDir: {app}\Demos\plib
-Name: {group}\OgreForests Demos\ogreoforests; Filename: {code:GetPythonExe}; Parameters: Demo_Forests.py; WorkingDir: {app}\Demos\ogreforests
+Name: {group}\OgreForests Demos\ogreforests; Filename: {code:GetPythonExe}; Parameters: Demo_Forest.py; WorkingDir: {app}\Demos\ogreforests
+Name: {group}\Editable Terrain Demo\Editable Terrain; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_ET.py; WorkingDir: {app}\Demos\et
Name: {group}\Uninstall Python-Ogre; Filename: {uninstallexe}
Name: {group}\Python-Ogre API Documenatation; Filename: {app}\docs\Python-Ogre.chm
@@ -449,7 +453,8 @@
DisplayedPythonWarning := False;
PythonVersion := '';
- SupportedVersions := ['2.4', '2.5'];
+ SupportedVersions := [ '2.5'];
+
Debug := False;
NumPythonVersions := GetInstalledPythonVersions();
Added: trunk/python-ogre/PythonOgreInstallCreator.nsi
===================================================================
--- trunk/python-ogre/PythonOgreInstallCreator.nsi (rev 0)
+++ trunk/python-ogre/PythonOgreInstallCreator.nsi 2007-11-14 05:48:13 UTC (rev 480)
@@ -0,0 +1,323 @@
+; Script generated by the ISS2NSI program.
+; Generated from: C:\Development\pywork\PythonOgreInstallCreator.iss
+
+!cd "C:\Development\PythonOgreRelease\"
+
+; MUI 1.66 compatible
+!include "MUI.nsh"
+
+!define MUI_ABORTWARNING
+!define MUI_SPECIALBITMAP "compiler:WizModernImage-IS.bmp"
+!insertmacro MUI_PAGE_WELCOME
+!define MUI_LICENSEPAGE_RADIOBUTTONS
+!insertmacro MUI_PAGE_LICENSE "LICENSE.GPL"
+!define MUI_PAGE_HEADER_TEXT "Information"
+!define MUI_PAGE_HEADER_SUBTEXT "Please read the following important information before continuing."
+!define MUI_LICENSEPAGE_TEXT_TOP "When you are ready to continue with Setup, click Next."
+!define MUI_LICENSEPAGE_TEXT "' ' '&Next'"
+!insertmacro MUI_PAGE_LICENSE "InstallWarning.rtf"
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Python-Ogre"
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\%sPython-Ogre"
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
+!insertmacro MUI_PAGE_STARTMENU
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!define MUI_PAGE_HEADER_TEXT "Information"
+!define MUI_PAGE_HEADER_SUBTEXT "Please read the following important information before continuing."
+!define MUI_LICENSEPAGE_TEXT_TOP "When you are ready to continue with Setup, click Next."
+!define MUI_LICENSEPAGE_TEXT "' ' '&Next'"
+!insertmacro MUI_PAGE_LICENSE "postinstall.rtf"
+!insertmacro MUI_PAGE_FINISH
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_LANGUAGE "English"
+
+Name "Python-Ogre 1.0.2.3"
+BrandingText "LPGL"
+OutFile "C:\temp\PythonOgreInstaller.exe"
+InstallDir "C:\PythonOgre"
+ShowInstDetails show
+ShowUnInstDetails show
+
+Function .onInit
+ MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
+ Abort
+FunctionEnd
+
+Section -InstallDelete
+ Delete "{code:GetPythonSiteDir}\Ogre\*.pyd"
+ Delete "{code:GetPythonSiteDir}\OIS\*.pyd"
+ Delete "{code:GetPythonSiteDir}\GUI\*.pyd"
+ Delete "{code:GetPythonSiteDir}\OgreOde\*.pyd"
+ Delete "{code:GetPythonSiteDir}\OgreNewt\*.pyd"
+ Delete "{code:GetPythonSiteDir}\OgreAL\*.pyd"
+ Delete "{code:GetPythonSiteDir}\OgreRefApp\*.pyd"
+ Delete "{code:GetPythonSiteDir}\ODE\*.pyd"
+ Delete "{code:GetPythonSiteDir}\FMOD\*.pyd"
+ Delete "{code:GetPythonSiteDir}\Ogre\*.dll"
+ Delete "{code:GetPythonSiteDir}\OIS\*.dll"
+ Delete "{code:GetPythonSiteDir}\GUI\*.dll"
+ Delete "{code:GetPythonSiteDir}\OgreOde\*.dll"
+ Delete "{code:GetPythonSiteDir}\OgreNewt\*.dll"
+ Delete "{code:GetPythonSiteDir}\OgreAL\*.dll"
+ Delete "{code:GetPythonSiteDir}\OgreRefApp\*.dll"
+ Delete "{code:GetPythonSiteDir}\ODE\*.dll"
+ Delete "{code:GetPythonSiteDir}\FMOD\*.dll"
+ Delete "{code:GetPythonSiteDir}\Ogre\_*.p*"
+ Delete "{code:GetPythonSiteDir}\OIS\_*.p*"
+ Delete "{code:GetPythonSiteDir}\GUI\_*.p*"
+ Delete "{code:GetPythonSiteDir}\OgreOde\_*.p*"
+ Delete "{code:GetPythonSiteDir}\OgreNewt\_*.p*"
+ Delete "{code:GetPythonSiteDir}\OgreAL\_*.p*"
+ Delete "{code:GetPythonSiteDir}\OgreRefApp\_*.p*"
+ Delete "{code:GetPythonSiteDir}\ODE\_*.p*"
+ Delete "{code:GetPythonSiteDir}\FMOD\_*.p*"
+ Delete "{code:GetPythonSiteDir}\Ogre\sf_*.*"
+ Delete "{code:GetPythonSiteDir}\Ogre"
+ Delete "{code:GetPythonSiteDir}\OIS"
+ Delete "{code:GetPythonSiteDir}\GUI"
+ Delete "{code:GetPythonSiteDir}\OgreOde"
+ Delete "{code:GetPythonSiteDir}\OgreNewt"
+ Delete "{code:GetPythonSiteDir}\OgreAL"
+ Delete "{code:GetPythonSiteDir}\OgreRefApp"
+ Delete "{code:GetPythonSiteDir}\ODE"
+ Delete "{code:GetPythonSiteDir}\FMOD"
+ RMDir "{code:GetPythonSiteDir}\Ogre"
+ RMDir "{code:GetPythonSiteDir}\OIS"
+ RMDir "{code:GetPythonSiteDir}\GUI"
+ RMDir "{code:GetPythonSiteDir}\OgreOde"
+ RMDir "{code:GetPythonSiteDir}\OgreNewt"
+ RMDir "{code:GetPythonSiteDir}\OgreAL"
+ RMDir "{code:GetPythonSiteDir}\OgreRefApp"
+ RMDir "{code:GetPythonSiteDir}\ODE"
+SectionEnd
+
+Section -Files
+ SetOutPath "$INSTDIR"
+ File "*"
+ SetOutPath "$INSTDIR\plugins"
+ File "plugins\*"
+ SetOutPath "$INSTDIR\tools"
+ File "tools\*"
+ SetOutPath "$INSTDIR\demos"
+ File "demos\*"
+ SetOutPath "$INSTDIR\docs"
+ File "docs\*"
+ SetOutPath "{code:GetPythonSiteDir}"
+ File "packages_2.5\*"
+ File "packages_2.4\*"
+ SetOutPath "$INSTDIR\packages_2.5"
+ File "packages_2.5\*"
+ SetOutPath "$INSTDIR\packages_2.4"
+ File "packages_2.4\*"
+ SetOutPath "$INSTDIR\ThirdParty"
+ File "ThirdParty\dxwebsetup.exe"
+ File "ThirdParty\vcredist_x86.exe"
+SectionEnd
+
+Section -Icons
+!insertmacro MUI_STARTMENU_WRITE_BEGIN
+ CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Bezier.lnk" "{code:GetPythonExe}" "Demo_Bezier.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\BSP.lnk" "{code:GetPythonExe}" "Demo_BSP.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\BSP_Collision.lnk" "{code:GetPythonExe}" "Demo_BspCollision.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Camera Tracking.lnk" "{code:GetPythonExe}" "Demo_CameraTracking.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\CEL Shading.lnk" "{code:GetPythonExe}" "Demo_CelShading.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Compositor.lnk" "{code:GetPythonExe}" "Demo_Compositor.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\ENV Map.lnk" "{code:GetPythonExe}" "Demo_EnvMap.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Facial.lnk" "{code:GetPythonExe}" "Demo_Facial.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Fish.lnk" "{code:GetPythonExe}" "Demo_OneFish.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Fresnel.lnk" "{code:GetPythonExe}" "Demo_Fresnel.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Grass.lnk" "{code:GetPythonExe}" "Demo_Grass.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Lighting.lnk" "{code:GetPythonExe}" "Demo_Lighting.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Particles.lnk" "{code:GetPythonExe}" "Demo_ParticleFX.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Render to Texture.lnk" "{code:GetPythonExe}" "Demo_RenderToTexture.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Shadows.lnk" "{code:GetPythonExe}" "Demo_Shadows_Org.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Animation 1.lnk" "{code:GetPythonExe}" "Demo_SkeletalAnimation.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Animation 2.lnk" "{code:GetPythonExe}" "Demo_SkeletonAnimation.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Sky Box.lnk" "{code:GetPythonExe}" "Demo_SkyBox.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Sky Dome.lnk" "{code:GetPythonExe}" "Demo_SkyDome.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Sky Plane.lnk" "{code:GetPythonExe}" "Demo_SkyPlane.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Smoke.lnk" "{code:GetPythonExe}" "Demo_Smoke.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Terrain.lnk" "{code:GetPythonExe}" "Demo_Terrain.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Textures.lnk" "{code:GetPythonExe}" "Demo_TextureFX.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Transparency.lnk" "{code:GetPythonExe}" "Demo_Transparency.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\WX Gui.lnk" "{code:GetPythonExe}" "Demo_WX.py" "" "" "" "" ""
+ CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\CEGUI - Basic.lnk" "{code:GetPythonExe}" "Demo_CEGUI_Gui.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\CEGUI Drag and Drop.lnk" "{code:GetPythonExe}" "Demo_CEGUI_DragnDrop.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\CEGUI - Nice.lnk" "{code:GetPythonExe}" "Demo_CEGUI_NewGui.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\QuickGUI-01.lnk" "{code:GetPythonExe}" "Demo_QuickGUI01.py" "" "" "" "" ""
+ CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\ODE Demos"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\ODE Demos\Multiple Scenes.lnk" "{code:GetPythonExe}" "Demo_Scenes.py" "" "" "" "" ""
+ CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreAL Demos"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreAL Demos\Basic Sound.lnk" "{code:GetPythonExe}" "Demo_RenderToTexture.py" "" "" "" "" ""
+ CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Basics.lnk" "{code:GetPythonExe}" "Demo01_TheBasics.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Joints.lnk" "{code:GetPythonExe}" "Demo02_Joints.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Collision Callbacks.lnk" "{code:GetPythonExe}" "Demo03_CollisionCallbacks.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Ray Casting.lnk" "{code:GetPythonExe}" "Demo04_RayCasting.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Simple Vehicle.lnk" "{code:GetPythonExe}" "Demo05_SimpleVehicle.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Simple Buoyancy.lnk" "{code:GetPythonExe}" "Demo06_SimpleBuoyancy.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Custom Joints.lnk" "{code:GetPythonExe}" "Demo07_CustomJoints.py" "" "" "" "" ""
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Ragdoll.lnk" "{code:GetPythonExe}" "Demo08_ragdoll.py" "" "" "" "" ""
+ CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall Python-Ogre.lnk" "$INSTDIR\uninstall.exe"
+ CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Python-Ogre API Documenatation.lnk" "$INSTDIR\docs\Python-Ogre.chm"
+!insertmacro MUI_STARTMENU_WRITE_END
+SectionEnd
+
+Section -PostInstall
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "DisplayName" "PythonOgre"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "UninstallString" "$INSTDIR\uninstall.exe"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "Publisher" "OpenSource"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "URLInfoAbout" "http://www.python-ogre.org"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "HelpLink" "http://www.python-ogre.org"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "URLUpdateInfo" "http://www.python-ogre.org"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre" "DisplayVersion" "1.0.2.3"
+ WriteUninstaller "$INSTDIR\uninstall.exe"
+SectionEnd
+
+Section -Run
+ ExecWait "$INSTDIR\ThirdParty\vcredist_x86.exe"
+ DetailPrint "You probably NEED to update your Directx Drivers"
+ ExecWait "$INSTDIR\ThirdParty\dxwebsetup.exe"
+SectionEnd
+
+
+#### Uninstaller code ####
+
+Function un.onInit
+ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
+ Abort
+FunctionEnd
+
+Function un.onUninstSuccess
+ HideWindow
+ MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
+FunctionEnd
+
+Section Uninstall
+ ReadRegStr ${MUI_STARTMENUPAGE_VARIABLE} ${MUI_STARTMENUPAGE_REGISTRY_ROOT} "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
+
+ RMDir /r "{code:GetPythonSiteDir}\ogre\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\renderer\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\renderer\OGRE\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\io\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\io\OIS\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\gui\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\gui\CEGUI\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\gui\QuickGUI\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\sound\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\sound\OgreAL\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\physics\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\physics\OgreRefApp\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\physics\ODE\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\physics\OgreOde\*.pyc"
+ RMDir /r "{code:GetPythonSiteDir}\ogre\physics\OgreNewt\*.pyc"
+ Delete "$INSTDIR\demos\CEGUI\*.pyc"
+ Delete "$INSTDIR\demos\CEGUI\*.log"
+ Delete "$INSTDIR\demos\GUI\*.pyc"
+ Delete "$INSTDIR\demos\GUI\*.log"
+ Delete "$INSTDIR\demos\ogre\*.pyc"
+ Delete "$INSTDIR\demos\ogre\*.log"
+ Delete "$INSTDIR\demos\ogreode\*.pyc"
+ Delete "$INSTDIR\demos\ogreode\*.log"
+ Delete "$INSTDIR\demos\ogrenewt\*.pyc"
+ Delete "$INSTDIR\demos\ogrenewt\*.log"
+ Delete "$INSTDIR\demos\ogreal\*.pyc"
+ Delete "$INSTDIR\demos\ogreal\*.log"
+ Delete "$INSTDIR\demos\ode\*.pyc"
+ Delete "$INSTDIR\demos\ode\*.log"
+ Delete "$INSTDIR\demos\CEGUI\*.cfg"
+ Delete "$INSTDIR\demos\GUI\*.cfg"
+ Delete "$INSTDIR\demos\ogre\*.cfg"
+ Delete "$INSTDIR\demos\ogreode\*.cfg"
+ Delete "$INSTDIR\demos\ogrenewt\*.cfg"
+ Delete "$INSTDIR\demos\ogreal\*.cfg"
+ Delete "$INSTDIR\demos\ode\*.cfg"
+ RMDir "$INSTDIR\demos\CEGUI"
+ RMDir "$INSTDIR\demos\GUI"
+ RMDir "$INSTDIR\demos\ogre"
+ RMDir "$INSTDIR\demos\ogreode"
+ RMDir "$INSTDIR\demos\ogrenewt"
+ RMDir "$INSTDIR\demos\ogreal"
+ RMDir "$INSTDIR\demos\ode"
+ RMDir "$INSTDIR\demos"
+ RMDir "$INSTDIR"
+
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Python-Ogre"
+ DeleteRegValue ${MUI_STARTMENUPAGE_REGISTRY_ROOT} "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
+
+ Delete "$INSTDIR\uninstall.exe"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Python-Ogre API Documenatation.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall Python-Ogre.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Ragdoll.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Custom Joints.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Simple Buoyancy.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Simple Vehicle.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Ray Casting.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Collision Callbacks.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Joints.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos\Basics.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreAL Demos\Basic Sound.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\ODE Demos\Multiple Scenes.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\QuickGUI-01.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\CEGUI - Nice.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\CEGUI Drag and Drop.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI\CEGUI - Basic.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\WX Gui.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Transparency.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Textures.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Terrain.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Smoke.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Sky Plane.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Sky Dome.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Sky Box.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Animation 2.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Animation 1.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Shadows.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Render to Texture.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Particles.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Lighting.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Grass.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Fresnel.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Fish.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Facial.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\ENV Map.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Compositor.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\CEL Shading.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Camera Tracking.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\BSP_Collision.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\BSP.lnk"
+ Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos\Bezier.lnk"
+ Delete "$INSTDIR\ThirdParty\vcredist_x86.exe"
+ Delete "$INSTDIR\ThirdParty\dxwebsetup.exe"
+ Delete "$INSTDIR\packages_2.4\*"
+ Delete "$INSTDIR\packages_2.5\*"
+ Delete "{code:GetPythonSiteDir}\*"
+ Delete "$INSTDIR\docs\*"
+ Delete "$INSTDIR\demos\*"
+ Delete "$INSTDIR\tools\*"
+ Delete "$INSTDIR\plugins\*"
+ Delete "$INSTDIR\*"
+
+ RMDir "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}"
+ RMDir "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreNewt Demos"
+ RMDir "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\OgreAL Demos"
+ RMDir "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\ODE Demos"
+ RMDir "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\GUI"
+ RMDir "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Ogre Demos"
+ RMDir "$INSTDIR\ThirdParty"
+ RMDir "$INSTDIR\packages_2.4"
+ RMDir "$INSTDIR\packages_2.5"
+ RMDir "{code:GetPythonSiteDir}"
+ RMDir "$INSTDIR\docs"
+ RMDir "$INSTDIR\demos"
+ RMDir "$INSTDIR\tools"
+ RMDir "$INSTDIR\plugins"
+ RMDir "$INSTDIR"
+
+ SetAutoClose true
+SectionEnd
+
Added: trunk/python-ogre/ThirdParty/ofusion/IOSMSceneCallbacks.h
===================================================================
--- trunk/python-ogre/ThirdParty/ofusion/IOSMSceneCallbacks.h (rev 0)
+++ trunk/python-ogre/ThirdParty/ofusion/IOSMSceneCallbacks.h 2007-11-14 05:48:13 UTC (rev 480)
@@ -0,0 +1,63 @@
+/**********************************************************************
+ *<
+ oFusion Scene Loader CE (see License.txt)
+
+ FILE: ogreAnimationCompiler.h
+
+ DESCRIPTION: OE_XMLScene callbacks interface
+
+ IMPLEMENTED BY: Andres Carrera
+
+ HISTORY:
+
+ Original implementation by Lasse Tassing (Channex)
+ 2005 ITE ApS, Lasse Tassing
+
+ *> Copyright (c) 2006, All Rights Reserved.
+ **********************************************************************/
+
+
+#ifndef __XML_SCENE_CALLBACKS__
+#define __XML_SCENE_CALLBACKS__
+
+typedef std::deque<Ogre::SceneNode*> NodeList;
+
+// Callback interface. Use this if you want to set special properties on the
+// objects during creation (and/or read custom attribute values).
+class OSMSceneCallbacks
+{
+public:
+ virtual ~OSMSceneCallbacks() {};
+
+ // Called when a node has been created
+ virtual void OnNodeCreate(Ogre::SceneNode *pNode, TiXmlElement* pNodeDesc) {};
+
+ // Called when an entity has been created
+ virtual void OnEntityCreate(Ogre::Entity *pEntity, TiXmlElement* pEntityDesc) {};
+
+ // Called when a camera has been created
+ virtual void OnCameraCreate(Ogre::Camera *pCamera, TiXmlElement* pCameraDesc) {};
+
+ // Called when a light has been created
+ virtual void OnLightCreate(Ogre::Light *pLight, TiXmlElement* pLightDesc) {};
+
+ // Called when a helper has been created
+ virtual void OnHelperCreated(Ogre::SceneNode* pHelper, TiXmlElement* pHelperDesc) {};
+
+ // Called when a shape has been loaded
+ virtual void OnShapeLoaded(const Ogre::SimpleSpline& spline) {
+ // The client should copy and store the "spline" contents in order to use it
+ // Dont store a pointer to it, the "spline" object is destroyed at function return
+ };
+
+ // Called when a static geometry has been created
+ virtual bool OnStaticGeometryCreated(Ogre::StaticGeometry* pStatic, const NodeList& nodeList)
+ {
+ // Return true to keep the added nodes (will be hidden)
+ // Return false to delete the added nodes from the scene manager
+
+ return false;
+ }
+};
+
+#endif
\ No newline at end of file
Added: trunk/python-ogre/ThirdParty/ofusion/OSMAnimSerializer.h
===================================================================
--- trunk/python-ogre/ThirdParty/ofusion/OSMAnimSerializer.h (rev 0)
+++ trunk/python-ogre/ThirdParty/ofusion/OSMAnimSerializer.h 2007-11-14 05:48:13 UTC (rev 480)
@@ -0,0 +1,31 @@
+/**********************************************************************
+ *<
+ oFusion Scene Loader CE (see License.txt)
+
+ FILE: OSMAnimSerializer.h
+
+ DESCRIPTION: External Animation serializer include header
+
+ IMPLEMENTED BY: Andres Carrera
+
+ HISTORY:
+
+ Original implementation by Lasse Tassing (Channex)
+ 2005 ITE ApS, Lasse Tassing
+
+ *> Copyright (c) 2006, All Rights Reserved.
+ **********************************************************************/
+
+#ifndef _OSMANIMSERIALIZER_H_
+#define _OSMANIMSERIALIZER_H_
+
+class OSMAnimSerializer {
+public:
+
+ OSMAnimSerializer();
+
+ void addAnimation(Ogre::SkeletonPtr skel, const Ogre::String& filename);
+
+};
+
+#endif // _OSMANIMSERIALIZER_H_
\ No newline at end of file
Added: trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.cpp
===================================================================
--- trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.cpp (rev 0)
+++ trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.cpp 2007-11-14 05:48:13 UTC (rev 480)
@@ -0,0 +1,956 @@
+/**********************************************************************
+ *<
+ oFusion Scene Loader CE (see License.txt)
+
+ FILE: OgreOSMScene.cpp
+
+ DESCRIPTION: Contains the OE_XMLScene reader (oe_scene)
+
+ IMPLEMENTED BY: Andres Carrera
+
+ HISTORY:
+
+ Original implementation by Lasse Tassing (Channex)
+ 2005 ITE ApS, Lasse Tassing
+
+ *> Copyright (c) 2006, All Rights Reserved.
+ **********************************************************************/
+
+#include "OgreOSMScene.h"
+
+using namespace Ogre;
+
+enum {
+ SCENE_SKYPLANE = 1,
+ SCENE_SKYBOX,
+ SCENE_SKYDOME,
+};
+
+#define ENABLE_LOGMANAGER LogManager::getSingleton().setLogDetail(LL_NORMAL);
+#define DISABLE_LOGMANAGER LogManager::getSingleton().setLogDetail(static_cast<LoggingLevel>(0));
+
+
+OSMScene::OSMScene(SceneManager* pSceneMgr, RenderWindow* win)
+{
+ mSceneMgr = pSceneMgr;
+
+ if(win)
+ mWindow = win;
+ else
+ mWindow = Ogre::Root::getSingleton().getAutoCreatedWindow();
+
+ mCallbacks = 0;
+}
+
+OSMScene::~OSMScene(void)
+{
+
+}
+
+// Init overloads - use either of them
+bool OSMScene::initialise(const char* pszXMLFile, OSMSceneCallbacks* pCallbacks)
+{
+ // Hook up callback interface
+ mCallbacks = pCallbacks;
+
+ LogManager::getSingleton().logMessage("********************************");
+ LogManager::getSingleton().logMessage("** oScene Loader Lib **");
+ LogManager::getSingleton().logMessage("********************************");
+
+ String msg("oSceneLoader: Loading '");
+ msg += pszXMLFile;
+ msg += "' file";
+ LogManager::getSingleton().logMessage(msg);
+
+ // Create new XML document
+ mXMLDoc = TiXmlDocumentPtr(new TiXmlDocument());
+
+ DataStreamPtr pStream = ResourceGroupManager::getSingleton().openResource(pszXMLFile);
+ if(!pStream->size())
+ {
+ mXMLDoc.setNull();
+
+ OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+ "oSceneLoader: Empty scene file",
+ "OSMScene::initialise");
+
+ }
+
+ size_t iSize = pStream->size();
+ char *pBuf = new char[iSize+1];
+ memset(pBuf, 0, iSize+1);
+ pStream->read(pBuf, iSize);
+ pStream.setNull();
+ mXMLDoc->Parse(pBuf);
+ delete[] pBuf;
+
+ // check for errors
+ if(mXMLDoc->Error())
+ {
+ mXMLDoc.setNull();
+
+ String errDesc = "oSceneLoader: Failed to load scene file, ";
+ msg += mXMLDoc->ErrorDesc();
+
+ OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+ errDesc.c_str(),
+ "OSMScene::initialise");
+ }
+
+
+ TiXmlElement* locations = mXMLDoc->RootElement()->FirstChildElement("locations");
+
+ if(locations)
+ {
+
+ FileInfoListPtr fileInfo = ResourceGroupManager::getSingleton().findResourceFileInfo(ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, pszXMLFile);
+
+ String strPath = (*fileInfo)[0].archive->getName();
+
+ strPath = StringUtil::standardisePath(strPath);
+
+ for (TiXmlElement* pLocationElem = locations->FirstChildElement();
+ pLocationElem != 0; pLocationElem = pLocationElem->NextSiblingElement())
+ {
+ // Ogre could cast an exception, in which case we just try to
+ // continue reading the other location paths
+ try
+ {
+ const char *pszName = pLocationElem->Attribute("path");
+ String strDir = strPath + pszName;
+
+ ResourceGroupManager::getSingleton().addResourceLocation(strDir, "FileSystem");
+
+
+ }
+ catch(...) {
+ }
+ }
+ }
+
+
+
+ return true;
+}
+
+// Declare all resources used in the scene
+void OSMScene::declareResources(void)
+{
+ if(!mXMLDoc.isNull())
+ {
+
+ TiXmlElement* rootElem = mXMLDoc->RootElement();
+
+ try
+ {
+ // Get mesh filename from entities
+ TiXmlElement *pMeshNode = rootElem->FirstChildElement("entities");
+ if(pMeshNode)
+ {
+ // Iterate all meshes, creating them.
+ for (TiXmlElement* pMeshElem = pMeshNode->FirstChildElement();
+ pMeshElem != 0; pMeshElem = pMeshElem->NextSiblingElement())
+ {
+ // Declare mesh resource
+ const char *pszFileName = pMeshElem->Attribute("filename");
+ ResourceGroupManager::getSingleton().declareResource(pszFileName, "Mesh");
+ }
+ }
+ } catch(...)
+ {
+ }
+
+ }
+}
+
+// Create scene, optionally attaching it to a parent node
+bool OSMScene::createScene(Ogre::SceneNode* pParent)
+{
+ if(!mXMLDoc.isNull())
+ {
+ String msg("oSceneLoader: Creating scene on '");
+ msg += pParent ? pParent->getName() : "Root";
+ msg += "' node";
+ LogManager::getSingleton().logMessage(msg);
+
+ BOOL bHandled = FALSE;
+
+ TiXmlElement* rootElem = mXMLDoc->RootElement();
+
+ if(mSceneMgr == NULL)
+ {
+ if(rootElem->FirstChildElement("sceneManager"))
+ pParent = createSceneManager(rootElem, bHandled);
+ else
+ mSceneMgr = Root::getSingleton().createSceneManager(ST_GENERIC);
+ }
+
+ if(pParent==NULL)
+ pParent=mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+ assert(pParent);
+
+ TiXmlElement* list;
+
+ try {
+ // Entities
+ list = rootElem->FirstChildElement("entities");
+ if(list)
+ createEntities(list, pParent);
+ } catch(...)
+ {
+ LogManager::getSingleton().logMessage("Error while loading entities");
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Error while loading entities",
+ "OSMScene::createScene");
+ }
+
+ try {
+ // lights
+ list = rootElem->FirstChildElement("lights");
+ if(list)
+ createLights(list, pParent);
+ } catch(...)
+ {
+ LogManager::getSingleton().logMessage("Error while loading lights");
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Error while loading lights",
+ "OSMScene::createScene");
+ }
+
+ if(!bHandled) {
+ try {
+ // cameras
+ list = rootElem->FirstChildElement("cameras");
+ if(list)
+ createCameras(list, pParent);
+ } catch(...)
+ {
+ LogManager::getSingleton().logMessage("Error while loading cameras");
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Error while loading cameras",
+ "OSMScene::createScene");
+ }
+ }
+
+ /*
+ try {
+ // helpers
+ list = rootElem->FirstChildElement("helpers");
+ if(list)
+ createHelpers(list, pParent);
+ } catch(...)
+ {
+ LogManager::getSingleton().logMessage("Error while loading helpers");
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Error while loading helpers",
+ "OSMScene::createScene");
+ }
+
+ try {
+ // shapes
+ list = rootElem->FirstChildElement("shapes");
+ if(list)
+ createShapes(list);
+ } catch(...)
+ {
+ LogManager::getSingleton().logMessage("Error while loading shapes");
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Error while loading shapes",
+ "OSMScene::createScene");
+ }
+
+ try {
+ // External skeletal animation files
+ list = rootElem->FirstChildElement("skeletal_animations");
+ if(list)
+ {
+ SkeletonHandles skelHandles;
+ loadAnimations(list, skelHandles);
+ }
+ }catch(...)
+ {
+ LogManager::getSingleton().logMessage("Error while loading external animations");
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Error while loading external animations",
+ "OSMScene::createScene");
+ }
+ */
+
+ // Set scene properties
+ setSceneProperties(rootElem);
+
+ // Static Geometry
+ list = rootElem->FirstChildElement("staticGeometry");
+ if(list)
+ createStaticGeometry(list);
+
+ LogManager::getSingleton().logMessage("********************************");
+ LogManager::getSingleton().logMessage("** oSceneLoader: Scene loaded **");
+ LogManager::getSingleton().logMessage("********************************");
+
+ return true;
+ }
+
+ return false;
+
+
+}
+
+// Get list of cameras in this scene
+OSMScene::CameraList& OSMScene::getCameraList(void)
+{
+ return mCameras;
+}
+
+// Get list of lights in this scene
+OSMScene::LightList& OSMScene::getLightList(void)
+{
+ return mLights;
+}
+
+// Get list of lights in this scene
+OSMScene::EntityList& OSMScene::getEntityList(void)
+{
+ return mEntities;
+}
+
+Ogre::SceneNode* OSMScene::createNode(TiXmlElement* pElem, Ogre::SceneNode* pSceneRoot)
+{
+ SceneNode *pNode=0;
+
+ // Try to find the parent node
+ const char *pszName = pElem->Attribute("name");
+ if(pszName == NULL) return NULL;
+
+ // Check if this node has a parent
+ const char *pszParent = pElem->Attribute("parent");
+ if(pszParent == NULL)
+ {
+ // Check if the scene node has already been created by a child
+ DISABLE_LOGMANAGER
+
+ try
+ {
+ pNode = mSceneMgr->getSceneNode(pszName);
+ } catch(...)
+ {
+ pNode = pSceneRoot->createChildSceneNode(pszName);
+ }
+
+ ENABLE_LOGMANAGER
+
+ } else
+ {
+ SceneNode *pParent=0;
+ DISABLE_LOGMANAGER
+
+ try
+ {
+ // Try to find parent scenenode
+ pParent=mSceneMgr->getSceneNode(pszParent);
+ } catch(...)
+ {
+ // We try to create the parent node as child of root node.
+ // Later when the parent (hopefully) is created, we can adjust it,
+ // if it is child of another node.
+ pParent=pSceneRoot->createChildSceneNode(pszParent);
+ }
+
+
+ try
+ {
+ // Check if the scene node has already been created by a child
+ // In this case we would have to change the parent.
+ pNode = mSceneMgr->getSceneNode(pszName);
+
+ // Get old parent (probably scene root)
+ SceneNode *pOldParent=pNode->getParentSceneNode();
+
+ // Remove this node
+ pOldParent->removeChild(pNode);
+
+ // Insert us as child on the "real" parent
+ pParent->addChild(pNode);
+ } catch(...)
+ {
+ pNode = pParent->createChildSceneNode(pszName);
+ }
+
+ ENABLE_LOGMANAGER
+ }
+
+ // Position
+ TiXmlElement* posElem = pElem->FirstChildElement("position");
+ if(posElem)
+ {
+ Vector3 pos;
+ pos.x = StringConverter::parseReal(posElem->Attribute("x"));
+ pos.y = StringConverter::parseReal(posElem->Attribute("y"));
+ pos.z = StringConverter::parseReal(posElem->Attribute("z"));
+ pNode->setPosition(pos);
+ }
+
+ // Rotation
+ TiXmlElement* rotElem = pElem->FirstChildElement("rotation");
+ if(rotElem)
+ {
+ pNode->setOrientation(
+ StringConverter::parseReal(rotElem->Attribute("w")),
+ StringConverter::parseReal(rotElem->Attribute("x")),
+ StringConverter::parseReal(rotElem->Attribute("y")),
+ StringConverter::parseReal(rotElem->Attribute("z")));
+
+ }
+
+ // Scale
+ TiXmlElement* scaleElem = pElem->FirstChildElement("scale");
+ if(scaleElem)
+ {
+ Vector3 scale;
+ scale.x = StringConverter::parseReal(scaleElem->Attribute("x"));
+ scale.y = StringConverter::parseReal(scaleElem->Attribute("y"));
+ scale.z = StringConverter::parseReal(scaleElem->Attribute("z"));
+ pNode->setScale(scale);
+ }
+
+ // Notify
+ if(mCallbacks)
+ mCallbacks->OnNodeCreate(pNode, pElem);
+
+ // Animation
+ TiXmlElement* animList = pElem->FirstChildElement("animations");
+ if(animList)
+ {
+ //
+ for (TiXmlElement* animElem = animList->FirstChildElement();
+ animElem != 0; animElem = animElem->NextSiblingElement())
+ {
+ // Get name of animation
+ const char *pszName = animElem->Attribute("name");
+
+ Animation *pAnim = 0;
+ DISABLE_LOGMANAGER
+ try
+ {
+ pAnim=mSceneMgr->getAnimation(pszName);
+ } catch(...)
+ {
+ }
+ ENABLE_LOGMANAGER
+
+ // If this animation has not been created yet, we create it
+ if(pAnim == 0)
+ {
+ float fLength = StringConverter::parseReal(animElem->Attribute("length"));
+ pAnim = mSceneMgr->createAnimation(pszName, fLength);
+ pAnim->setInterpolationMode(Animation::IM_LINEAR);
+ }
+
+ // Create animation track for this node
+ NodeAnimationTrack *pTrack = pAnim->createNodeTrack(pAnim->getNumNodeTracks()+1, pNode);
+
+ // Iterate all keyframes for this node
+ for (TiXmlElement* pKeyframeElem = animElem->FirstChildElement();
+ pKeyframeElem != 0; pKeyframeElem = pKeyframeElem->NextSiblingElement())
+ {
+ float fTime=StringConverter::parseReal(pKeyframeElem->Attribute("time"));
+ TransformKeyFrame *pKeyFrame = pTrack->createNodeKeyFrame(fTime);
+
+ // Position
+ TiXmlElement* posElem = pKeyframeElem->FirstChildElement("position");
+ if(posElem)
+ {
+ Vector3 trans;
+ trans.x = StringConverter::parseReal(posElem->Attribute("x"));
+ trans.y = StringConverter::parseReal(posElem->Attribute("y"));
+ trans.z = StringConverter::parseReal(posElem->Attribute("z"));
+ pKeyFrame->setTranslate(trans);
+ }
+
+ // Rotation
+ TiXmlElement* rotElem = pKeyframeElem->FirstChildElement("rotation");
+ if(rotElem)
+ {
+ Quaternion qRot;
+ qRot.x = StringConverter::parseReal(rotElem->Attribute("x"));
+ qRot.y = StringConverter::parseReal(rotElem->Attribute("y"));
+ qRot.z = StringConverter::parseReal(rotElem->Attribute("z"));
+ qRot.w = StringConverter::parseReal(rotElem->Attribute("w"));
+ pKeyFrame->setRotation(qRot);
+ }
+
+ // Scale
+ TiXmlElement* scaleElem = pKeyframeElem->FirstChildElement("scale");
+ if(scaleElem)
+ {
+ Vector3 scale;
+ scale.x = StringConverter::parseReal(scaleElem->Attribute("x"));
+ scale.y = StringConverter::parseReal(scaleElem->Attribute("y"));
+ scale.z = StringConverter::parseReal(scaleElem->Attribute("z"));
+ pKeyFrame->setScale(scale);
+ }
+ }
+ }
+ }
+
+ return pNode;
+}
+
+// Create SceneManager
+Ogre::SceneNode* OSMScene::createSceneManager(TiXmlElement* sceneProp, BOOL& bHandled)
+{
+ assert(sceneProp);
+
+ // Scene manager
+ TiXmlElement* sceneMgrElem = sceneProp->FirstChildElement("sceneManager");
+ int type = Ogre::StringConverter::parseInt(sceneMgrElem->Attribute("type"));
+ Ogre::SceneType sceneType = static_cast<Ogre::SceneType>(1 << (type - 1));
+ mSceneMgr = Ogre::Root::getSingleton().createSceneManager(sceneType);
+ assert(mSceneMgr);
+
+ SceneNode* pSceneRoot = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+ assert(pSceneRoot);
+
+ // Scene shadows
+ TiXmlElement* shadowsElem = sceneProp->FirstChildElement("shadowTechnique");
+ if(shadowsElem)
+ {
+ int type = StringConverter::parseInt(shadowsElem->Attribute("type"));
+ Ogre::ShadowTechnique shadowType = static_cast<Ogre::ShadowTechnique>(type);
+
+ mSceneMgr->setShadowTechnique(shadowType);
+
+ int tex_size = StringConverter::parseInt(shadowsElem->Attribute("tex_size"));
+ int tex_count = StringConverter::parseInt(shadowsElem->Attribute("tex_count"));
+
+ mSceneMgr->setShadowTextureSettings(tex_size, tex_count);
+
+ // Shadow Color
+ TiXmlElement* colorElem = shadowsElem->FirstChildElement("color");
+ if(colorElem)
+ {
+ ColourValue color;
+ color.r = StringConverter::parseReal(colorElem->Attribute("r"));
+ color.g = StringConverter::parseReal(colorElem->Attribute("g"));
+ color.b = StringConverter::parseReal(colorElem->Attribute("b"));
+
+ mSceneMgr->setShadowColour(color);
+ }
+ }
+
+ // Scene fog
+ TiXmlElement* fogElem = sceneProp->FirstChildElement("fogMode");
+ if(fogElem)
+ {
+ int type = StringConverter::parseInt(fogElem->Attribute("type"));
+ FogMode mode = static_cast<FogMode>(type);
+
+ float density = StringConverter::parseReal(fogElem->Attribute("density"));
+ float linearStart = StringConverter::parseReal(fogElem->Attribute("linearStart"));
+ float linearEnd = StringConverter::parseReal(fogElem->Attribute("linearEnd"));
+
+ Ogre::ColourValue color;
+
+ // Fog Color
+ TiXmlElement* colorElem = fogElem->FirstChildElement("color");
+ if(colorElem)
+ {
+ color.r = StringConverter::parseReal(colorElem->Attribute("r"));
+ color.g = StringConverter::parseReal(colorElem->Attribute("g"));
+ color.b = StringConverter::parseReal(colorElem->Attribute("b"));
+ }
+
+ mSceneMgr->setFog(mode, color, density, linearStart, linearEnd);
+ }
+
+ // World Geometry
+ const char* worldGeometry = sceneMgrElem->Attribute("worldGeometry");
+ if(worldGeometry != NULL)
+ {
+ // Some scene managers need cameras created before the world geometry
+ try {
+ // cameras
+ TiXmlElement* list = sceneProp->FirstChildElement("cameras");
+ if(list)
+ createCameras(list, pSceneRoot);
+
+ if(sceneType == ST_EXTERIOR_CLOSE)
+ {
+
+ if(mCameras.empty())
+ {
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: Scene dont contain cameras, \
+ Terrain Scene Manager needs a camera to initialize",
+ "OSMScene::createSceneManager");
+ }
+
+ Camera* primaryCamera = mCameras[0];
+
+ mWindow->getViewport(0)->setCamera(primaryCamera);
+
+ mSceneMgr->setOption("PrimaryCamera", primaryCamera);
+ }
+
+ // cameras created, the main scene loader method should not re-parse the list
+ bHandled = TRUE;
+ } catch(...)
+ {
+ }
+
+ mSceneMgr->setWorldGeometry(worldGeometry);
+ }
+
+ return pSceneRoot;
+}
+
+// Set Scene Properties
+void OSMScene::setSceneProperties(TiXmlElement* sceneProp)
+{
+ // Ambient light Color
+ TiXmlElement* colorElem = sceneProp->FirstChildElement("lightColor");
+ if(colorElem)
+ {
+ ColourValue color;
+ color.r = StringConverter::parseReal(colorElem->Attribute("r"));
+ color.g = StringConverter::parseReal(colorElem->Attribute("g"));
+ color.b = StringConverter::parseReal(colorElem->Attribute("b"));
+
+ mSceneMgr->setAmbientLight(color);
+ }
+
+ // Background Color
+ colorElem = sceneProp->FirstChildElement("bkgcolor");
+ if(colorElem && mWindow)
+ {
+ int numViewports = mWindow->getNumViewports();
+ if(numViewports)
+ {
+ Ogre::ColourValue color;
+ color.r = StringConverter::parseReal(colorElem->Attribute("r"));
+ color.g = StringConverter::parseReal(colorElem->Attribute("g"));
+ color.b = StringConverter::parseReal(colorElem->Attribute("b"));
+
+ for(int i=0; i<numViewports; ++i)
+ mWindow->getViewport(i)->setBackgroundColour(color);
+ }
+ }
+
+ // Scene sky
+ TiXmlElement* skyElem = sceneProp->FirstChildElement("skyTechnique");
+ if(skyElem)
+ {
+ int type = StringConverter::parseInt(skyElem->Attribute("type"));
+ String materialName = skyElem->Attribute("material");
+
+ if(materialName != " ") {
+ bool drawFirst = StringConverter::parseBool(skyElem->Attribute("drawFirst"));
+ float tiling = StringConverter::parseReal(skyElem->Attribute("tiling"));
+ float scale = StringConverter::parseReal(skyElem->Attribute("scale"));
+ float dist = StringConverter::parseReal(skyElem->Attribute("dist"));
+ float bow = StringConverter::parseReal(skyElem->Attribute("bow"));
+ int xSegments = StringConverter::parseInt(skyElem->Attribute("xSegments"));
+ int ySegments = StringConverter::parseInt(skyElem->Attribute("ySegments"));
+ Ogre::Quaternion quat(Quaternion::IDENTITY);
+ Ogre::Plane plane;
+ plane.d = dist;
+ plane.normal = -(Vector3::UNIT_Y);
+
+ switch(type) {
+
+ case SCENE_SKYPLANE:
+
+ mSceneMgr->setSkyPlane(true, plane, materialName, scale,
+ tiling, drawFirst, bow, xSegments, ySegments);
+
+ mSceneMgr->setSkyBox(false, "");
+ mSceneMgr->setSkyDome(false, "");
+
+ break;
+
+ case SCENE_SKYBOX:
+
+ mSceneMgr->setSkyBox(true, materialName, dist, drawFirst, quat);
+ mSceneMgr->setSkyPlane(false, plane, "");
+ mSceneMgr->setSkyDome(false, "");
+
+ break;
+
+ case SCENE_SKYDOME:
+
+ mSceneMgr->setSkyDome(true, materialName, bow, tiling, dist,
+ drawFirst, quat, xSegments, ySegments);
+
+ mSceneMgr->setSkyPlane(false, plane, "");
+ mSceneMgr->setSkyBox(false, "");
+
+ break;
+
+ }
+ }
+ }
+}
+
+// Create all entities in scene
+void OSMScene::createEntities(TiXmlElement* pEntityNode, Ogre::SceneNode* pSceneRoot)
+{
+ // Iterate all meshes, creating them.
+ for (TiXmlElement* pMeshElem = pEntityNode->FirstChildElement();
+ pMeshElem != 0; pMeshElem = pMeshElem->NextSiblingElement())
+ {
+ // Ogre could cast an exception, in which case we just try to
+ // continue reading the other meshes
+ try
+ {
+ const char *pszName = pMeshElem->Attribute("name");
+ const char *pszFileName = pMeshElem->Attribute("filename");
+
+ // try to create the mesh
+ Entity *pEntity = mSceneMgr->createEntity(pszName, pszFileName);
+ if(pEntity==0) continue;
+
+ // Check if the object should cast shadows
+ const char *pszCastShadows=pMeshElem->Attribute("CastShadows");
+ if(pszCastShadows && stricmp(pszCastShadows, "no")==0)
+ pEntity->setCastShadows(false);
+ else
+ pEntity->setCastShadows(true);
+
+ // Create node with full information
+ SceneNode *pObjNode=createNode(pMeshElem, pSceneRoot);
+
+ // Attach the mesh entity to node
+ pObjNode->attachObject(pEntity);
+
+ // Notify
+ if(mCallbacks)
+ mCallbacks->OnEntityCreate(pEntity, pMeshElem);
+
+ // Add to entity list
+ mEntities.push_back(pEntity);
+ } catch(...)
+ {
+ continue;
+ }
+ }
+}
+
+// Create all Lights in scene
+void OSMScene::createLights(TiXmlElement* pLightNode, Ogre::SceneNode* pSceneRoot)
+{
+ // Iterate all Lights, creating them. We do not attach them yet, since
+ // we need to make sure all potential parent entities have been created.
+ for (TiXmlElement* pLightElem = pLightNode->FirstChildElement();
+ pLightElem != 0; pLightElem = pLightElem->NextSiblingElement())
+ {
+ // Ogre could cast an exception, in which case we just try to
+ // continue reading the other Lights
+ try
+ {
+ const char *pszName = pLightElem->Attribute("name");
+
+ Light *pLight = mSceneMgr->createLight(pszName);
+ if(pLight==0) continue;
+
+ // Figure out which type of light we are using
+ const char *pszType = pLightElem->Attribute("type");
+ if(stricmp(pszType, "omni")==0)
+ {
+ pLight->setType(Light::LT_POINT);
+ } else if(stricmp(pszType, "spot")==0)
+ {
+ pLight->setType(Light::LT_SPOTLIGHT);
+ pLight->setSpotlightRange(
+ Degree(StringConverter::parseReal(pLightElem->Attribute("hotspot"))),
+ Degree(StringConverter::parseReal(pLightElem->Attribute("falloff"))));
+ pLight->setDirection(0,0,-1);
+
+ } else if(stricmp(pszType, "directional")==0)
+ {
+ pLight->setType(Light::LT_DIRECTIONAL);
+ }
+
+ // Check if the light should be on
+ const char *pszOn = pLightElem->Attribute("on");
+ if(pszOn!=0 && stricmp(pszOn, "true")==0)
+ pLight->setVisible(true);
+ else
+ pLight->setVisible(false);
+
+ // Check if the object should cast shadows
+ const char *pszCastShadows = pLightElem->Attribute("CastShadows");
+ if(pszCastShadows && stricmp(pszCastShadows, "no")==0)
+ pLight->setCastShadows(false);
+ else
+ pLight->setCastShadows(true);
+
+ // Diffuse Color
+ TiXmlElement* colorElem = pLightElem->FirstChildElement("color");
+ if(colorElem)
+ {
+ pLight->setDiffuseColour(
+ StringConverter::parseReal(colorElem->Attribute("r")),
+ StringConverter::parseReal(colorElem->Attribute("g")),
+ StringConverter::parseReal(colorElem->Attribute("b")));
+ }
+
+ // Specular Color
+ TiXmlElement* specularElem = pLightElem->FirstChildElement("specular");
+ if(specularElem)
+ {
+ pLight->setSpecularColour(
+ StringConverter::parseReal(specularElem->Attribute("r")),
+ StringConverter::parseReal(specularElem->Attribute("g")),
+ StringConverter::parseReal(specularElem->Attribute("b")));
+ }
+
+ // Attenuation
+ TiXmlElement* attenElem = pLightElem->FirstChildElement("attenuation");
+ if(attenElem) {
+ pLight->setAttenuation(
+ StringConverter::parseReal(attenElem->Attribute("range")),
+ StringConverter::parseReal(attenElem->Attribute("constant")),
+ StringConverter::parseReal(attenElem->Attribute("linear")),
+ StringConverter::parseReal(attenElem->Attribute("quadratic")));
+ }
+
+ // Create node with full information
+ SceneNode *pLightNode=createNode(pLightElem, pSceneRoot);
+
+ // Attach the Light entity to node
+ pLightNode->attachObject(pLight);
+
+ // Target
+ TiXmlElement* targetElem=pLightElem->FirstChildElement("target");
+ if(targetElem)
+ {
+ // Create node with full information
+ SceneNode *pTargetNode=createNode(targetElem, pSceneRoot);
+ pLightNode->setAutoTracking(true, pTargetNode);
+ }
+
+ // Notify
+ if(mCallbacks)
+ mCallbacks->OnLightCreate(pLight, pLightElem);
+
+ // Add to light list
+ mLights.push_back(pLight);
+ } catch(...)
+ {
+ continue;
+ }
+ }
+}
+
+// Create all Cameras in scene
+void OSMScene::createCameras(TiXmlElement* pCameraNode, Ogre::SceneNode* pSceneRoot)
+{
+ // Iterate all Cameras, creating them. We do not attach them yet, since
+ // we need to make sure all potential parent entities have been created.
+ for (TiXmlElement* pCameraElem = pCameraNode->FirstChildElement();
+ pCameraElem != 0; pCameraElem = pCameraElem->NextSiblingElement())
+ {
+ // Ogre could cast an exception, in which case we just try to
+ // continue reading the other Cameras
+ try
+ {
+ const char *pszName = pCameraElem->Attribute("name");
+
+ // Create camera
+ Camera *pCamera=mSceneMgr->createCamera(pszName);
+ if(pCamera==0) continue;
+
+ // Set Field of View on camera
+ pCamera->setFOVy(Radian(StringConverter::parseReal(pCameraElem->Attribute("FOV"))));
+ pCamera->setNearClipDistance(5);
+
+ // Create node with full information
+ SceneNode *pCameraNode=createNode(pCameraElem, pSceneRoot);
+
+ // Attach the Camera entity to node
+ pCameraNode->attachObject(pCamera);
+
+ // Target
+ TiXmlElement* targetElem=pCameraElem->FirstChildElement("target");
+ if(targetElem)
+ {
+ // Create node with full information
+ SceneNode *pTargetNode=createNode(targetElem, pSceneRoot);
+ pCameraNode->setAutoTracking(true, pTargetNode);
+ }
+
+ if(!mWindow)
+ {
+
+ OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+ "oSceneLoader: RenderWindow not valid, \
+ If the RenderWindow was not auto created, \
+ you must add it in the OSMScene object contructor",
+ "OSMScene::createCameras");
+
+ }
+
+ // If viewport(s) are not present, create a default viewport
+ if(mWindow->getNumViewports() == 0)
+ {
+ Viewport* vp = mWindow->addViewport(pCamera);
+
+ // Alter the camera aspect ratio to match the viewport
+ pCamera->setAspectRatio(
+ Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+ }
+
+
+ // Notify
+ if(mCallbacks)
+ mCallbacks->OnCameraCreate(pCamera, pCameraElem);
+
+ // Add to camera list
+ mCameras.push_back(pCamera);
+ } catch(...)
+ {
+ continue;
+ }
+ }
+
+}
+
+// For CE version, helpers, shapes, static geometry
+// and external skeleton animation support is not provided
+void OSMScene::createHelpers(TiXmlElement* pHelperNode, Ogre::SceneNode* pSceneRoot)
+{
+
+}
+
+void OSMScene::createShapes(TiXmlElement* pShapeNode)
+{
+
+
+}
+
+void OSMScene::createStaticGeometry(TiXmlElement* pStaticGeom)
+{
+
+}
+
+void OSMScene::loadAnimations(TiXmlElement* animationsNode, SkeletonHandles& handles) {
+
+ // Iterate all skeletons, adding animations from ".anim" files
+}
+
+OSMAnimSerializer::OSMAnimSerializer() {
+
+}
+
+void OSMAnimSerializer::addAnimation(Ogre::SkeletonPtr skel, const Ogre::String& filename) {
+
+
+}
Added: trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.h
===================================================================
--- trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.h (rev 0)
+++ trunk/python-ogre/ThirdParty/ofusion/OgreOSMScene.h 2007-11-14 05:48:13 UTC (rev 480)
@@ -0,0 +1,108 @@
+/**********************************************************************
+ *<
+ oFusion Scene Loader CE (see License.txt)
+
+ FILE: ogreAnimationCompiler.h
+
+ DESCRIPTION: OE_XMLScene reader (oe_scene) include header
+
+ IMPLEMENTED BY: Andres Carrera
+
+ HISTORY:
+
+ Original implementation by Lasse Tassing (Channex)
+ 2005 ITE ApS, Lasse Tassing
+
+ *> Copyright (c) 2006, All Rights Reserved.
+ **********************************************************************/
+
+
+#ifndef __OGRE_XML_SCENE__
+#define __OGRE_XML_SCENE__
+
+
+#include "Ogre.h"
+#include "OgreSharedPtr.h"
+#include "tinyxml.h"
+
+#include "IOSMSceneCallbacks.h"
+#include "OSMAnimSerializer.h"
+
+class TiXmlDocumentPtr : public Ogre::SharedPtr<TiXmlDocument> {
+public:
+ TiXmlDocumentPtr() : Ogre::SharedPtr<TiXmlDocument>() {}
+ explicit TiXmlDocumentPtr(TiXmlDocument* rep) : Ogre::SharedPtr<TiXmlDocument>(rep) {}
+
+};
+
+class OSMScene
+{
+public:
+
+ typedef std::vector<Ogre::Camera*> CameraList;
+ typedef std::vector<Ogre::Light*> LightList;
+ typedef std::vector<Ogre::Entity*> EntityList;
+
+ OSMScene(Ogre::SceneManager* pSceneMgr = 0, Ogre::RenderWindow* win = 0);
+ ~OSMScene(void);
+
+ // Initialise
+ bool initialise(const char *pszXMLFile, OSMSceneCallbacks* pCallbacks = NULL);
+
+ // Declare all resources used in the scene
+ void declareResources(void);
+
+ // Create scene, optionally attaching it to a parent node
+ bool createScene(Ogre::SceneNode *pParent = NULL);
+
+ // Get list of cameras in this scene
+ CameraList& getCameraList(void);
+
+ // Get list of lights in this scene
+ LightList& getLightList(void);
+
+ // Get list of lights in this scene
+ EntityList& getEntityList(void);
+
+ // Get created scene manager
+ Ogre::SceneManager* getSceneManager(void) { return mSceneMgr; }
+
+private:
+ // Create node from information
+ Ogre::SceneNode* createNode(TiXmlElement* pElem, Ogre::...
[truncated message content] |