Author: EricStein Date: 2007-07-06 17:37:20 -0400 (Fri, 06 Jul 2007) New Revision: 381
Added: trunk/pysoy/src/_core-common/_callback.pxi Modified: trunk/pysoy/src/_core-common/_coreLoop.pxi trunk/pysoy/src/_core-osx/soy._core.pyx trunk/pysoy/src/_core-server/soy._core.pyx trunk/pysoy/src/_core-w32/soy._core.pyx trunk/pysoy/src/_core-x11/soy._core.pyx Log: Moved _callback to its own file & updated pyxs. Copied: trunk/pysoy/src/_core-common/_callback.pxi (from rev 380, trunk/pysoy/src/_core-common/_coreLoop.pxi) =================================================================== --- trunk/pysoy/src/_core-common/_callback.pxi (rev 0) +++ trunk/pysoy/src/_core-common/_callback.pxi 2007-07-06 21:37:20 UTC (rev 381) @@ -0,0 +1,43 @@ +# PySoy _callback +# +# Copyright (C) 2006,2007 Team PySoy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport soy.transports + +cdef void _callback(void* data, ode.dGeomID o1, ode.dGeomID o2) : + cdef int c + cdef ode.dBodyID b1, b2 + cdef soy.bodies._bodies.Body bo1, bo2 + cdef ode.dContactGeom cg + # Get associated bodies + b1 = ode.dGeomGetBody(o1) + b2 = ode.dGeomGetBody(o2) + # Do not continue if we can't do anything with our collisions + if b1 == NULL or b2 == NULL : + return + # Wham! + c = ode.dCollide(o1, o2, 1, &cg, sizeof(cg)) + if c > 0 : + # Get the Body objects + bo1 = <soy.bodies._bodies.Body> ode.dBodyGetData(b1) + bo2 = <soy.bodies._bodies.Body> ode.dBodyGetData(b2) + # activate any fields present... + if isinstance(bo1, soy.bodies.fields.Field) : + (<soy.bodies.fields.Field> bo1)._exert(bo2) + if isinstance(bo2, soy.bodies.fields.Field) : + (<soy.bodies.fields.Field> bo2)._exert(bo1) Modified: trunk/pysoy/src/_core-common/_coreLoop.pxi =================================================================== --- trunk/pysoy/src/_core-common/_coreLoop.pxi 2007-07-06 21:31:24 UTC (rev 380) +++ trunk/pysoy/src/_core-common/_coreLoop.pxi 2007-07-06 21:37:20 UTC (rev 381) @@ -19,29 +19,6 @@ cimport soy.transports -cdef void _callback(void* data, ode.dGeomID o1, ode.dGeomID o2) : - cdef int c - cdef ode.dBodyID b1, b2 - cdef soy.bodies._bodies.Body bo1, bo2 - cdef ode.dContactGeom cg - # Get associated bodies - b1 = ode.dGeomGetBody(o1) - b2 = ode.dGeomGetBody(o2) - # Do not continue if we can't do anything with our collisions - if b1 == NULL or b2 == NULL : - return - # Wham! - c = ode.dCollide(o1, o2, 1, &cg, sizeof(cg)) - if c > 0 : - # Get the Body objects - bo1 = <soy.bodies._bodies.Body> ode.dBodyGetData(b1) - bo2 = <soy.bodies._bodies.Body> ode.dBodyGetData(b2) - # activate any fields present... - if isinstance(bo1, soy.bodies.fields.Field) : - (<soy.bodies.fields.Field> bo1)._exert(bo2) - if isinstance(bo2, soy.bodies.fields.Field) : - (<soy.bodies.fields.Field> bo2)._exert(bo1) - cdef void _coreLoop() : cdef int i, j cdef int _step, _maxstep Modified: trunk/pysoy/src/_core-osx/soy._core.pyx =================================================================== --- trunk/pysoy/src/_core-osx/soy._core.pyx 2007-07-06 21:31:24 UTC (rev 380) +++ trunk/pysoy/src/_core-osx/soy._core.pyx 2007-07-06 21:37:20 UTC (rev 381) @@ -38,6 +38,7 @@ include "../_core-common/_coreLoop.pxi" +include "../_core-common/_callback.pxi" include "../_core-common/_init.pxi" include "../_core-common/Scene.pxi" include "_time.pxi" Modified: trunk/pysoy/src/_core-server/soy._core.pyx =================================================================== --- trunk/pysoy/src/_core-server/soy._core.pyx 2007-07-06 21:31:24 UTC (rev 380) +++ trunk/pysoy/src/_core-server/soy._core.pyx 2007-07-06 21:37:20 UTC (rev 381) @@ -40,6 +40,7 @@ include "../_core-common/_coreLoop.pxi" +include "../_core-common/_callback.pxi" include "../_core-common/_init.pxi" include "../_core-common/File.pxi" include "../_core-common/Scene.pxi" Modified: trunk/pysoy/src/_core-w32/soy._core.pyx =================================================================== --- trunk/pysoy/src/_core-w32/soy._core.pyx 2007-07-06 21:31:24 UTC (rev 380) +++ trunk/pysoy/src/_core-w32/soy._core.pyx 2007-07-06 21:37:20 UTC (rev 381) @@ -38,6 +38,7 @@ include "../_core-common/_coreLoop.pxi" +include "../_core-common/_callback.pxi" include "../_core-common/_init.pxi" include "../_core-common/Scene.pxi" Modified: trunk/pysoy/src/_core-x11/soy._core.pyx =================================================================== --- trunk/pysoy/src/_core-x11/soy._core.pyx 2007-07-06 21:31:24 UTC (rev 380) +++ trunk/pysoy/src/_core-x11/soy._core.pyx 2007-07-06 21:37:20 UTC (rev 381) @@ -40,4 +40,5 @@ # These must be last include "../_core-common/_coreLoop.pxi" +include "../_core-common/_callback.pxi" include "../_core-common/_init.pxi" _______________________________________________ PySoy-SVN mailing list [email protected] http://www.pysoy.org/mailman/listinfo/pysoy-svn
