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

SCM Repository

[sml3d] Diff of /trunk/sml3d/src/sml3d/geometry/aabb3f.sml
ViewVC logotype

Diff of /trunk/sml3d/src/sml3d/geometry/aabb3f.sml

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

revision 1266, Thu Jan 19 19:36:02 2012 UTC revision 1267, Fri Jan 20 13:59:06 2012 UTC
# Line 10  Line 10 
10    struct    struct
11    
12      type flt = Float.float      type flt = Float.float
13      type vec3 = flt SML3dTypes.vec3      type vec = flt SML3dTypes.vec3
14    
15      type bbox = {min : vec3, max : vec3}      type bbox = {min : vec, max : vec}
16    
17      fun union (bb1 : bbox, bb2 : bbox) = {      fun union (bb1 : bbox, bb2 : bbox) = {
18              min = Vec3f.map2 Float.min (#min bb1, #min bb2),              min = Vec3f.map2 Float.min (#min bb1, #min bb2),
19              max = Vec3f.map2 Float.max (#max bb1, #max bb2)              max = Vec3f.map2 Float.max (#max bb1, #max bb2)
20            }            }
21    
22      fun containsPt ({min, max} : bbox) (p : vec3) = (      fun containsPt ({min, max} : bbox) (p : vec) = (
23            (#x min <= #x p) andalso (#x p <= #x max) andalso            (#1 min <= #1 p) andalso (#1 p <= #1 max) andalso
24            (#y min <= #y p) andalso (#y p <= #y max) andalso            (#2 min <= #2 p) andalso (#2 p <= #2 max) andalso
25            (#z min <= #z p) andalso (#z p <= #z max))            (#3 min <= #3 p) andalso (#3 p <= #3 max))
26    
27    end    end

Legend:
Removed from v.1266  
changed lines
  Added in v.1267

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