Author: JonNeal
Date: 2008-07-15 02:42:45 -0400 (Tue, 15 Jul 2008)
New Revision: 1314

Modified:
   trunk/pysoy/include/soy.scenes.pxd
   trunk/pysoy/src/scenes/Landscape.pym
Log:
Ticket #929:
  * changed position and size vars to double


Modified: trunk/pysoy/include/soy.scenes.pxd
===================================================================
--- trunk/pysoy/include/soy.scenes.pxd  2008-07-15 06:32:19 UTC (rev 1313)
+++ trunk/pysoy/include/soy.scenes.pxd  2008-07-15 06:42:45 UTC (rev 1314)
@@ -79,14 +79,13 @@
 cdef class Landscape (Scene) :
   cdef ode.dHeightfieldDataID     _heightmapID
   cdef ode.dGeomID                _heightmap
-  cdef int                        _width
-  cdef int                        _depth
-  cdef int                        _height
+  cdef double                     _width
+  cdef double                     _depth
+  cdef double                     _height
   cdef soy.textures.Texture       _heightmapTex
   cdef gl.GLuint                  _buffer
   cdef gl.GLuint                  _elementbuffer
-  cdef int                        _position[3]
-  cdef int                        _verts
+  cdef double                     _position[3]
   cdef Vert*                      _vertArray
   cdef Face*                      _elementArray
   cdef void                       _createBuffer   ( self )

Modified: trunk/pysoy/src/scenes/Landscape.pym
===================================================================
--- trunk/pysoy/src/scenes/Landscape.pym        2008-07-15 06:32:19 UTC (rev 
1313)
+++ trunk/pysoy/src/scenes/Landscape.pym        2008-07-15 06:42:45 UTC (rev 
1314)
@@ -49,15 +49,14 @@
     ode.dGeomHeightfieldDataBuildByte(self._heightmapID,
                                       <unsigned char*> heightmap._texels, 0,
                                       self._width, self._width,
-                                      self._width,
-                                      self._depth, 
+                                      <int> self._width,
+                                      <int> self._depth, 
                                       1, 0, 1, 0)
     self._heightmap = ode.dCreateHeightfield(self._spaceID, self._heightmapID, 
1) #the ode heightmap
     self._heightmapTex = heightmap
     self._createArrays()
     
   def __dealloc__(self) :
-    #pass
     ode.dGeomHeightfieldDataDestroy(self._heightmapID)
     gl.glDeleteBuffersARB(1, &self._buffer);
 
@@ -97,8 +96,8 @@
         _y = self._heightmapTex._texels[_offset] / 255.0 * \
              self._height + self._position[1]
         #divide by width to get what percentage it is of width, then multiply 
by width wanted
-        _x = <float> _j / self._heightmapTex._width  * self._width + 
self._position[0]
-        _z = <float> _i / self._heightmapTex._height * self._depth + 
self._position[2]
+        _x =  _j * self._width / self._heightmapTex._width  + self._position[0]
+        _z =  _i * self._depth / self._heightmapTex._height + self._position[2]
         self._vertArray[_offset].px = _x
         self._vertArray[_offset].py = _y
         self._vertArray[_offset].pz = _z

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

Reply via email to