Author: DavidCzech Date: 2008-01-03 05:18:51 +0000 (Thu, 03 Jan 2008) New Revision: 736
Modified: trunk/pysoy/src/bodies._bodies/Camera.pxi trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd Log: Wireframe Support Modified: trunk/pysoy/src/bodies._bodies/Camera.pxi =================================================================== --- trunk/pysoy/src/bodies._bodies/Camera.pxi 2008-01-03 01:26:34 UTC (rev 735) +++ trunk/pysoy/src/bodies._bodies/Camera.pxi 2008-01-03 05:18:51 UTC (rev 736) @@ -16,7 +16,7 @@ # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ - +cimport gl cdef class Camera(Body) : '''PySoy Camera @@ -24,17 +24,21 @@ be rendered through. It must be attached to a soy.widgets.Projector or other rendering class to be activated. ''' - def __cinit__(self, soy._core.Scene parent, *args, **keywords) : + def __cinit__(self, soy._core.Scene parent,wireframe=0, *args, **keywords) : self._fovy = 45.0 self.mass = 0 + self._wire = wireframe self._rpt = 0 for i in range(15) : self._rtimes[i] = 0.0 - cdef void _project(self) : cdef ode.dReal *pos cdef ode.dReal *rot cdef gl.GLfloat mtx[16] + if self._wire == 1: + gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE); + if self._wire == 0: + gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL); pos = <ode.dReal *> ode.dBodyGetPosition(self._bodyID) rot = <ode.dReal *> ode.dBodyGetRotation(self._bodyID) mtx[0] = rot[0] @@ -70,7 +74,11 @@ else : return 1 / (f2 - f1) * 15 - + property wireframe : + def __get__(self) : + return self._wire + def __set__(self,value) : + self._wire = value property lens : '''Camera Lens Modified: trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd =================================================================== --- trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd 2008-01-03 01:26:34 UTC (rev 735) +++ trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd 2008-01-03 05:18:51 UTC (rev 736) @@ -16,7 +16,6 @@ # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ - cimport gl cimport ode cimport py @@ -50,5 +49,6 @@ cdef class Camera (Body) : cdef double _rtimes[16] cdef int _rpt + cdef int _wire cdef float _fovy cdef void _project(self) _______________________________________________ PySoy-SVN mailing list [email protected] http://www.pysoy.org/mailman/listinfo/pysoy-svn
