Author: ArcRiley Date: 2008-02-19 10:38:18 -0500 (Tue, 19 Feb 2008) New Revision: 944
Modified: trunk/pysoy/src/scenes/Scene.pxi trunk/pysoy/src/scenes/soy.scenes.pxd trunk/pysoy/src/scenes/soy.scenes.pyx Log: #930 : toward SceneLoop (mostly commented out for now) Modified: trunk/pysoy/src/scenes/Scene.pxi =================================================================== --- trunk/pysoy/src/scenes/Scene.pxi 2008-02-19 14:57:13 UTC (rev 943) +++ trunk/pysoy/src/scenes/Scene.pxi 2008-02-19 15:38:18 UTC (rev 944) @@ -17,9 +17,7 @@ # # $Id$ -cimport soy.bodies.lights - -cdef class Scene : +cdef class Scene (soy._internals.Loopable) : '''PySoy Scene Scenes are containers in physics space for bodies, joints, and shapes. @@ -69,7 +67,50 @@ if report == [] : return '<Empty Scene>' else : return '<Scene with %s>' % ', '.join(report) + ''' + This is not ready yet + cdef int _loop(self) : + cdef int _i + self._updateTime() + self._callfields._empty() + self._givefields._empty() + self._bodies.lock() + for _i from 0 <= _i < _scene._bodies.current : + if isinstance(<soy.bodies._bodies.Body> _scene._bodies.list[j], + soy.bodies.fields.Field) : + # Make sure every field is in givefields & _give each one + if not _givefields._has_key(<void*> _scene._bodies.list[j]) : + (<soy.bodies.fields.Field> _scene._bodies.list[j])._give(0) + _givefields._insert(<void*> _scene._bodies.list[j]) + for j from 0 <= j < _scene._bodies.current : + if isinstance(<soy.bodies._bodies.Body> _scene._bodies.list[j], + soy.bodies.fields.Field) : + # Apply fields; add incompletly applied fiels to the list + if not (<soy.bodies.fields.Field> _scene._bodies.list[j])._apply() : + _callfields._insert(_scene._bodies.list[j]) + # Apply any outstanding fields + _callfields._foreach(_runField, NULL) + + _step = _scene._steps() + if _step > _maxstep : + _maxstep = _step + _scene._stepLock() + for j from 0 <= j < _step : + _scene._updateTime() + _givefields._foreach(_prerunField, NULL) + _callfields._empty() + ode.dSpaceCollide(_scene._spaceID, NULL, _callback) + ode.dWorldQuickStep(_scene._worldID, _scene._stepSize) + ode.dJointGroupEmpty(_contactgroup) + if j != 0 : + _callfields._foreach(_runField, NULL) + _scene._stepUnLock() + _scene._bodies.unlock() + return 100 + + ''' + cdef void _coreRender(self) : cdef int i cdef float _ambientLight[4] Modified: trunk/pysoy/src/scenes/soy.scenes.pxd =================================================================== --- trunk/pysoy/src/scenes/soy.scenes.pxd 2008-02-19 14:57:13 UTC (rev 943) +++ trunk/pysoy/src/scenes/soy.scenes.pxd 2008-02-19 15:38:18 UTC (rev 944) @@ -21,12 +21,11 @@ cimport glib cimport ode cimport py -cimport stdio cimport soy._internals cdef void* _getScenes ( ) -cdef class Scene : +cdef class Scene (soy._internals.Loopable) : cdef ode.dWorldID _worldID cdef ode.dSpaceID _spaceID cdef soy._internals.Children _bodies Modified: trunk/pysoy/src/scenes/soy.scenes.pyx =================================================================== --- trunk/pysoy/src/scenes/soy.scenes.pyx 2008-02-19 14:57:13 UTC (rev 943) +++ trunk/pysoy/src/scenes/soy.scenes.pyx 2008-02-19 15:38:18 UTC (rev 944) @@ -26,13 +26,19 @@ __version__ = 'Trunk (r'+'$Rev$'[6:-2]+')' cimport math - +cimport stdio from soy._internals cimport _time +''' For when this is no longer in _coreLoop +cdef soy._internals.LoopThread _scenes +_scenes = soy._internals.LoopThread('SceneLoop') +''' + +cimport soy.colors cimport soy.joints +cimport soy.bodies._bodies cimport soy.bodies.fields -cimport soy.bodies._bodies -cimport soy.colors +cimport soy.bodies.lights include "_getScenes.pxi" include "Scene.pxi" _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn