Type of immutable boxes of floats
Module OgamlMath.FloatBox
Operations on float boxesThis module defines the FloatBox type and various operations on it.
create position size
creates a box at position position
and of size size
create_from_points p1 p2
creates a box going from p1
to p2
Zero box
Unit box
Returns the position of a box
Returns the absolute position of a box, that is the point of minimal coordinates
Returns the top corner (aka position + size) of a box
Returns the absolute corner of a box, that is the point of maximal coordinates
Returns the size of a box
Returnrs the absolute size of a box
Returns the center of a box
normalize box
returns a box equivalent to box
but with positive size
Adds a vector to the dimensions of a box. Be careful since if the box is not normalized, adding a positive vector may reduce the effective size of the box.
Returns the volume of a box
Scales a box
Translates a box
Converts an integer box to a float box
Truncates the floating-point coordinates of a box
See : OgamlMath.IntBox
See : OgamlMath.IntBox
intersects t1 t2
returns true
iff the boxes t1
and t2
overlap
includes t b
returns true
iff the box b
is included in the box t
contains t p
returns true
iff the box t
contains p
Returns a pretty-printed string (not for serialization)