Changeset 1356

Show
Ignore:
Timestamp:
09/08/08 15:24:04 (3 months ago)
Author:
ArcRiley
Message:

Ticket #962 :

  • eliminated soy.bodies.Body._calcFogCoords
  • fixed some obvious problems with liquid_example.py
  • still renders just black
Location:
trunk/pysoy
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/pysoy/examples/liquid_example.py

    r1094 r1356  
    6262    #lava = soy.transports.File('media/lava.soy')['gimp'] 
    6363    #lavam = soy.materials.Material(lava) 
    64     bottom = soy.models.Mesh(material=soy.materials.StainlessSteel()) 
     64    bottom = soy.models.Mesh(material=soy.materials.stainlessSteel) 
    6565 
    6666    V1 = lambda x : V(bottom, position=x[0]) 
    67     F1 = lambda x : F(bottom, verts=x, material=soy.materials.StainlessSteel()) 
     67    F1 = lambda x : F(bottom, verts=x, material=soy.materials.stainlessSteel) 
    6868 
    6969    #verts = map(V1, bottom_vertices) 
     
    8686    return bottom 
    8787 
    88 def create_simple_test_mesh(mat=soy.materials.StainlessSteel()): 
     88def create_simple_test_mesh(mat=soy.materials.stainlessSteel): 
    8989    V = soy.atoms.Vertex 
    9090    F = soy.atoms.Face 
     
    159159    water = soy.transports.File('media/water.soy')['gimp'] 
    160160 
    161     water_mat = soy.materials.Material(water) 
     161    water_mat = soy.materials.Material(colorMap=water) 
    162162    water_mat.ambient = soy.colors.blue 
    163163    water_mat.diffuse = soy.colors.blue 
    164164    water_mat.specular = soy.colors.black 
    165165 
    166     liquid = soy.models.Liquid(liquid_mat=water_mat) 
     166    liquid = soy.models.Liquid(material=water_mat) 
    167167    liquid_b = soy.bodies.Body(sce, mesh=liquid) 
    168168    liquid_b.position = (0, -1, 0) 
  • trunk/pysoy/include/soy.bodies.pxd

    r1351 r1356  
    8181  cdef void                     _addTorque               ( self, ode.dVector3 ) 
    8282  # WindowLoop functions 
    83   cdef void                     _calcFogCoords           ( self )         nogil 
    8483  cdef void                     _getModelviewInv         ( self, float* ) nogil 
    8584 
  • trunk/pysoy/src/bodies/Body.pym

    r1351 r1356  
    462462  # 
    463463 
    464   cdef void _calcFogCoords(self) nogil : 
    465     if self._model is not None : 
    466       self._model._calcFogCoords(<float> self._position[1]) 
    467  
    468  
    469464  cdef void _getModelviewInv(self, float* _mtx) nogil : 
    470465    _mtx[0]  = self._rotation[0] 
  • trunk/pysoy/src/models/Liquid.pym

    r1258 r1356  
    115115    # We need not _iterStart here since _bodies is already iterating via Scene 
    116116    for _i from 0 <= _i < _body._scene._bodies._current : 
    117       if <void*> _body != (_body._scene._bodies._list[_i]) : 
    118         (<soy.bodies.Body> _body._scene._bodies._list[_i])._calcFogCoords() 
    119         (<soy.bodies.Body> _body._scene._bodies._list[_i])._render() 
     117      if (<void*> _body != (_body._scene._bodies._list[_i]) and  
     118          (<soy.bodies.Body>  
     119           _body._scene._bodies._list[_i])._model is not None) : 
     120        (<soy.bodies.Body>  
     121         _body._scene._bodies._list[_i])._model._calcFogCoords( 
     122          (<soy.bodies.Body> _body._scene._bodies._list[_i])) 
     123        (<soy.bodies.Body>  
     124         _body._scene._bodies._list[_i])._model._render( 
     125          (<soy.bodies.Body> _body._scene._bodies._list[_i])) 
    120126    gl.glPopMatrix() 
    121127    gl.glDisableClientState(gl.GL_FOG_COORDINATE_ARRAY_EXT)