Author: ArcRiley Date: 2008-05-15 19:54:16 -0400 (Thu, 15 May 2008) New Revision: 1258
Modified: trunk/pysoy/examples/shapes.py trunk/pysoy/include/soy.models.pxd trunk/pysoy/src/bodies/Body.pym trunk/pysoy/src/models/Axis.pym trunk/pysoy/src/models/Billboard.pym trunk/pysoy/src/models/Camera.pym trunk/pysoy/src/models/Liquid.pym trunk/pysoy/src/models/Mesh.pym trunk/pysoy/src/models/Model.pym trunk/pysoy/src/models/Shape.pym trunk/pysoy/src/models/Sun.pym Log: Ticket #901 : * more Pyrex 0.9.8 code updates, these mostly for soy.models Modified: trunk/pysoy/examples/shapes.py =================================================================== --- trunk/pysoy/examples/shapes.py 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/examples/shapes.py 2008-05-15 23:54:16 UTC (rev 1258) @@ -7,7 +7,7 @@ scr = soy.Screen() tex = soy.transports.File('media/pysoy_logo.soy')['gimp'] sleep(.1) # Hold your horses, buddy! -win = soy.Window(scr, 'Mesh shape test', tex) +win = soy.Window(scr, 'Mesh shape test') cam = soy.bodies.Camera(sce) cam.position = (0.0, 0.0, 20.0) lig = soy.bodies.Light(sce) Modified: trunk/pysoy/include/soy.models.pxd =================================================================== --- trunk/pysoy/include/soy.models.pxd 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/include/soy.models.pxd 2008-05-15 23:54:16 UTC (rev 1258) @@ -22,16 +22,24 @@ cimport stdio cimport soy._datatypes cimport soy._internals +cimport soy.bodies cimport soy.materials cimport soy.textures cimport soy.shapes +# +# Forward declarations +# +cdef class soy.bodies.Body + + cdef class Model : cdef void* _mutex # # WindowLoop functions - cdef void _render ( self, void* ) + cdef void _render ( self, soy.bodies.Body ) cdef void _calcFogCoords ( self, float ) + cdef void _calcFogCoords ( self, float ) cdef class Mesh (Model) : Modified: trunk/pysoy/src/bodies/Body.pym =================================================================== --- trunk/pysoy/src/bodies/Body.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/bodies/Body.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -459,7 +459,7 @@ self._getModelview(_mtx) gl.glPushMatrix() gl.glMultMatrixf(_mtx) - self._model._render(<void*> self) + self._model._render(self) gl.glPopMatrix() Modified: trunk/pysoy/src/models/Axis.pym =================================================================== --- trunk/pysoy/src/models/Axis.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Axis.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -3,16 +3,16 @@ # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ @@ -29,7 +29,7 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : + cdef void _render(self, soy.bodies.Body _body) : gl.glPushMatrix() gl.glDisable(gl.GL_CULL_FACE) gl.glDisable(gl.GL_DEPTH_TEST) Modified: trunk/pysoy/src/models/Billboard.pym =================================================================== --- trunk/pysoy/src/models/Billboard.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Billboard.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -53,7 +53,7 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : + cdef void _render(self, soy.bodies.Body _body) : cdef float _mmat[16] # self._material._coreBind() Modified: trunk/pysoy/src/models/Camera.pym =================================================================== --- trunk/pysoy/src/models/Camera.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Camera.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -3,16 +3,16 @@ # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ @@ -29,7 +29,7 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : + cdef void _render(self, soy.bodies.Body _body) : gl.glPushMatrix() gl.glScalef(0.1,0.1,0.1) gl.glDisable(gl.GL_CULL_FACE) Modified: trunk/pysoy/src/models/Liquid.pym =================================================================== --- trunk/pysoy/src/models/Liquid.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Liquid.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -80,12 +80,11 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : + cdef void _render(self, soy.bodies.Body _body) : cdef int _i - cdef soy.scenes.Scene _scene cdef ode.dReal* _pos cdef float _halfSize[3] - _pos = (<soy.bodies.Body> _body)._position + _pos = _body._position _halfSize[0] = self._size[0]/2.0 _halfSize[1] = self._size[1]/2.0 _halfSize[2] = self._size[2]/2.0 @@ -114,11 +113,10 @@ gl.glTranslatef(-pos[0],-pos[1], -pos[2]) # # We need not _iterStart here since _bodies is already iterating via Scene - _scene = <soy.scenes.Scene> (<soy.bodies.Body> _body)._scene - for _i from 0 <= _i < _scene._bodies._current : - if _body != (<void*> _scene._bodies._list[_i]) : - (<soy.bodies.Body> _scene._bodies._list[_i])._calcFogCoords() - (<soy.bodies.Body> _scene._bodies._list[_i])._render() + for _i from 0 <= _i < _body._scene._bodies._current : + if <void*> _body != (_body._scene._bodies._list[_i]) : + (<soy.bodies.Body> _body._scene._bodies._list[_i])._calcFogCoords() + (<soy.bodies.Body> _body._scene._bodies._list[_i])._render() gl.glPopMatrix() gl.glDisableClientState(gl.GL_FOG_COORDINATE_ARRAY_EXT) gl.glDisable(gl.GL_FOG) Modified: trunk/pysoy/src/models/Mesh.pym =================================================================== --- trunk/pysoy/src/models/Mesh.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Mesh.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -128,9 +128,9 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : + cdef void _render(self, soy.bodies.Body _body) : py.PyThread_acquire_lock(self._mutex, 1) - self._mates._render(_body) + self._mates._render(<void*> _body) py.PyThread_release_lock(self._mutex) # Modified: trunk/pysoy/src/models/Model.pym =================================================================== --- trunk/pysoy/src/models/Model.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Model.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -49,7 +49,7 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : + cdef void _render(self, soy.bodies.Body _body) : return cdef void _calcFogCoords(self, float _depth) : Modified: trunk/pysoy/src/models/Shape.pym =================================================================== --- trunk/pysoy/src/models/Shape.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Shape.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -56,30 +56,28 @@ # WindowLoop Functions # - cdef void _render(self, void* _body) : - cdef soy.shapes.Shape _shape + cdef void _render(self, soy.bodies.Body _body) : cdef int _shapeclass # # Don't attempt to render a non-existant shape - if (<soy.bodies.Body> _body)._shape is None : + if _body._shape is None : return # - # Grab the body's shape - _shape = (<soy.bodies.Body> _body)._shape - _shapeclass = ode.dGeomGetClass(_shape._geomID) + # Grab the shape's class + _shapeclass = ode.dGeomGetClass(_body._shape._geomID) # # Bind the material self._material._coreBind() # # Render the specific shape if _shapeclass == ode.dSphereClass : - self._renderSphere(_shape) + self._renderSphere(_body._shape) elif _shapeclass == ode.dCapsuleClass : - self._renderCapsule(_shape) + self._renderCapsule(_body._shape) elif _shapeclass == ode.dBoxClass : - self._renderBox(_shape) + self._renderBox(_body._shape) elif _shapeclass == ode.dRayClass : - self._renderRay(_shape) + self._renderRay(_body._shape) # # Unbind the material self._material._coreUnBind() Modified: trunk/pysoy/src/models/Sun.pym =================================================================== --- trunk/pysoy/src/models/Sun.pym 2008-05-15 22:19:30 UTC (rev 1257) +++ trunk/pysoy/src/models/Sun.pym 2008-05-15 23:54:16 UTC (rev 1258) @@ -3,16 +3,16 @@ # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ @@ -22,11 +22,11 @@ This models class renders a sun. ''' - - ############################################################################ - # - # Python functions - # + + ############################################################################ + # + # Python functions + # def __cinit__(self, **kwargs ) : if kwargs.has_key('centerMat') : @@ -150,7 +150,7 @@ # WindowLoop Functions # - cdef void _render(self, void* body) : + cdef void _render(self, soy.bodies.Body _body) : cdef int _i cdef float _mmat[16] cdef float _xSize _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn