[Python-ogre-commit] SF.net SVN: python-ogre:[844] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2009-01-24 05:00:48
|
Revision: 844 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=844&view=rev Author: andy_miller Date: 2009-01-24 05:00:41 +0000 (Sat, 24 Jan 2009) Log Message: ----------- Updates to support Oger 1.6.1 SDK Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/SConstruct trunk/python-ogre/code_generators/cegui/generate_code.py trunk/python-ogre/code_generators/cegui/python_CEGUI.h trunk/python-ogre/code_generators/cegui/python_CEGUI_aliases.h trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/code_generators/ois/generate_code.py trunk/python-ogre/environment.py trunk/python-ogre/patch/ParticleUniverse_0.8.patch Added Paths: ----------- trunk/python-ogre/demos/ogre/tofix/Demo_BspCollision.py Removed Paths: ------------- trunk/python-ogre/demos/ogre/Demo_BspCollision.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2009-01-24 05:00:41 UTC (rev 844) @@ -1,6 +1,6 @@ import os -SDK=False # True ## set to true if buiding from 1.4 release source... +SDK=True # Changes Ogre include path settings ## The root directory is where this module is located module_dir = os.path.abspath(os.path.dirname(__file__) ) @@ -17,7 +17,7 @@ ## Path to your boost_pythonxxxx lib file PATH_LIB_Boost = os.path.join(PATH_Boost, 'bin.v2/libs/python/build/msvc-9.0/release/threading-multi') -PATH_LIB_Boost_STATIC = os.path.join(PATH_Boost, 'bin.v2/libs/python/build/msvc-9.0/release/link-static/threading-multi') +#PATH_LIB_Boost_STATIC = os.path.join(PATH_Boost, 'bin.v2/libs/python/build/msvc-9.0/release/link-static/threading-multi') PATH_LIB_Thread_STATIC = os.path.join(PATH_Boost, 'bin.v2/libs/thread/build/msvc-9.0/release/link-static/threading-multi') PATH_LIB_date_time_STATIC = os.path.join(PATH_Boost, 'bin.v2/libs/date_time/build/msvc-9.0/release/link-static/threading-multi') # in Linux we need to code in the Relative path for the library @@ -31,6 +31,7 @@ ## Parent directories of the libraries PATH_THIRDPARTY = os.path.join(module_dir, 'ThirdParty' ) PATH_Ogre = os.path.join(BASE_DIR, 'ogre') +PATH_Ogre = "C:\\OgreSDK" PATH_OgreAddons = os.path.join(BASE_DIR, 'OgreAddons') PATH_CEGUI = os.path.join(BASE_DIR, 'CEGUI-0.6.2') @@ -84,16 +85,18 @@ # it's time for the SDK version if SDK: - PATH_CEGUI = os.path.join(BASE_DIR, 'ogre') - PATH_OIS = os.path.join(BASE_DIR, 'ogre') + PATH_CEGUI = PATH_Ogre + PATH_OIS = PATH_Ogre + + ### ### these paths assume you've left all the directory structure as standard ### Override anything that is different ### PATH_LIB_Ogre_CEGUIRenderer = os.path.join( PATH_Ogre, 'Samples/Common/CEGUIRenderer/lib') PATH_LIB_Ogre_OgreMain= os.path.join( PATH_Ogre, 'lib' ) -PATH_LIB_Ogre_Dependencies = os.path.join( PATH_Ogre, 'Dependencies/lib/Release') +PATH_LIB_Ogre_Dependencies = ""# os.path.join( PATH_Ogre, 'Dependencies/lib/Release') PATH_LIB_OgreRefApp = os.path.join( PATH_Ogre, 'lib') PATH_LIB_OgreNewt = os.path.join( PATH_OgreAddons, 'ogrenewt/OgreNewt_Main/lib/Release') PATH_LIB_Newton = os.path.join( PATH_Newton ,'dll') ##NOTE Posix platforms this lives in 'lib-mt' @@ -114,26 +117,30 @@ PATH_LIB_Bullet = os.path.join(PATH_Bullet, 'out/release8/libs' ) PATH_LIB_Theora= os.path.join(PATH_Theora, 'bin', 'Release') PATH_LIB_ogrevideoffmpeg = PATH_ogrevideoffmpeg -# PATH_LIB_ffmpeg= os.path.join(BASE_DIR, 'ffmpeg', 'lib') PATH_LIB_ffmpeg= os.path.join(PATH_ffmpeg, 'lib') - PATH_LIB_plib = PATH_plib PATH_LIB_navi= os.path.join(PATH_navi, 'lib') PATH_LIB_ogredshow = PATH_ogredshow PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') +PATH_LIB_opensteer = os.path.join(PATH_opensteer, 'win32','release') +PATH_LIB_hikari = os.path.join(PATH_hikari ) # , 'lib') +PATH_LIB_mygui = os.path.join(PATH_mygui, 'MyGUIEngine','lib','Release') +PATH_LIB_canvas = os.path.join(PATH_canvas ) +PATH_LIB_pcz = os.path.join(PATH_LIB_Ogre_OgreMain, 'OGRE') + if SDK: PATH_LIB_Ogre_CEGUIRenderer = os.path.join( PATH_Ogre, 'lib') - PATH_LIB_OIS = os.path.join( PATH_Ogre, 'Dependencies/lib/Release') ## NOTE Posix platforms this lives in'lib' not 'dll' + PATH_LIB_OIS = os.path.join( PATH_Ogre, 'lib') PATH_LIB_CEGUI = os.path.join( PATH_Ogre, 'lib' ) + PATH_LIB_pcz = os.path.join( PATH_Ogre, 'lib','opt' ) -PATH_LIB_opensteer = os.path.join(PATH_opensteer, 'win32','release') -PATH_LIB_hikari = os.path.join(PATH_hikari ) # , 'lib') -PATH_LIB_mygui = os.path.join(PATH_mygui, 'MyGUIEngine','lib','Release') -PATH_LIB_canvas = os.path.join(PATH_canvas ) + + + PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include') -PATH_INCLUDE_NEDMALLOC= os.path.join(PATH_Ogre,'OgreMain', 'src', 'nedmalloc') -PATH_INCLUDE_Ogre_Dependencies = os.path.join( PATH_Ogre, 'Dependencies/include') +PATH_INCLUDE_NEDMALLOC= "" #os.path.join(PATH_Ogre,'OgreMain', 'src', 'nedmalloc') +PATH_INCLUDE_Ogre_Dependencies = "" #os.path.join( PATH_Ogre, 'Dependencies/include') PATH_INCLUDE_OIS = os.path.join(PATH_OIS,'includes') ## Note the plural include's PATH_INCLUDE_OgreRefApp = os.path.join(PATH_Ogre,'ReferenceApplication/ReferenceAppLayer/include') PATH_INCLUDE_OgreNewt = os.path.join(PATH_OgreAddons,'ogrenewt/OgreNewt_Main/inc') @@ -202,7 +209,10 @@ PATH_INCLUDE_opensteer_opensteer = os.path.join(PATH_opensteer, 'include', 'OpenSteer') if SDK: - PATH_INCLUDE_OIS = os.path.join(PATH_Ogre,'Dependencies/include/OIS') ## Note the plural include's - PATH_INCLUDE_CEGUI = os.path.join(PATH_Ogre, 'Dependencies/include/CEGUI') + PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'include') + PATH_INCLUDE_OIS = os.path.join(PATH_Ogre,'include/OIS') + PATH_INCLUDE_CEGUI = os.path.join(PATH_Ogre, 'include/CEGUI') + PATH_INCLUDE_Ogre_CEGUIRenderer = os.path.join( PATH_Ogre, 'samples','include') + PATH_INCLUDE_ogrepcz = os.path.join(PATH_Ogre,'include', 'opt') \ No newline at end of file Modified: trunk/python-ogre/SConstruct =================================================================== --- trunk/python-ogre/SConstruct 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/SConstruct 2009-01-24 05:00:41 UTC (rev 844) @@ -50,7 +50,7 @@ def get_ccflags(cls): if os.name=='nt': CCFLAGS='' - CCFLAGS += ' /DBOOST_PYTHON_MAX_ARITY=19 ' + CCFLAGS += ' /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES ' CCFLAGS += ' /nologo -Zm200 ' CCFLAGS += ' /W3 /wd4675' # warning level -Zc:wchar_t CCFLAGS += ' /TP /MD /Zc:forScope /EHs /c /Ox /Ob2 /Oi /Ot /Oy /GS- /GR ' @@ -59,6 +59,7 @@ CCFLAGS = ' `pkg-config --cflags OGRE` ' ## needs to change I think :) CCFLAGS += ' -I' CCFLAGS += ' -O3 -I./ ' + CCFLAGS += ' -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES ' if cls.ModuleName == 'OGRE': ##### -fvisibility=hidden -finline-limit=20 ' #CCFLAGS += ' -fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY ' Modified: trunk/python-ogre/code_generators/cegui/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/cegui/generate_code.py 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/code_generators/cegui/generate_code.py 2009-01-24 05:00:41 UTC (rev 844) @@ -131,8 +131,11 @@ if 'iterator' in cls.name.lower() : cls.exclude() print "Excluding Iterator", cls.name - CEGUI_ns.class_('OgreCEGUIResourceProvider').exclude() # it's _ogrePrivate.. - + + try: # this is in the newer version of cegui so I'm OK if it fails + CEGUI_ns.class_('OgreCEGUIResourceProvider').exclude() # it's _ogrePrivate.. + except: + pass ## Replaced these with 'useful' functions in the handwrappers - take and return python objects CEGUI_ns.class_( "Window" ).member_functions("setUserData").exclude() CEGUI_ns.class_( "Window" ).member_functions("getUserData").exclude() Modified: trunk/python-ogre/code_generators/cegui/python_CEGUI.h =================================================================== --- trunk/python-ogre/code_generators/cegui/python_CEGUI.h 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/code_generators/cegui/python_CEGUI.h 2009-01-24 05:00:41 UTC (rev 844) @@ -10,8 +10,11 @@ #include "CEGUIXMLAttributes.h" // needed for FontManager #include "CEGUIXMLSerializer.h" #include "OgreCEGUIRenderer.h" -#include "OgreCEGUIResourceProvider.h" +#if ( CEGUI_VERSION_MINOR > 5 ) + #include "OgreCEGUIResourceProvider.h" +#endif + #include "Ogre.h" // we need this to fix unexposed stuff.. // First we create a magic namespace to hold all our aliases Modified: trunk/python-ogre/code_generators/cegui/python_CEGUI_aliases.h =================================================================== --- trunk/python-ogre/code_generators/cegui/python_CEGUI_aliases.h 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/code_generators/cegui/python_CEGUI_aliases.h 2009-01-24 05:00:41 UTC (rev 844) @@ -6,15 +6,16 @@ // typedef std::vector<CEGUI::Scheme::UIElementFactory> UIElementFactoryVector; // typedef std::vector<CEGUI::Scheme::UIModule> UIModuleVector; +#if ( CEGUI_VERSION_MINOR > 5 ) + typedef std::list<CEGUI::OgreCEGUITexture*> OgreCEGUITextureList; +#endif - - typedef ::CEGUI::Event::Connection Connection; typedef ::CEGUI::Event::Subscriber Subscriber; typedef ::CEGUI::EventSet::Iterator EventIterator; -typedef std::list<CEGUI::OgreCEGUITexture*> OgreCEGUITextureList; + typedef ::CEGUI::FontManager::FontIterator FontIterator ; typedef ::CEGUI::Imageset::ImageIterator ImageIterator; typedef ::CEGUI::ImagesetManager::ImagesetIterator ImagesetIterator; Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2009-01-24 05:00:41 UTC (rev 844) @@ -271,14 +271,14 @@ # print "MC:", cls if private_decls.is_private( cls ): cls.exclude() - print '{*} class "%s" is marked as private' % cls.decl_string + print '{*} Excluding class "%s" as marked as private' % cls.decl_string for func in main_ns.calldefs(): if private_decls.is_private( func ): if func.virtuality == declarations.VIRTUALITY_TYPES.PURE_VIRTUAL: continue func.exclude() - print '{*} function "%s" is marked as internal' % declarations.full_name( func ) + print '{*} Excluding function "%s" as marked as internal' % declarations.full_name( func ) # this change was for 1.7 but also needed for 1.4 noncopy=['Camera','Frustum', 'Log' ] Modified: trunk/python-ogre/code_generators/ois/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ois/generate_code.py 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/code_generators/ois/generate_code.py 2009-01-24 05:00:41 UTC (rev 844) @@ -40,7 +40,8 @@ from pyplusplus.module_creator import sort_algorithms from pyplusplus.code_creators import include -import common_utils.extract_documentation as exdoc +# import common_utils.extract_documentation as exdoc +import testExtract as exdoc import common_utils.var_checker as varchecker import common_utils.ogre_properties as ogre_properties from common_utils import docit Deleted: trunk/python-ogre/demos/ogre/Demo_BspCollision.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_BspCollision.py 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/demos/ogre/Demo_BspCollision.py 2009-01-24 05:00:41 UTC (rev 844) @@ -1,212 +0,0 @@ -# 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. -# ----------------------------------------------------------------------------- - -## ----------------------------------------------------------------------------- -## Filename: BspCollision.py -## Description: Test the OgreRefApp module -## ----------------------------------------------------------------------------- -import sys -sys.path.insert(0,'..') -import PythonOgreConfig - - -import ogre.renderer.OGRE as ogre -import SampleFramework as sf ## note that we are forcing the OIS sample framework -import ogre.physics.OgreRefApp as OgreRefApp - -## As this demo does it's own key input, AND we want to support Ogre 1.2.x we need to cope with the -## change to OIS in ogre 1.3.x (current CVS version) - -if ogre.OgreVersionString[:2]=="12": - KC_SPACE = ogre.KC_SPACE -else: - import ogre.io.OIS as OIS - KC_SPACE = OIS.KC_SPACE - - -## Hacky globals -gBall = None -gTargetNode = None -gRsq = 0 - - -class BspCollisionListener (sf.FrameListener): - - def __init__(self, renderWindow, camera): - """ Initialise the frame listener""" - sf.FrameListener.__init__(self, renderWindow, camera) - self.camera = camera - self.timeUntilNextToggle = 0 - self.MAX_TIME_INCREMENT = 0.5 - - def _UpdateSimulation ( self, Event ): - OgreRefApp.World.getSingleton().simulationStep(Event.timeSinceLastFrame) - - def frameEnded(self, evt): - global gBall, gTargetNode, gRsq - ## Deal with time delays that are too large - ## If we exceed this limit, we ignore - if evt.timeSinceLastEvent > self.MAX_TIME_INCREMENT: - return True - - if self.timeUntilNextToggle >= 0: - self.timeUntilNextToggle -= evt.timeSinceLastFrame - - ## Call superclass - ret = sf.FrameListener.frameEnded(self, evt) - - if self._isToggleKeyDown(KC_SPACE): - self.timeUntilNextToggle = 2 - gBall.setPosition(self.camera.getPosition() + - self.camera.getDirection() * self.camera.getNearClipDistance() * 2) - gBall.setLinearVelocity(self.camera.getDirection() * 200) - gBall.setAngularVelocity(ogre.Vector3().ZERO) - - ## Move the targeter - gRsq.setRay(self.camera.getRealCamera().getCameraToViewportRay(0.5, 0.5)) - for queryResult in gRsq.execute(): - gTargetNode.setPosition(gRsq.getRay().getPoint(queryResult.distance)) - return ret - - def _moveCamera(self): - self.camera.yaw(self.rotationX) - self.camera.pitch(self.rotationY) - self.camera.translate(self.translateVector) # for using OgreRefApp - -class BspCollisionApplication (sf.Application): - def __init__(self): - "Init Render Application" - sf.Application.__init__(self) - self.BOX_SIZE = 15.0 - self.num_rows = 3 - - def __del__(self): - global gBall, gTargetNode, gRsq - "Close Render Application" - del ( gRsq ) - - # Override scene manager (use indoor instead of generic) - def _chooseSceneManager(self): - self.sceneManager = self.root.createSceneManager("BspSceneManager") - - def _createWorld(self): - ## Create BSP-specific world - self.world = OgreRefApp.World(self.sceneManager, OgreRefApp.World.WT_REFAPP_BSP) - - - def _createCamera(self): - """ when doing collisions with OgreRefApp Framework the camera is linked to the 'WORLD' - not to the scene manager""" - self.camera = self.world.createCamera('PlayerCam') - self.camera.setPosition( (0, 0, 500) ) - self.camera.lookAt( (0, 0, -300) ) - self.camera.NearClipDistance = 5 - - - def _createScene(self): - global gBall, gTargetNode, gRsq - self.sceneManager.setShadowTechnique(ogre.SHADOWTYPE_STENCIL_MODULATIVE) - ## Set ambient light - self.sceneManager.setAmbientLight( (0.2, 0.2, 0.2) ) - - ## Create a point light - l = self.sceneManager.createLight("MainLight") - l.setPosition(-100,50,100) - l.setAttenuation(8000,1,0,0) - - ## Setup World - self.world.setGravity( (0, 0, -60) ) - self.world.getSceneManager().setWorldGeometry("ogretestmap.bsp") - - ## modify camera for close work - self.camera.setNearClipDistance(10) - self.camera.setFarClipDistance(20000) - - ## Also change position, and set Quake-type orientation - ## Get random player start point - vp = self.sceneManager.getSuggestedViewpoint(True) - self.camera.setPosition(vp.position) - self.camera.pitch(ogre.Degree(d=90)) ## Quake uses X/Y horizon, Z up - self.camera.rotate(vp.orientation) - ## Don't yaw along variable axis, causes leaning - self.camera.setFixedYawAxis(True, ogre.Vector3().UNIT_Z) - ## Look at the boxes - self.camera.lookAt(-150,40,30) - - gBall = self.world.createBall("Ball", 7, vp.position + ogre.Vector3(0,0,80)) - gBall.setDynamicsEnabled(True) - gBall.getEntity().setMaterialName("Ogre/Eyes") - - box = self.world.createBox("shelf", 75, 125, 5, ogre.Vector3(-150, 40, 30)) - box.getEntity().setMaterialName("Examples/Rocky") - - - - for row in range (self.num_rows): - for i in range (self.num_rows-row): - row_size = (self.num_rows - row) * self.BOX_SIZE * 1.25 - name = "box" - name += str((row*self.num_rows) + i) - box = self.world.createBox(name, self.BOX_SIZE,self.BOX_SIZE,self.BOX_SIZE , - ogre.Vector3(-150, - 40 - (row_size * 0.5) + (i * self.BOX_SIZE * 1.25) , - 32.5 + (self.BOX_SIZE / 2) + (row * self.BOX_SIZE))) - box.setDynamicsEnabled(False, True) - box.getEntity().setMaterialName("Examples/10PointBlock") - - self.camera.setCollisionEnabled(False) - self.camera.getRealCamera().setQueryFlags(0) - - ## Create the targeting sphere - targetEnt = self.sceneManager.createEntity("testray", "sphere.mesh") - mat = ogre.MaterialManager.getSingleton().create("targeter", - ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) - Pass = mat.getTechnique(0).getPass(0) - tex = Pass.createTextureUnitState() - tex.setColourOperationEx(ogre.LBX_SOURCE1, ogre.LBS_MANUAL, ogre.LBS_CURRENT, - ogre.ColourValue().Red) - Pass.setLightingEnabled(False) - Pass.setSceneBlending(ogre.SBT_ADD) - Pass.setDepthWriteEnabled(False) - - - targetEnt.setMaterialName("targeter") - targetEnt.setCastShadows(False) - targetEnt.setQueryFlags(0) - gTargetNode = self.sceneManager.getRootSceneNode().createChildSceneNode() - gTargetNode.setScale(0.025, 0.025, 0.025) - gTargetNode.attachObject(targetEnt) - - gRsq = self.sceneManager.createRayQuery(ogre.Ray()) - gRsq.setSortByDistance(True, 1) - gRsq.setWorldFragmentType(ogre.SceneQuery.WFT_SINGLE_INTERSECTION) - - ## Create new frame listener - def _createFrameListener(self): - self.frameListener = BspCollisionListener(self.renderWindow, self.camera) - self.root.addFrameListener(self.frameListener) - - -if __name__ == '__main__': - try: - application = BspCollisionApplication() - application.go() - except ogre.OgreException, e: - print e - - - - - - - - Copied: trunk/python-ogre/demos/ogre/tofix/Demo_BspCollision.py (from rev 840, trunk/python-ogre/demos/ogre/Demo_BspCollision.py) =================================================================== --- trunk/python-ogre/demos/ogre/tofix/Demo_BspCollision.py (rev 0) +++ trunk/python-ogre/demos/ogre/tofix/Demo_BspCollision.py 2009-01-24 05:00:41 UTC (rev 844) @@ -0,0 +1,212 @@ +# 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. +# ----------------------------------------------------------------------------- + +## ----------------------------------------------------------------------------- +## Filename: BspCollision.py +## Description: Test the OgreRefApp module +## ----------------------------------------------------------------------------- +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + + +import ogre.renderer.OGRE as ogre +import SampleFramework as sf ## note that we are forcing the OIS sample framework +import ogre.physics.OgreRefApp as OgreRefApp + +## As this demo does it's own key input, AND we want to support Ogre 1.2.x we need to cope with the +## change to OIS in ogre 1.3.x (current CVS version) + +if ogre.OgreVersionString[:2]=="12": + KC_SPACE = ogre.KC_SPACE +else: + import ogre.io.OIS as OIS + KC_SPACE = OIS.KC_SPACE + + +## Hacky globals +gBall = None +gTargetNode = None +gRsq = 0 + + +class BspCollisionListener (sf.FrameListener): + + def __init__(self, renderWindow, camera): + """ Initialise the frame listener""" + sf.FrameListener.__init__(self, renderWindow, camera) + self.camera = camera + self.timeUntilNextToggle = 0 + self.MAX_TIME_INCREMENT = 0.5 + + def _UpdateSimulation ( self, Event ): + OgreRefApp.World.getSingleton().simulationStep(Event.timeSinceLastFrame) + + def frameEnded(self, evt): + global gBall, gTargetNode, gRsq + ## Deal with time delays that are too large + ## If we exceed this limit, we ignore + if evt.timeSinceLastEvent > self.MAX_TIME_INCREMENT: + return True + + if self.timeUntilNextToggle >= 0: + self.timeUntilNextToggle -= evt.timeSinceLastFrame + + ## Call superclass + ret = sf.FrameListener.frameEnded(self, evt) + + if self._isToggleKeyDown(KC_SPACE): + self.timeUntilNextToggle = 2 + gBall.setPosition(self.camera.getPosition() + + self.camera.getDirection() * self.camera.getNearClipDistance() * 2) + gBall.setLinearVelocity(self.camera.getDirection() * 200) + gBall.setAngularVelocity(ogre.Vector3().ZERO) + + ## Move the targeter + gRsq.setRay(self.camera.getRealCamera().getCameraToViewportRay(0.5, 0.5)) + for queryResult in gRsq.execute(): + gTargetNode.setPosition(gRsq.getRay().getPoint(queryResult.distance)) + return ret + + def _moveCamera(self): + self.camera.yaw(self.rotationX) + self.camera.pitch(self.rotationY) + self.camera.translate(self.translateVector) # for using OgreRefApp + +class BspCollisionApplication (sf.Application): + def __init__(self): + "Init Render Application" + sf.Application.__init__(self) + self.BOX_SIZE = 15.0 + self.num_rows = 3 + + def __del__(self): + global gBall, gTargetNode, gRsq + "Close Render Application" + del ( gRsq ) + + # Override scene manager (use indoor instead of generic) + def _chooseSceneManager(self): + self.sceneManager = self.root.createSceneManager("BspSceneManager") + + def _createWorld(self): + ## Create BSP-specific world + self.world = OgreRefApp.World(self.sceneManager, OgreRefApp.World.WT_REFAPP_BSP) + + + def _createCamera(self): + """ when doing collisions with OgreRefApp Framework the camera is linked to the 'WORLD' + not to the scene manager""" + self.camera = self.world.createCamera('PlayerCam') + self.camera.setPosition( (0, 0, 500) ) + self.camera.lookAt( (0, 0, -300) ) + self.camera.NearClipDistance = 5 + + + def _createScene(self): + global gBall, gTargetNode, gRsq + self.sceneManager.setShadowTechnique(ogre.SHADOWTYPE_STENCIL_MODULATIVE) + ## Set ambient light + self.sceneManager.setAmbientLight( (0.2, 0.2, 0.2) ) + + ## Create a point light + l = self.sceneManager.createLight("MainLight") + l.setPosition(-100,50,100) + l.setAttenuation(8000,1,0,0) + + ## Setup World + self.world.setGravity( (0, 0, -60) ) + self.world.getSceneManager().setWorldGeometry("ogretestmap.bsp") + + ## modify camera for close work + self.camera.setNearClipDistance(10) + self.camera.setFarClipDistance(20000) + + ## Also change position, and set Quake-type orientation + ## Get random player start point + vp = self.sceneManager.getSuggestedViewpoint(True) + self.camera.setPosition(vp.position) + self.camera.pitch(ogre.Degree(d=90)) ## Quake uses X/Y horizon, Z up + self.camera.rotate(vp.orientation) + ## Don't yaw along variable axis, causes leaning + self.camera.setFixedYawAxis(True, ogre.Vector3().UNIT_Z) + ## Look at the boxes + self.camera.lookAt(-150,40,30) + + gBall = self.world.createBall("Ball", 7, vp.position + ogre.Vector3(0,0,80)) + gBall.setDynamicsEnabled(True) + gBall.getEntity().setMaterialName("Ogre/Eyes") + + box = self.world.createBox("shelf", 75, 125, 5, ogre.Vector3(-150, 40, 30)) + box.getEntity().setMaterialName("Examples/Rocky") + + + + for row in range (self.num_rows): + for i in range (self.num_rows-row): + row_size = (self.num_rows - row) * self.BOX_SIZE * 1.25 + name = "box" + name += str((row*self.num_rows) + i) + box = self.world.createBox(name, self.BOX_SIZE,self.BOX_SIZE,self.BOX_SIZE , + ogre.Vector3(-150, + 40 - (row_size * 0.5) + (i * self.BOX_SIZE * 1.25) , + 32.5 + (self.BOX_SIZE / 2) + (row * self.BOX_SIZE))) + box.setDynamicsEnabled(False, True) + box.getEntity().setMaterialName("Examples/10PointBlock") + + self.camera.setCollisionEnabled(False) + self.camera.getRealCamera().setQueryFlags(0) + + ## Create the targeting sphere + targetEnt = self.sceneManager.createEntity("testray", "sphere.mesh") + mat = ogre.MaterialManager.getSingleton().create("targeter", + ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) + Pass = mat.getTechnique(0).getPass(0) + tex = Pass.createTextureUnitState() + tex.setColourOperationEx(ogre.LBX_SOURCE1, ogre.LBS_MANUAL, ogre.LBS_CURRENT, + ogre.ColourValue().Red) + Pass.setLightingEnabled(False) + Pass.setSceneBlending(ogre.SBT_ADD) + Pass.setDepthWriteEnabled(False) + + + targetEnt.setMaterialName("targeter") + targetEnt.setCastShadows(False) + targetEnt.setQueryFlags(0) + gTargetNode = self.sceneManager.getRootSceneNode().createChildSceneNode() + gTargetNode.setScale(0.025, 0.025, 0.025) + gTargetNode.attachObject(targetEnt) + + gRsq = self.sceneManager.createRayQuery(ogre.Ray()) + gRsq.setSortByDistance(True, 1) + gRsq.setWorldFragmentType(ogre.SceneQuery.WFT_SINGLE_INTERSECTION) + + ## Create new frame listener + def _createFrameListener(self): + self.frameListener = BspCollisionListener(self.renderWindow, self.camera) + self.root.addFrameListener(self.frameListener) + + +if __name__ == '__main__': + try: + application = BspCollisionApplication() + application.go() + except ogre.OgreException, e: + print e + + + + + + + + Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/environment.py 2009-01-24 05:00:41 UTC (rev 844) @@ -474,28 +474,13 @@ if isWindows(): PATH_LIB_THREAD=Config.PATH_LIB_Thread_STATIC PATH_LIB_DATETIME=Config.PATH_LIB_date_time_STATIC - if _STABLE: - base = 'boost_1_36_0' - lib = 'boost_python-vc90-mt-1_36' - versionBase = '1_36' ## the version used on the library name - else: - base = 'boost_1_37_0' - lib = 'boost_python-vc90-mt-1_37' - PATH_LIB = Config.PATH_LIB_Boost - - # change to handle static boost linking... - if BOOST_STATIC: - lib = 'libboost_python-vc90-mt-1_37' - PATH_LIB = Config.PATH_LIB_Boost_STATIC - - versionBase = '1_37' ## the version used on the library name + base = 'boost_1_37_0' + lib = 'boost_python-vc90-mt-1_37' + PATH_LIB = Config.PATH_LIB_Boost + versionBase = '1_37' ## the version used on the library name else: - if _STABLE: - base = 'boost_1_34_1' - versionBase = '1_34' ## the version used on the library name - else: - base = 'boost_1_37_0' - versionBase = '1_37' ## the version used on the library name + base = 'boost_1_37_0' + versionBase = '1_37' ## the version used on the library name if isLinux() or isMac(): bjambase = 'boost-jam-3.1.17' @@ -523,9 +508,9 @@ ## and now boost [0, tar + ' zxf ' + os.path.join(downloadPath, base) + '.tar.gz', ''], [0,'chmod -R +rw *', os.path.join(os.getcwd(), base ) ], - [0, sed_ + " 's/BJAM_CONFIG=\"\"/BJAM_CONFIG=release/' "+base+"/configure", '' ], - [0, sed_ + " s/'BOOST_PYTHON_MAX_ARITY 15'/'BOOST_PYTHON_MAX_ARITY 19'/ "+base+"/boost/python/detail/preprocessor.hpp", ''], - [0, sed_ + ' 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_ + " 's/BJAM_CONFIG=\"\"/BJAM_CONFIG=release/' "+base+"/configure", '' ], +# [0, sed_ + " s/'BOOST_PYTHON_MAX_ARITY 15'/'BOOST_PYTHON_MAX_ARITY 19'/ "+base+"/boost/python/detail/preprocessor.hpp", ''], +# [0, sed_ + ' 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,"./configure --with-libraries=python,thread,date_time --prefix=%s --without-icu --with-bjam=../root/usr/bin/bjam" % PREFIX, os.path.join(os.getcwd(), base )], [0,'make', os.path.join(os.getcwd(), base )], [0,'make install', os.path.join(os.getcwd(), base )], @@ -546,7 +531,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 ',os.path.join(os.getcwd(),base)] # --toolset=msvc-8 + [0,os.path.join(os.getcwd(), bjambase, "bjam.exe") + ' release --with-python --with-thread --with-date_time ',os.path.join(os.getcwd(),base)] # --toolset=msvc-8 ] if not isWindows(): @@ -600,34 +585,19 @@ libraries = myLibraries if isWindows(): + version="1.6.1" + source = [ + [ wget, "http://downloads.sourceforge.net/ogre/OgreSDKSetup1.6.1_VC90.exe", downloadPath], + #[ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0.zip", downloadPath], + ] + buildCmds = [ + [0, os.path.join(downloadPath, "OgreSDKSetup1.6.1_VC90.exe"), '' ] + #[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.0.patch -p0 ", os.getcwd()], + #[0,'echo Please use MSVC Express Edition to build Ogre Release.',''] + ] - if _STABLE or not _STABLE: ## temp force to this version... - version="1.6.0" - source = [ - [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], - [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0.zip", downloadPath], - ] - buildCmds = [ - [0, unzip + os.path.join(downloadPath,"ogre-v1-6-0.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.0.patch -p0 ", os.getcwd()], - [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] - ] -# else: -# -# version="trunk" -# source = [ -# [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], -# [ svn, "https://svn.ogre3d.org/svnroot/ogre/trunk", 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: pchstop = 'python_ogre_precompiled.h' @@ -636,17 +606,17 @@ libs=[boost.lib, 'OgreMain'] lib_dirs = [ boost.PATH_LIB - , Config.PATH_LIB_Ogre_CEGUIRenderer +# , Config.PATH_LIB_Ogre_CEGUIRenderer , Config.PATH_LIB_Ogre_OgreMain - , Config.PATH_LIB_Ogre_Dependencies #needed for ceguibase.lib etc - , Config.PATH_LIB_CEGUI +# , Config.PATH_LIB_Ogre_Dependencies #needed for ceguibase.lib etc +# , Config.PATH_LIB_CEGUI ] include_dirs = [ Config.PATH_Boost , Config.PATH_INCLUDE_Ogre - , Config.PATH_INCLUDE_NEDMALLOC + #, Config.PATH_INCLUDE_NEDMALLOC ] LINKFLAGS = '' - externalFiles=['OgreMain.dll', 'OgreGuiRender.dll', boost.lib+'.dll'] + elif isLinux(): if _STABLE: version = "1.4" @@ -718,13 +688,13 @@ LINKFLAGS = '' cflags += '' - CheckIncludes=['boost/python.hpp', 'Ogre.h'] + #CheckIncludes=['boost/python.hpp', 'Ogre.h'] class ois: active = True pythonModule = True - version= "1.2" + version= "1.0" name = 'ois' cflags='' parent = "ogre/io" @@ -768,7 +738,8 @@ pchbuild = 'buildpch.cpp' pchincludes = ['boost/python.hpp', 'OIS.h'] - libs=['OIS_Static',boost.lib] + libs=['OIS',boost.lib] + else: libs=['OIS',boost.lib] libs.append ( boost_python_index.lib ) @@ -789,7 +760,7 @@ LINKFLAGS = "-l%s" % boost_python_index.lib class ogrerefapp: - active = True + active = False ## making this false as replaced by OgreODE etc.. pythonModule = True version = ogre.version # same as the Ogre version name = 'ogrerefapp' @@ -859,7 +830,7 @@ , Config.PATH_Newton # only one path for Newton , Config.PATH_INCLUDE_Ogre , Config.PATH_INCLUDE_OgreNewt - , Config.PATH_INCLUDE_Ogre_Dependencies #needed for OIS/OIS.h + # , Config.PATH_INCLUDE_Ogre_Dependencies #needed for OIS/OIS.h ] lib_dirs = [ boost.PATH_LIB ,Config.PATH_LIB_Newton @@ -880,6 +851,7 @@ else: version = "0.6.2b" if isWindows(): + version = "0.5.0b" ### I'm forceing this as using the Ogre SDK if _PreCompiled: pchstop = 'cegui.h' pchbuild = 'buildpch.cpp' @@ -934,7 +906,7 @@ ,Config.PATH_CEGUI , Config.PATH_INCLUDE_Ogre_CEGUIRenderer , Config.PATH_INCLUDE_Ogre - , Config.PATH_INCLUDE_Ogre_Dependencies ## needed as OgreCEGUI uses CEGUI/.. in #includes + #, Config.PATH_INCLUDE_Ogre_Dependencies ## needed as OgreCEGUI uses CEGUI/.. in #includes ] lib_dirs = [ boost.PATH_LIB @@ -976,7 +948,7 @@ baseDir = os.path.join(os.getcwd(),"ode-0.10.1") if not isWindows(): source = [ - ["wget", "http://downloads.sourceforge.net/opende/ode-0.10.1.tar.gz",downloadPath] + [wget, "http://downloads.sourceforge.net/opende/ode-0.10.1.tar.gz",downloadPath] ] buildCmds = [ # FIXME: Should this untar not use the unTarGz method mentioned above? @@ -990,7 +962,7 @@ ] else: source = [ - ["wget", "http://downloads.sourceforge.net/opende/ode-0.10.1.zip",downloadPath] + [wget, "http://downloads.sourceforge.net/opende/ode-0.10.1.zip",downloadPath] ] buildCmds = [ [0, unzip + os.path.join(downloadPath,"ode-src-0.10.1.zip"), ''], @@ -1170,7 +1142,7 @@ Config.PATH_LIB_OIS ] CheckIncludes=[] - libs=[ boost.lib, 'OgreMain', 'OIS_Static' ] + libs=[ boost.lib, 'OgreMain', 'OIS' ] if os.name=="nt": libs.append ( "User32" ) # needed for static linking else: @@ -1206,6 +1178,16 @@ name='particleuniverse' parent="ogre/addons" cflags="" + source = [ + [wget, "http://www.fxpression.com/files/download/ParticleUniverseV0.81.zip", downloadPath] + ] + + buildCmds = [ +# [0, unzip + os.path.join(downloadPath, "ParticleUniverseV0.81.zip"), Config.PATH_Ogre], + [0, "patch -s -N -i " + os.path.join(os.getcwd(),"python-ogre","patch","ParticleUniverse_0.8.patch") + " -p0 ", os.path.join(Config.PATH_Ogre, 'Plugins','ParticleUniverse') ], + + [0, "echo *** NOW build ParticleUniverse with MSVC from " + Config.PATH_Ogre, ''] + ] include_dirs = [ Config.PATH_Boost, Config.PATH_INCLUDE_Ogre, Config.PATH_INCLUDE_particleuniverse @@ -1221,7 +1203,7 @@ ModuleName="particleuniverse" class nxogre: - active = True + active = False pythonModule = True version="0.22T5" name='nxogre' @@ -1549,7 +1531,7 @@ class bullet: active = True pythonModule = True - version= "2.72" + version= "2.73" name='bullet' base = "bullet-" + version baseDir = os.path.join(os.getcwd(), base) @@ -1572,10 +1554,10 @@ ] if not isWindows(): source=[ - [wget, "http://bullet.googlecode.com/files/"+base+".tgz", downloadPath] + [wget, "http://bullet.googlecode.com/files/"+base+"-sp1.tgz", downloadPath] ] buildCmds = [ - [0, "tar zxf " +os.path.join(downloadPath, base)+".tgz", ''], + [0, "tar zxf " +os.path.join(downloadPath, base)+"-sp1.tgz", ''], # [0, "./autogen.sh", baseDir], # [0, "./configure --prefix=%s " %(PREFIX), baseDir], [0, "cmake . -DCMAKE_INSTALL_PREFIX:PATH=%s" % PREFIX, baseDir], @@ -1588,10 +1570,10 @@ ] else: source=[ - [wget, "http://bullet.googlecode.com/files/"+base+".zip", downloadPath] + [wget, "http://bullet.googlecode.com/files/"+base+"-sp1.zip", downloadPath] ] buildCmds = [ - [0, unzip +os.path.join(downloadPath, base)+".zip", ''], + [0, unzip +os.path.join(downloadPath, base)+"-sp1.zip", ''], ] ModuleName = 'bullet' @@ -1616,7 +1598,7 @@ , Config.PATH_INCLUDE_Bullet , os.path.join(Config.PATH_OgreBullet, 'Collisions' ) , Config.PATH_INCLUDE_Ogre - , Config.PATH_INCLUDE_Ogre_Dependencies +# , Config.PATH_INCLUDE_Ogre_Dependencies ] lib_dirs = [ boost.PATH_LIB ,Config.PATH_LIB_Bullet @@ -1654,7 +1636,7 @@ , os.path.join(Config.PATH_OgreBullet, 'Collisions' ) , os.path.join(Config.PATH_OgreBullet, 'Dynamics' ) , Config.PATH_INCLUDE_Ogre - , Config.PATH_INCLUDE_Ogre_Dependencies +# , Config.PATH_INCLUDE_Ogre_Dependencies ] lib_dirs = [ boost.PATH_LIB ,Config.PATH_LIB_Bullet @@ -1766,7 +1748,7 @@ ] lib_dirs = [boost.PATH_LIB, Config.PATH_LIB_Ogre_OgreMain, - os.path.join(Config.PATH_LIB_Ogre_OgreMain, 'OGRE') + Config.PATH_LIB_pcz ] CheckIncludes=[] libs=[ boost.lib, 'Plugin_PCZSceneManager', 'OgreMain' ] Modified: trunk/python-ogre/patch/ParticleUniverse_0.8.patch =================================================================== --- trunk/python-ogre/patch/ParticleUniverse_0.8.patch 2009-01-24 03:44:38 UTC (rev 843) +++ trunk/python-ogre/patch/ParticleUniverse_0.8.patch 2009-01-24 05:00:41 UTC (rev 844) @@ -9,10 +9,10 @@ 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(); +- std::vector<T*>::iterator it; +- std::vector<T*>::iterator itEnd = list->end(); ++ typename std::vector<T*>::iterator it; ++ typename std::vector<T*>::iterator itEnd = list->end(); for (it = list->begin(); it != itEnd; ++it) { (*it)->_prepare(technique); @@ -20,10 +20,10 @@ 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(); +- std::vector<T*>::iterator it; +- std::vector<T*>::iterator itEnd = list->end(); ++ typename std::vector<T*>::iterator it; ++ typename std::vector<T*>::iterator itEnd = list->end(); for (it = list->begin(); it != itEnd; ++it) { (*it)->_notifyStart(); @@ -31,10 +31,10 @@ 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(); +- std::vector<T*>::iterator it; +- std::vector<T*>::iterator itEnd = list->end(); ++ typename std::vector<T*>::iterator it; ++ typename std::vector<T*>::iterator itEnd = list->end(); for (it = list->begin(); it != itEnd; ++it) { (*it)->_notifyStop(); @@ -42,10 +42,10 @@ 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(); +- std::vector<T*>::iterator it; +- std::vector<T*>::iterator itEnd = list->end(); ++ typename std::vector<T*>::iterator it; ++ typename std::vector<T*>::iterator itEnd = list->end(); for (it = list->begin(); it != itEnd; ++it) { (*it)->_preProcessParticles(technique, timeElapsed); @@ -53,10 +53,10 @@ 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(); +- std::vector<T*>::iterator it; +- std::vector<T*>::iterator itEnd = list->end(); ++ typename std::vector<T*>::iterator it; ++ typename std::vector<T*>::iterator itEnd = list->end(); for (it = list->begin(); it != itEnd; ++it) { (*it)->_processParticle(particleTechnique, particle, timeElapsed, firstParticle); @@ -64,10 +64,10 @@ 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(); +- std::vector<T*>::iterator it; +- std::vector<T*>::iterator itEnd = list->end(); ++ typename std::vector<T*>::iterator it; ++ typename std::vector<T*>::iterator itEnd = list->end(); for (it = list->begin(); it != itEnd; ++it) { (*it)->_postProcessParticles(technique, timeElapsed); @@ -78,8 +78,8 @@ SpatialHashTable(void) : mTableSize(50), mCellDimension(15), -- mCellOverlap(5) -+ mCellOverlap(5), +- mCellOverlap(5), ++ mCellOverlap(5) { _initialise(); }; @@ -93,8 +93,8 @@ if (isAttached()) { // Use the position of the parent node in this case. -- position = getParentNode()->getPosition(); -+ position = getParentNode()->getWorldPosition(); +- position = getParentNode()->getWorldPosition(); ++ position = getParentNode()->getPosition(); mDerivedPosition = position; populateAlignedBox(mBox, mDerivedPosition, mWidth, mHeight, mDepth); _calculateBounds(); @@ -105,8 +105,8 @@ // Use the position of the parent node in this case. if (isAttached()) { -- position = getParentNode()->getPosition(); -+ position = getParentNode()->getWorldPosition(); +- position = getParentNode()->getWorldPosition(); ++ position = getParentNode()->getPosition(); mDerivedPosition = position; } } @@ -117,8 +117,8 @@ if (isAttached()) { // Use the position of the parent node in this case. -- position = getParentNode()->getPosition(); -+ position = getParentNode()->getWorldPosition(); +- position = getParentNode()->getWorldPosition(); ++ position = getParentNode()->getPosition(); mDerivedPosition = position; mSphere.setCenter(mDerivedPosition); } @@ -129,8 +129,8 @@ { if (isAttached()) { -- position = getParentNode()->getPosition(); -+ position = getParentNode()->getWorldPosition(); +- position = getParentNode()->getWorldPosition(); ++ position = getParentNode()->getPosition(); mDerivedPosition = position; } } @@ -141,8 +141,8 @@ if (!mTimeController) { mTimeSinceLastVisible = 0; -- mLastVisibleFrame = Ogre::Root::getSingleton().getNextFrameNumber(); -+ mLastVisibleFrame = Ogre::Root::getSingleton().getCurrentFrameNumber(); +- mLastVisibleFrame = Ogre::Root::getSingleton().getCurrentFrameNumber(); ++ mLastVisibleFrame = Ogre::Root::getSingleton().getNextFrameNumber(); Ogre::ControllerManager& controllerManager = Ogre::ControllerManager::getSingleton(); Ogre::ControllerValueRealPtr particleSystemUpdateValue(new ParticleSystemUpdateValue(this)); mTimeController = controllerManager.createFrameTimePassthroughController(particleSystemUpdateValue); @@ -150,8 +150,8 @@ void ParticleSystem::_notifyCurrentCamera(Ogre::Camera* cam) { Ogre::MovableObject::_notifyCurrentCamera(cam); -- mLastVisibleFrame = Ogre::Root::getSingleton().getNextFrameNumber(); -+ mLastVisibleFrame = Ogre::Root::getSingleton().getCurrentFrameNumber(); +- mLastVisibleFrame = Ogre::Root::getSingleton().getCurrentFrameNumber(); ++ mLastVisibleFrame = Ogre::Root::getSingleton().getNextFrameNumber(); mTimeSinceLastVisible = 0.0f; // Notify all techniques @@ -159,8 +159,8 @@ { if (mNonvisibleUpdateTimeoutSet) { -- long frameDiff = Ogre::Root::getSingleton().getNextFrameNumber() - mLastVisibleFrame; -+ long frameDiff = Ogre::Root::getSingleton().getCurrentFrameNumber() - mLastVisibleFrame; +- long frameDiff = Ogre::Root::getSingleton().getCurrentFrameNumber() - mLastVisibleFrame; ++ long frameDiff = Ogre::Root::getSingleton().getNextFrameNumber() - mLastVisibleFrame; if (frameDiff > 1 || frameDiff < 0) { mTimeSinceLastVisible += timeElapsed; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |