Box2 (struct)

The Box2 represents a 2 dimensional bounding box. It uses Vec2 types for each of the 2 elements.

参考

Box3

/*
** Example: Construct Box2
*/

// create a box2
Vec2 min(0.0, 0.0);
Vec2 max(1.0, 1.0);
Box2 box(min, max);

Box2 Box2 Box2

Members

Vec2 min  
Vec2 max  

Methods

  Box2 ( in Box2 other )
  Box2 ( in Vec2 min, in Vec2 max )
  Box2 ()
Box2 clone ? ()
UInt32 hash ? ()
Boolean intersects ? ( in Box2 that )
Boolean isEmpty ? ()
  merge ! ( in Box2 v )
  merge ! ( in Vec2 v )
  setEmpty ! ()

Operators

Box2 = ( Param other )

Methods in detail

Box2 ( in Box2 other )

copy constructor


Box2 ( in Vec2 min, in Vec2 max )

Constructor from vectors


Box2 ()

Default constructor


Box2 Box2.clone? ()

clone method


UInt32 Box2.hash? ()

Hash for this value


Boolean Box2.intersects? ( in Box2 that )

Returns true if this Box2 intersects with that Box2


Boolean Box2.isEmpty? ()

Returns true if this box has no content


Box2.merge! ( in Box2 v )

Merges the given Box2 value into this box


Box2.merge! ( in Vec2 v )

Merges the given Vec2 value into this box, expanding the Box2 accordingly


Box2.setEmpty! ()

setting this box to an empty box

Operators in detail

Box2 = ( Param other )

Plus equals operator. Merges the given Vec2 value into this box