Changeset 1212
- Timestamp:
- 03/28/08 17:49:25 (9 months ago)
- Location:
- trunk/pysoy/src
- Files:
-
- 47 modified
-
_datatypes/AudioDeviceTuple.pxi (modified) (2 diffs)
-
_datatypes/BoneList.pxi (modified) (1 diff)
-
_internals/AsyncQueue.pxi (modified) (2 diffs)
-
_internals/Loadable.pxi (modified) (1 diff)
-
_internals/LoopThread.pxi (modified) (2 diffs)
-
_internals/Loopable.pxi (modified) (1 diff)
-
_internals/PointerSet.pxi (modified) (2 diffs)
-
colors/Color.pxi (modified) (2 diffs)
-
controllers/Controller.pxi (modified) (1 diff)
-
controllers/Keyboard.pxi (modified) (2 diffs)
-
controllers/Keyboard2.pxi (modified) (2 diffs)
-
controllers/Window.pxi (modified) (2 diffs)
-
fields/Buoyancy.pxi (modified) (2 diffs)
-
fields/Field.pxi (modified) (1 diff)
-
fields/Monopole.pxi (modified) (2 diffs)
-
fields/Shockwave.pxi (modified) (3 diffs)
-
fields/Wind.pxi (modified) (2 diffs)
-
joints/Ball.pxi (modified) (2 diffs)
-
joints/Fixed.pxi (modified) (1 diff)
-
joints/Hinge.pxi (modified) (3 diffs)
-
joints/Hinge2.pxi (modified) (3 diffs)
-
joints/Joint.pxi (modified) (1 diff)
-
joints/Piston.pxi (modified) (3 diffs)
-
joints/Slider.pxi (modified) (3 diffs)
-
joints/Universal.pxi (modified) (3 diffs)
-
models/Liquid.pxi (modified) (1 diff)
-
models/Mesh.pxi (modified) (1 diff)
-
models/Model.pxi (modified) (1 diff)
-
models/Shape.pxi (modified) (1 diff)
-
models/Sun.pxi (modified) (1 diff)
-
scenes/Scene.pxi (modified) (3 diffs)
-
shapes/Box.pxi (modified) (3 diffs)
-
shapes/Capsule.pxi (modified) (2 diffs)
-
shapes/Ray.pxi (modified) (2 diffs)
-
shapes/Shape.pxi (modified) (1 diff)
-
shapes/Sphere.pxi (modified) (2 diffs)
-
textures/Video.pxi (modified) (2 diffs)
-
transports/File.pxi (modified) (1 diff)
-
transports/Transport.pxi (modified) (2 diffs)
-
widgets/Canvas.pxi (modified) (3 diffs)
-
widgets/Container.pxi (modified) (2 diffs)
-
widgets/Projector.pxi (modified) (3 diffs)
-
widgets/StackX.pxi (modified) (1 diff)
-
widgets/StackY.pxi (modified) (1 diff)
-
widgets/StackZ.pxi (modified) (1 diff)
-
widgets/Widget.pxi (modified) (3 diffs)
-
windows/Window-x11.pxi (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pysoy/src/_datatypes/AudioDeviceTuple.pxi
r1191 r1212 56 56 slice of one of those two classes. 57 57 ''' 58 59 ############################################################################ 60 # 61 # Python functions 62 # 63 58 64 def __cinit__(self) : 59 65 self._slice = slice(None) … … 123 129 else : 124 130 return '(%s)' % _string[:-2] 125 126 127 # C Functions 131 132 ############################################################################ 133 # 134 # C functions 135 # 136 128 137 cdef int _get(self, char* _devices, int _index) : 129 138 cdef int _i, _l, _n -
trunk/pysoy/src/_datatypes/BoneList.pxi
r1191 r1212 27 27 # rather as part of it's parent Mesh. Parent must be in __cinit__ as 28 28 # otherwise it's parent holds the real data. 29 29 30 ############################################################################ 31 # 32 # Python functions 33 # 34 30 35 def __cinit__(self, parent) : 31 36 if not isinstance(parent, soy.models.Mesh) : -
trunk/pysoy/src/_internals/AsyncQueue.pxi
r1191 r1212 26 26 ''' 27 27 28 ############################################################################ 29 # 30 # Python functions 31 # 32 28 33 def __cinit__(self) : 29 34 self._asyncqueue = glib.g_async_queue_new() … … 32 37 glib.g_async_queue_unref(self._asyncqueue) 33 38 39 ############################################################################ 40 # 41 # C functions 42 # 43 34 44 cdef void _push(self, void* data) : 35 45 glib.g_async_queue_push(self._asyncqueue, data) -
trunk/pysoy/src/_internals/Loadable.pxi
r1191 r1212 25 25 This should be inherited by any PySoy class which can be loaded or saved. 26 26 ''' 27 28 ############################################################################ 29 # 30 # Python functions 31 # 32 27 33 def __cinit__(self, source=None, *args, **keywords) : 28 34 self._source = source 29 35 36 ############################################################################ 37 # 38 # C functions 39 # 40 30 41 cdef int _load(self, void* _data, int _size) : 31 42 return 0 -
trunk/pysoy/src/_internals/LoopThread.pxi
r1191 r1212 29 29 ''' 30 30 31 ############################################################################ 32 # 33 # Python functions 34 # 35 31 36 def __cinit__(self, name) : 32 37 assert type(name)==str, 'name must be a string' … … 74 79 assert False, "cannot set daemon status of LoopThread" 75 80 76 81 ############################################################################ 82 # 83 # C functions 84 # 85 77 86 cdef void _loop(self) : 78 87 cdef int _i, _t, _most -
trunk/pysoy/src/_internals/Loopable.pxi
r1191 r1212 23 23 This should be inherited by any PySoy class which LoopThread uses. 24 24 ''' 25 26 ############################################################################ 27 # 28 # C functions 29 # 30 25 31 cdef int _loop(self) : 26 32 return 1000 -
trunk/pysoy/src/_internals/PointerSet.pxi
r1191 r1212 23 23 Uses GLib HashTables. 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __cinit__(self) : 26 32 self._hashtable = glib.g_hash_table_new(glib.g_direct_hash, glib.g_direct_equal) … … 29 35 glib.g_hash_table_destroy(self._hashtable) 30 36 37 ############################################################################ 38 # 39 # C functions 40 # 41 31 42 cdef void _insert(self, void* key) : 32 43 glib.g_hash_table_insert(self._hashtable, key, NULL) -
trunk/pysoy/src/colors/Color.pxi
r1205 r1212 29 29 (178, 211, 83, 255), (255, 34) 30 30 ''' 31 32 ########################################################################## 33 # 34 # Python Functions 35 # 36 31 37 def __cinit__(self, value) : 32 38 if type(value) == str or type(value) == unicode : … … 210 216 return "soy.colors.Color('%s') %s" % (_parts[0], _parts[1]) 211 217 218 ############################################################################ 219 # 220 # Properties 221 # 212 222 213 223 property hex : -
trunk/pysoy/src/controllers/Controller.pxi
r1191 r1212 23 23 This is the base Controller class which all controllers must inherit. 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __repr__(self) : 26 32 return '<Controller>' 33 34 ############################################################################ 35 # 36 # C functions 37 # 27 38 28 39 cdef void _coreEventKeyDown(self, unsigned char _cde, unsigned char _sym) : -
trunk/pysoy/src/controllers/Keyboard.pxi
r1191 r1212 34 34 See soy.controllers.Controller for how to program controllers. 35 35 ''' 36 37 ############################################################################ 38 # 39 # Python functions 40 # 41 36 42 def __cinit__(self, window, *args, **kw) : 37 43 if not isinstance(window, soy._core.Window) : … … 95 101 py.Py_INCREF(<soy.actions.Action> self._acts_keycde[key]) 96 102 103 ############################################################################ 104 # 105 # C functions 106 # 97 107 98 108 cdef void _coreEventKeyDown(self, unsigned char _cde, unsigned char _sym) : -
trunk/pysoy/src/controllers/Keyboard2.pxi
r1062 r1212 15 15 See soy.controllers.Controller for how to program controllers. 16 16 ''' 17 18 ############################################################################ 19 # 20 # Python functions 21 # 22 17 23 def __cinit__(self, window, *args, **kw) : 18 24 if not isinstance(window, soy._core.Window) : … … 103 109 self._acts_keycde_up[key] = <void*> value2 104 110 py.Py_INCREF(<soy.actions.Action> self._acts_keycde_up[key]) 105 111 112 ############################################################################ 113 # 114 # C functions 115 # 116 106 117 107 118 cdef void _coreEventKeyDown(self, unsigned char _cde, unsigned char _sym) : -
trunk/pysoy/src/controllers/Window.pxi
r1191 r1212 27 27 28 28 See soy.controllers.Controller for how to program controllers. 29 ''' 29 ''' 30 31 ############################################################################ 32 # 33 # Python functions 34 # 35 30 36 def __cinit__(self, window, *args, **kw) : 31 37 if not isinstance(window, soy._core.Window) : … … 70 76 else : 71 77 raise KeyError('%s unsupported, see help(soy.controllers.Window)' % key) 72 73 78 79 ############################################################################ 80 # 81 # C functions 82 # 83 74 84 cdef void _coreEventWinClose(self) : 75 85 if self._acts_close : -
trunk/pysoy/src/fields/Buoyancy.pxi
r1191 r1212 23 23 Adjusts the mass Monopole works based on 24 24 ''' 25 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 26 31 def __cinit__(self, *args, **keywords) : 27 32 self._affected = soy._internals.Children() 28 33 self._density = 0 29 34 35 ############################################################################ 36 # 37 # C functions 38 # 39 30 40 cdef void _give(self, int _ccycle) : 31 41 cdef int _i … … 66 76 self._affected._append(<void*> other) 67 77 return 1 68 78 79 ############################################################################ 80 # 81 # Properties 82 # 83 69 84 property density : 70 85 '''Buoyancy Density -
trunk/pysoy/src/fields/Field.pxi
r1191 r1212 24 24 forces and other changes to other bodies. 25 25 ''' 26 26 27 ############################################################################ 28 # 29 # C functions 30 # 31 27 32 cdef int _apply(self) : 28 33 cdef int _i, _r -
trunk/pysoy/src/fields/Monopole.pxi
r1191 r1212 24 24 bodies in the entire scene based on an inverse square law. 25 25 ''' 26 26 27 ############################################################################ 28 # 29 # Python functions 30 # 31 27 32 def __cinit__(self, soy.scenes.Scene parent, *args, **keywords) : 28 33 self._multiplier = 0 29 34 self._affected = soy._internals.Children() 30 35 36 ############################################################################ 37 # 38 # C functions 39 # 40 31 41 cdef int _exert(self, soy.bodies.Body other) : 32 42 self._affected._append(<void*> other) … … 65 75 self._affected._iterDone() 66 76 self._affected._empty() 67 68 77 78 ############################################################################ 79 # 80 # Properties 81 # 82 69 83 property multiplier : 70 84 '''Monopole's multiplier -
trunk/pysoy/src/fields/Shockwave.pxi
r1191 r1212 23 23 Models an constant-rate expanding shockwave 24 24 ''' 25 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 26 31 def __cinit__(self, *args, **keywords) : 27 32 self._space = ode.dHashSpaceCreate(NULL) … … 29 34 def __dealloc__(self) : 30 35 ode.dSpaceDestroy (self._space) 36 37 def activate(self) : 38 if (self._t0 != 0) : 39 raise RuntimeError('Multiple use shockwaves are not yet available') 40 self._t0 = (<soy.scenes.Scene> self._scene)._time 41 self._inner = 0 42 self._outer = 0 43 self.shape = soy.shapes.Sphere(0) 44 stdio.printf("activate done\n") 31 45 46 ############################################################################ 47 # 48 # C functions 49 # 50 32 51 cdef int _exert(self, soy.bodies.Body other) : 33 52 cdef float depth, force, dx, dy, dz, d … … 76 95 self._t0 = 0 77 96 stdio.printf("give complete\n") 78 79 def activate(self) :80 if (self._t0 != 0) :81 raise RuntimeError('Multiple use shockwaves are not yet available')82 self._t0 = (<soy.scenes.Scene> self._scene)._time83 self._inner = 084 self._outer = 085 self.shape = soy.shapes.Sphere(0)86 stdio.printf("activate done\n")87 97 98 ############################################################################ 99 # 100 # Python functions 101 # 102 88 103 property velocity : 89 104 '''Shockwave Velocity -
trunk/pysoy/src/fields/Wind.pxi
r1191 r1212 24 24 ''' 25 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 26 31 def __cinit__(self, soy.scenes.Scene parent, *args, **keywords) : 27 32 return 28 33 34 ############################################################################ 35 # 36 # C functions 37 # 38 29 39 # TODO incomplete: needs area measurements rather than assumptions 30 40 cdef int _exert(self, soy.bodies.Body other) : … … 44 54 return 1 45 55 56 ############################################################################ 57 # 58 # Properties 59 # 60 46 61 property vector : 47 62 '''Wind Vector -
trunk/pysoy/src/joints/Ball.pxi
r1191 r1212 23 23 a "ball and socket" joint 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __init__(self, parent, body1, body2, position) : 26 32 self._scene._stepLock() … … 31 37 self._scene._stepUnlock() 32 38 39 ############################################################################ 40 # 41 # Properties 42 # 43 33 44 property position : 34 45 '''Ball.position -
trunk/pysoy/src/joints/Fixed.pxi
r1191 r1212 23 23 This is a fixed joint 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __init__(self, parent, body1, body2) : 26 32 self._scene._stepLock() -
trunk/pysoy/src/joints/Hinge.pxi
r1191 r1212 23 23 a hinge joint 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __init__(self, parent, body1, body2, position, axis) : 26 32 self._scene._stepLock() … … 31 37 self._scene._joints._append(<void*> self) 32 38 self._scene._stepUnlock() 33 39 40 def addTorque(self, torque) : 41 ode.dJointAddHingeTorque(self._jointID, torque) 42 43 ############################################################################ 44 # 45 # Properties 46 # 47 34 48 property position : 35 49 '''Hinge.position … … 97 111 return ode.dJointGetHingeParam(self._jointID, ode.dParamBounce) 98 112 99 def addTorque(self, torque) :100 ode.dJointAddHingeTorque(self._jointID, torque) -
trunk/pysoy/src/joints/Hinge2.pxi
r1191 r1212 23 23 a double hinge joint 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __init__(self, parent, body1, body2, position, axis1, axis2) : 26 32 self._scene._stepLock() … … 33 39 self._scene._stepUnlock() 34 40 41 def addTorque(self, torque1, torque2) : 42 ode.dJointAddHinge2Torques(self._jointID, torque1, torque2) 43 44 ############################################################################ 45 # 46 # Properties 47 # 48 35 49 property position : 36 50 '''Hinge2.position … … 110 124 return ode.dJointGetHinge2Param(self._jointID, ode.dParamBounce) 111 125 112 def addTorque(self, torque1, torque2) :113 ode.dJointAddHinge2Torques(self._jointID, torque1, torque2)114 -
trunk/pysoy/src/joints/Joint.pxi
r1191 r1212 24 24 ''' 25 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 26 31 def __cinit__(self, soy.scenes.Scene parent, 27 32 soy.bodies.Body body1, soy.bodies.Body body2, -
trunk/pysoy/src/joints/Piston.pxi
r1191 r1212 23 23 a piston joint aka prismatic&rotoide 24 24 ''' 25 26 ############################################################################ 27 # 28 # Python functions 29 # 30 25 31 def __init__(self, parent, body1, body2, position, axis1, axis2) : 26 32 self._scene._stepLock() … … 33 39 self._scene._stepUnlock() 34 40 41 &n
