Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] Diff of /trunk/sml3d/src/particles/compiler/translate.sml
ViewVC logotype

Diff of /trunk/sml3d/src/particles/compiler/translate.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1132, Tue Apr 26 19:12:29 2011 UTC revision 1133, Tue Apr 26 19:40:15 2011 UTC
# Line 326  Line 326 
326    
327              | _ => raise Fail ("Cannot generate point in specified domain: "  ^ (P.dToStr domain))              | _ => raise Fail ("Cannot generate point in specified domain: "  ^ (P.dToStr domain))
328            (* end case *))            (* end case *))
           (*  
           | generate (Dplane{pt, n}) = Vec3f.unpack pt  
       | generate (Drectangle{pt, u, v}) = Vec3f.unpack pt  
       | generate (Dsphere{c, orad, irad}) = Vec3f.unpack c  
       | generate (Dblob{c, stddev}) = Vec3f.unpack c  
           *)  
329    
330    (* This function takes an IR boolean, its environment, a particle state, domain,    (* This function takes an IR boolean, its environment, a particle state, domain,
331     * and continuation.     * and continuation.
# Line 513  Line 507 
507                letPRIM("p1dist", IR.T_FLOAT, IR.SUB, [d, p1d], fn p1dist =>                letPRIM("p1dist", IR.T_FLOAT, IR.SUB, [d, p1d], fn p1dist =>
508                letPRIM("p2dist", IR.T_FLOAT, IR.SUB, [d, p2d], fn p2dist =>                letPRIM("p2dist", IR.T_FLOAT, IR.SUB, [d, p2d], fn p2dist =>
509                letPRIM("distProd", IR.T_FLOAT, IR.MULT, [p1dist, p2dist], fn distProd =>                letPRIM("distProd", IR.T_FLOAT, IR.MULT, [p1dist, p2dist], fn distProd =>
510                letPRIM("intersect", IR.T_BOOL, IR.GT, [IR.newConst("zero", IR.C_FLOAT 0.0), distProd], k)                letPRIM("intersect", IR.T_BOOL, IR.GT, [IR.newConst("zero", IR.C_FLOAT 0.0), distProd], fn intVar => k intVar state)
511                ))))))                ))))))
512    
513              | P.D_DISC {pt, normal, orad, irad} => let              | P.D_DISC {pt, normal, orad, irad} => let
# Line 670  Line 664 
664           in           in
665            (case (vt1, vt2)            (case (vt1, vt2)
666              of (IR.T_FLOAT, IR.T_FLOAT) => letPRIM("divVar", IR.T_FLOAT, IR.DIV, [e1var, e2var], k)              of (IR.T_FLOAT, IR.T_FLOAT) => letPRIM("divVar", IR.T_FLOAT, IR.DIV, [e1var, e2var], k)
667               | _ => raise Fail ("Type mismatch to DIV expression")               | _ => raise Fail (String.concat["Type mismatch to DIV expression: ", IR.ty2Str vt1, ", ", IR.ty2Str vt2])
668            (* end case *))            (* end case *))
669           end))           end))
670    

Legend:
Removed from v.1132  
changed lines
  Added in v.1133

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0