Author: DavidCzech
Date: 2008-03-19 23:57:27 -0400 (Wed, 19 Mar 2008)
New Revision: 1185

Modified:
   trunk/pysoy/src/scenes/Scene.pxi
   trunk/pysoy/src/scenes/soy.scenes.pxd
Log:
Friction Property for scenes

Modified: trunk/pysoy/src/scenes/Scene.pxi
===================================================================
--- trunk/pysoy/src/scenes/Scene.pxi    2008-03-20 00:45:45 UTC (rev 1184)
+++ trunk/pysoy/src/scenes/Scene.pxi    2008-03-20 03:57:27 UTC (rev 1185)
@@ -39,6 +39,7 @@
     self._lights       = soy._internals.Children()
     self._ambient      = gray
     self._stepSize     = 0.01
+    self._friction     = 0
     self._prevTime     = _time()
     self._stepMutex    = py.PyThread_allocate_lock()
     # a list cor keeping track of the fields in the scene.
@@ -221,6 +222,7 @@
     for _i from 0 <= _i < _contactGeoms :
       _contact.geom = _contactGeom[_i]
       _contact.surface.mode = ode.dContactBounce
+      _contact.surface.mu = self._friction
       _contact.surface.bounce = 0.8
       _contact.surface.bounce_vel = 0
       #stdio.printf('Creating joint\n')
@@ -305,3 +307,18 @@
       return self._ambient
     def __set__(self, soy.colors.Color value) :
       self._ambient = value
+
+  property friction :
+    '''Scene's Friction
+    
+    This is the amount of friction given to ode's contact joint.
+    
+    Defaults to 0 ( Really Slippery )
+    '''
+    def __get__(self) :
+      return self._friction
+    def __set__(self, value) :
+      if isinstance(value, int):
+        self._friction = value
+      else: 
+        raise TypeError("Friction must be an int of some sort")
\ No newline at end of file

Modified: trunk/pysoy/src/scenes/soy.scenes.pxd
===================================================================
--- trunk/pysoy/src/scenes/soy.scenes.pxd       2008-03-20 00:45:45 UTC (rev 
1184)
+++ trunk/pysoy/src/scenes/soy.scenes.pxd       2008-03-20 03:57:27 UTC (rev 
1185)
@@ -63,6 +63,7 @@
   cdef int                        _stepTryLock    ( self )
   cdef void                       _stepUnLock     ( self )
   cdef ode.dReal                  _stepSize
+  cdef ode.dReal                  _friction
   cdef double                     _prevTime
   cdef double                     _time
   # _coreloop methods

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

Reply via email to