Changeset 1279
- Timestamp:
- 05/19/08 19:37:00 (5 months ago)
- Location:
- trunk/pysoy
- Files:
-
- 5 modified
-
include/soy.bodies.pxd (modified) (1 diff)
-
src/bodies/Body.pym (modified) (1 diff)
-
src/models/Mesh.pym (modified) (1 diff)
-
src/models/Shape.pym (modified) (2 diffs)
-
src/scenes/Scene.pym (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pysoy/include/soy.bodies.pxd
r1274 r1279 79 79 cdef void _addForce ( self, ode.dVector3 ) 80 80 # WindowLoop functions 81 cdef void _render ( self ) #nogil82 81 cdef void _calcFogCoords ( self ) nogil 83 82 cdef void _getModelviewInv ( self, float* ) nogil -
trunk/pysoy/src/bodies/Body.pym
r1274 r1279 453 453 # 454 454 455 cdef void _render(self) :456 cdef gl.GLfloat _mtx[16]457 #458 ######################################459 #460 # return now if there's nothing to render461 #462 if self._model is None :463 return464 #465 ######################################466 #467 # save current matrix468 #469 gl.glPushMatrix()470 #471 ######################################472 #473 # set model's matrix474 #475 _mtx[0] = self._rotation[0]476 _mtx[1] = self._rotation[4]477 _mtx[2] = self._rotation[8]478 _mtx[3] = 0.0479 _mtx[4] = self._rotation[1]480 _mtx[5] = self._rotation[5]481 _mtx[6] = self._rotation[9]482 _mtx[7] = 0.0483 _mtx[8] = self._rotation[2]484 _mtx[9] = self._rotation[6]485 _mtx[10] = self._rotation[10]486 _mtx[11] = 0.0487 _mtx[12] = self._position[0]488 _mtx[13] = self._position[1]489 _mtx[14] = self._position[2]490 _mtx[15] = 1.0491 gl.glMultMatrixf(_mtx)492 #493 ######################################494 #495 # call model's rendering function496 #497 self._model._render(self)498 #499 ######################################500 #501 # restore previous matrix502 #503 gl.glPopMatrix()504 #505 ######################################506 507 508 455 cdef void _calcFogCoords(self) nogil : 509 456 if self._model is not None : -
trunk/pysoy/src/models/Mesh.pym
r1272 r1279 130 130 131 131 cdef void _render(self, soy.bodies.Body _body) : 132 cdef gl.GLfloat _mtx[16] 133 # 134 ###################################### 135 # 136 # save current matrix 137 # 138 gl.glPushMatrix() 139 # 140 ###################################### 141 # 142 # set model's matrix 143 # 144 _mtx[0] = _body._rotation[0] 145 _mtx[1] = _body._rotation[4] 146 _mtx[2] = _body._rotation[8] 147 _mtx[3] = 0.0 148 _mtx[4] = _body._rotation[1] 149 _mtx[5] = _body._rotation[5] 150 _mtx[6] = _body._rotation[9] 151 _mtx[7] = 0.0 152 _mtx[8] = _body._rotation[2] 153 _mtx[9] = _body._rotation[6] 154 _mtx[10] = _body._rotation[10] 155 _mtx[11] = 0.0 156 _mtx[12] = _body._position[0] 157 _mtx[13] = _body._position[1] 158 _mtx[14] = _body._position[2] 159 _mtx[15] = 1.0 160 gl.glMultMatrixf(_mtx) 161 # 162 ###################################### 163 # 164 # render materials - insert new code here 165 # 132 166 py.PyThread_acquire_lock(self._mutex, 1) 133 167 self._mates._render(<void*> _body) 134 168 py.PyThread_release_lock(self._mutex) 169 # 170 ###################################### 171 # 172 # restore previous matrix 173 # 174 gl.glPopMatrix() 175 # 176 ###################################### 177 135 178 136 179 # -
trunk/pysoy/src/models/Shape.pym
r1278 r1279 58 58 59 59 cdef void _render(self, soy.bodies.Body _body) : 60 cdef int _shapeclass 60 cdef int _shapeclass 61 cdef gl.GLfloat _mtx[16] 62 # 63 ###################################### 61 64 # 62 65 # Don't attempt to render a non-existant shape 66 # 63 67 if _body._shape is None : 64 68 return 65 69 # 70 ###################################### 71 # 72 # save current matrix 73 # 74 gl.glPushMatrix() 75 # 76 ###################################### 77 # 78 # set model's matrix 79 # 80 _mtx[0] = _body._rotation[0] 81 _mtx[1] = _body._rotation[4] 82 _mtx[2] = _body._rotation[8] 83 _mtx[3] = 0.0 84 _mtx[4] = _body._rotation[1] 85 _mtx[5] = _body._rotation[5] 86 _mtx[6] = _body._rotation[9] 87 _mtx[7] = 0.0 88 _mtx[8] = _body._rotation[2] 89 _mtx[9] = _body._rotation[6] 90 _mtx[10] = _body._rotation[10] 91 _mtx[11] = 0.0 92 _mtx[12] = _body._position[0] 93 _mtx[13] = _body._position[1] 94 _mtx[14] = _body._position[2] 95 _mtx[15] = 1.0 96 gl.glMultMatrixf(_mtx) 97 # 98 ###################################### 99 # 66 100 # Grab the shape's class 67 101 _shapeclass = ode.dGeomGetClass(_body._shape._geomID) 68 102 # 69 # Render the specific shape 103 ###################################### 104 # 105 # render the specific shape 106 # 70 107 if _shapeclass == ode.dSphereClass : 71 108 self._renderSphere(_body._shape) … … 76 113 elif _shapeclass == ode.dRayClass : 77 114 self._renderRay(_body._shape) 115 # 116 ###################################### 117 # 118 # restore previous matrix 119 # 120 gl.glPopMatrix() 121 # 122 ###################################### 78 123 79 124 -
trunk/pysoy/src/scenes/Scene.pym
r1274 r1279 142 142 self._bodies._iterStart() 143 143 for _i from 0 <= _i < self._bodies._current : 144 (<soy.bodies.Body> self._bodies._list[_i])._render() 144 if (<soy.bodies.Body> self._bodies._list[_i])._model is not None : 145 (<soy.models.Model> 146 (<soy.bodies.Body> self._bodies._list[_i])._model)._render( 147 (<soy.bodies.Body> self._bodies._list[_i])) 145 148 self._bodies._iterDone() 146 149 #
