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 1155, Tue May 10 04:56:42 2011 UTC revision 1158, Thu May 19 02:08:17 2011 UTC
# Line 621  Line 621 
621               letPRIM("avoidZero", IR.T_FLOAT, IR.MAX, [psvToIRVar(env, epsilon), absDot], fn dot =>               letPRIM("avoidZero", IR.T_FLOAT, IR.MAX, [psvToIRVar(env, epsilon), absDot], fn dot =>
622           letPRIM("dnRecip", IR.T_FLOAT, IR.DIV, [IR.newConst("One", IR.C_FLOAT 1.0), dot], fn dnRecip =>           letPRIM("dnRecip", IR.T_FLOAT, IR.DIV, [IR.newConst("One", IR.C_FLOAT 1.0), dot], fn dnRecip =>
623           letPRIM("sign", IR.T_FLOAT, IR.MULT, [dnRecip, dotNorm], fn sign =>           letPRIM("sign", IR.T_FLOAT, IR.MULT, [dnRecip, dotNorm], fn sign =>
624           letPRIM("notNorm", IR.T_VEC, IR.SCALE, [sign, psvToIRVar(env, normal)], fn notNorm =>           (* sign here can still be zero... *)
625             letPRIM("signOffset", IR.T_FLOAT, IR.ADD, [sign, IR.newConst("half", IR.C_FLOAT 0.5)], fn signOffset =>
626             letPRIM("soRecip", IR.T_FLOAT, IR.DIV, [IR.newConst("One", IR.C_FLOAT 1.0), signOffset], fn soRecip =>
627             letPRIM("absSign", IR.T_FLOAT, IR.ABS, [soRecip], fn absSign =>
628             letPRIM("signFinal", IR.T_FLOAT, IR.MULT, [absSign, signOffset], fn signFinal =>
629    
630             letPRIM("notNorm", IR.T_VEC, IR.SCALE, [signFinal, psvToIRVar(env, normal)], fn notNorm =>
631           letPRIM(retNorm, IR.T_VEC, IR.NORM, [notNorm],           letPRIM(retNorm, IR.T_VEC, IR.NORM, [notNorm],
632             fn newNormVar => gotoWithArgs(env, [newNormVar], nextBlk)))))             fn newNormVar => gotoWithArgs(env, [newNormVar], nextBlk)))))
633           ))))           ))))))))
634    
635             | P.D_DISC{pt, normal, irad, orad} =>             | P.D_DISC{pt, normal, irad, orad} =>
636                normAtPoint(retNorm, P.D_PLANE{pt=pt, normal=normal}, env, pos, k)                normAtPoint(retNorm, P.D_PLANE{pt=pt, normal=normal}, env, pos, k)

Legend:
Removed from v.1155  
changed lines
  Added in v.1158

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