Author: ArcRiley
Date: 2007-06-22 17:11:40 -0400 (Fri, 22 Jun 2007)
New Revision: 249

Added:
   trunk/pysoy/src/bodies.lights/
   trunk/pysoy/src/bodies.lights/Light.pxi
   trunk/pysoy/src/bodies.lights/soy.bodies.lights.pxd
   trunk/pysoy/src/bodies.lights/soy.bodies.lights.pyx
Removed:
   trunk/pysoy/src/bodies._bodies/Light.pxi
Modified:
   trunk/pysoy/scripts/bodies/__init__.py
   trunk/pysoy/setup.py
Log:
Moving Light to it's own extension (since there'll be a few light types)


Modified: trunk/pysoy/scripts/bodies/__init__.py
===================================================================
--- trunk/pysoy/scripts/bodies/__init__.py      2007-06-22 16:59:46 UTC (rev 
248)
+++ trunk/pysoy/scripts/bodies/__init__.py      2007-06-22 21:11:40 UTC (rev 
249)
@@ -19,7 +19,8 @@
 #
 # $Id$
 
-from _bodies import Body, Camera, Light, Mesh, Pyramid, \
+from _bodies import Body, Camera, Mesh, Pyramid, \
                     __author__, __credits__, __date__, __doc__, __version__
 import fields
 import joints
+import lights

Modified: trunk/pysoy/setup.py
===================================================================
--- trunk/pysoy/setup.py        2007-06-22 16:59:46 UTC (rev 248)
+++ trunk/pysoy/setup.py        2007-06-22 21:11:40 UTC (rev 249)
@@ -33,6 +33,7 @@
   'bodies._bodies'   : ['GLEW','GL','ode'],
   'bodies.fields'    : ['GL','ode'],
   'bodies.joints'    : ['GL','ode'],
+  'bodies.lights'    : ['GL','ode'],
   'colors'           : ['GL'],  
   'materials'        : ['GL'],
   'textures'         : ['GL'],  

Deleted: trunk/pysoy/src/bodies._bodies/Light.pxi
===================================================================
--- trunk/pysoy/src/bodies._bodies/Light.pxi    2007-06-22 16:59:46 UTC (rev 
248)
+++ trunk/pysoy/src/bodies._bodies/Light.pxi    2007-06-22 21:11:40 UTC (rev 
249)
@@ -1,27 +0,0 @@
-# PySoy Light Class
-#
-# 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
-#  or write to the Free Software Foundation,Inc., 51 Franklin Street,
-#  Fifth Floor, Boston, MA 02110-1301  USA
-#
-# $Id$
-
-cdef class Light(Body) :
-  '''PySoy Light
-
-     Lights provide illumination in your scene.  Needs more work.
-  '''
-


Property changes on: trunk/pysoy/src/bodies.lights
___________________________________________________________________
Name: svn:ignore
   + soy.bodies.lights.c


Copied: trunk/pysoy/src/bodies.lights/Light.pxi (from rev 245, 
trunk/pysoy/src/bodies._bodies/Light.pxi)
===================================================================
--- trunk/pysoy/src/bodies.lights/Light.pxi                             (rev 0)
+++ trunk/pysoy/src/bodies.lights/Light.pxi     2007-06-22 21:11:40 UTC (rev 
249)
@@ -0,0 +1,62 @@
+# PySoy Light Class
+#
+# 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
+#  or write to the Free Software Foundation,Inc., 51 Franklin Street,
+#  Fifth Floor, Boston, MA 02110-1301  USA
+#
+# $Id$
+
+cdef class Light (soy.bodies._bodies.Body) :
+  '''PySoy Light
+
+     Lights provide illumination in your scene.  Needs more work.
+  '''
+  def __new__(self) :
+    import soy.colors
+    self._ambient = soy.colors.Black()    
+    self._diffuse = soy.colors.White()
+    self._specular = soy.colors.White()
+
+  cdef void _setup(self, int id) :
+    cdef float _pos[4]
+    ode.dBodyCopyPosition(self._bodyID, _pos)
+    gl.glEnable(id)
+    gl.glLightfv(id, gl.GL_AMBIENT, 
+                 (<soy.colors.Color> self._ambient)._getRGBA())
+    gl.glLightfv(id, gl.GL_DIFFUSE, 
+                 (<soy.colors.Color> self._diffuse)._getRGBA())
+    gl.glLightfv(id, gl.GL_SPECULAR,
+                 (<soy.colors.Color> self._specular)._getRGBA())
+    gl.glLightfv(id, gl.GL_POSITION, _pos)
+
+  property ambient :
+    def __get__(self) :
+      return self._ambient
+    def __set__(self, soy.colors.Color value) :
+      self._ambient = value
+
+  property diffuse :
+    def __get__(self) :
+      return self._diffuse
+    def __set__(self, soy.colors.Color value) :
+      self._diffuse = value
+
+  property specular :
+    def __get__(self) :
+      return self._specular
+    def __set__(self, soy.colors.Color value) :
+      self._specular = value
+

Copied: trunk/pysoy/src/bodies.lights/soy.bodies.lights.pxd (from rev 248, 
trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd)
===================================================================
--- trunk/pysoy/src/bodies.lights/soy.bodies.lights.pxd                         
(rev 0)
+++ trunk/pysoy/src/bodies.lights/soy.bodies.lights.pxd 2007-06-22 21:11:40 UTC 
(rev 249)
@@ -0,0 +1,35 @@
+# PySoy bodies.lights declarations
+#
+# 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
+#  or write to the Free Software Foundation,Inc., 51 Franklin Street,
+#  Fifth Floor, Boston, MA 02110-1301  USA
+#
+# $Id$
+
+cimport gl
+cimport ode
+cimport stdio
+cimport soy._internals
+cimport soy.bodies._bodies
+cimport soy.colors
+cimport soy.materials
+
+cdef class Light (soy.bodies._bodies.Body) :
+  cdef object  _ambient
+  cdef object  _diffuse
+  cdef object  _specular
+  cdef void    _setup(self, int id)
+

Copied: trunk/pysoy/src/bodies.lights/soy.bodies.lights.pyx (from rev 245, 
trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pyx)
===================================================================
--- trunk/pysoy/src/bodies.lights/soy.bodies.lights.pyx                         
(rev 0)
+++ trunk/pysoy/src/bodies.lights/soy.bodies.lights.pyx 2007-06-22 21:11:40 UTC 
(rev 249)
@@ -0,0 +1,28 @@
+'''PySoy's bodies.lights
+
+This is a collection of lights to illuminate 3d space.
+'''
+__credits__ = '''Copyright (C) 2007 PySoy Developers
+
+   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
+   or write to the Free Software Foundation,Inc., 51 Franklin Street,
+   Fifth Floor, Boston, MA 02110-1301  USA
+'''
+__author__  = '''Maintained by ArcRiley'''
+__date__    = 'Last change on '+ \
+              '$Date$'[7:-20]+ \
+              'by '+'$Author$'[9:-2]
+__version__ = 'Trunk (r'+'$Rev$'[6:-2]+')'
+
+include "Light.pxi"

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to