module Polytope: sig
.. end
A Polytope class for representing convex clipping volumes made up of a set of planes.
When adding planes, their normals should point inwards (into the volume).
type
t
val create' : unit -> t
create empty polytope
val set_to_unit_frustum' : t -> bool -> bool -> unit
val set_to_unit_frustum : ?with_near:bool -> ?with_far:bool -> t -> unit
Create a Polytope which is a cube, centered at 0,0,0, with sides of 2 units.
val get_planes : t -> Osg.Plane.t array
val transform : t -> Osg.Matrix.t -> unit
Transform the clipping set by matrix. Note, this operations carries out
the calculation of the inverse of the matrix since a plane must
be multiplied by the inverse transposed to transform it. This
makes this operation expensive. If the inverse has been already
calculated elsewhere then use transform_providing_inverse
instead.
See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf
val transform_providing_inverse : t -> Osg.Matrix.t -> unit
Transform the clipping set by provide a pre inverted matrix.
see transform for details.
val contains_bounding_box : t -> Osg.Bounding_box.t -> bool
Check whether any part of a bounding box is contained within clipping set.
val contains_vec3 : t -> Osg.Vec3.t -> bool
Check whether a vertex is contained within clipping set.
val contains_vec3_array : t -> Osg.Vec3_array.t -> bool
Check whether any part of vertex list is contained within clipping set.
val contains_all_of_bounding_box : t -> Osg.Bounding_box.t -> bool
Check whether the entire bounding box is contained within clipping set.
val contains_all_of_vec3_array : t -> Osg.Vec3_array.t -> bool
Check whether all of vertex list is contained with clipping set.