Author: EricStein Date: 2007-07-08 20:30:20 -0400 (Sun, 08 Jul 2007) New Revision: 439
Added: trunk/pysoy/src/shapes/CCylinder.pxi Modified: trunk/pysoy/src/shapes/soy.shapes.pyx Log: Added CCylinder Added: trunk/pysoy/src/shapes/CCylinder.pxi =================================================================== --- trunk/pysoy/src/shapes/CCylinder.pxi (rev 0) +++ trunk/pysoy/src/shapes/CCylinder.pxi 2007-07-09 00:30:20 UTC (rev 439) @@ -0,0 +1,61 @@ +# PySoy's soy.shapes.CCylinder class +# +# Copyright (C) 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$ + +cdef class CCylinder (Shape) : + '''PySoy CCylinder + + An encapsulated ODE Geom + ''' + + def __new__(self, float radius, float length) : + self._geomID = ode.dCreateCCylinder(NULL, radius, length) + ode.dGeomSetData(self._geomID, <void*> self) + + cdef float pointDepth(self, x, y, z) : + return <float> ode.dGeomCCylinderPointDepth(self._geomID, x, y, z) + + property radius : + '''CCylinder's radius + + This is the distance between the center and the surface + ''' + def __get__(self) : + cdef ode.dReal r, l + ode.dGeomCCylinderGetParams(self._geomID, &r, &l) + return r + def __set__(self, value) : + cdef ode.dReal r, l + ode.dGeomCCylinderGetParams(self._geomID, &r, &l) + r = value + ode.dGeomCCylinderSetParams(self._geomID, r, l) + + property length : + '''CCylinder's length + + This is the length, not counting the caps + ''' + def __get__(self) : + cdef ode.dReal r, l + ode.dGeomCCylinderGetParams(self._geomID, &r, &l) + return l + def __set__(self, value) : + cdef ode.dReal r, l + ode.dGeomCCylinderGetParams(self._geomID, &r, &l) + l = value + ode.dGeomCCylinderSetParams(self._geomID, r, l) Property changes on: trunk/pysoy/src/shapes/CCylinder.pxi ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/pysoy/src/shapes/soy.shapes.pyx =================================================================== --- trunk/pysoy/src/shapes/soy.shapes.pyx 2007-07-09 00:24:10 UTC (rev 438) +++ trunk/pysoy/src/shapes/soy.shapes.pyx 2007-07-09 00:30:20 UTC (rev 439) @@ -27,3 +27,4 @@ include "Shape.pxi" include "Sphere.pxi" include "Box.pxi" +include "CCylinder.pxi" _______________________________________________ PySoy-SVN mailing list [email protected] http://www.pysoy.org/mailman/listinfo/pysoy-svn
