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

SCM Repository

[sml3d] View of /trunk/sml3d/geometry/frustum-sig.sml
ViewVC logotype

View of /trunk/sml3d/geometry/frustum-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 759 - (download) (annotate)
Wed Feb 10 22:22:40 2010 UTC (8 years, 8 months ago) by jhr
File size: 1057 byte(s)
  Starting to put together the Geometry library
(* frustum-sig.sml
 *
 * COPYRIGHT (c) 2010 John Reppy (http://cs.uchicago.edu/~jhr)
 * All rights reserved.
 *)

signature FRUSTUM =
  sig

  (* create a frustum from a given camera setup *)
    val fromCamera : Camera.camera -> frustum

  (* create a frustum from a given OpenGL projection matrix *)
    val fromCamera : Mat4f.mat -> frustum

  (* the frustum planes in world space *)
    val near : frustum -> Planef.plane
    val far : frustum -> Planef.plane
    val left : frustum -> Planef.plane
    val right : frustum -> Planef.plane
    val top : frustum -> Planef.plane
    val bottom : frustum -> Planef.plane

  (* testing against bounding volumes *)

    datatype outcode
      = ALL_IN			(* object is completely inside *)
      | PART_IN			(* object is partially inside *)
      | ALL_OUT			(* object is completely outside *)

    val testPoint : frustum -> Vec3f.vec3 -> bool

    val testSphere : frustum -> Sphere.sphere -> outcode

    val testAABB : frustum -> AABB.box -> outcode

    val testOBB : frustum -> OBB.box -> outcode

  end

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