Box2D Class¶
- class plask.geometry.Box2D¶
- class plask.geometry.Box2D(lower, upper)
- class plask.geometry.Box2D(left, bottom, right, top)
Rectangular two-dimensional box.
This class holds a rectangular box with its sides along the axes. It provides some basic geometric operations and is used mainly to represent 2D geometry bounding boxes.
- Parameters:
lower (plask.vec) – Lower left corner of the box.
upper (plask.ver) – Upper right corner of the box.
left (float) – Left edge of the box.
bottom (float) – Bottom edge of the box.
right (float) – Right edge of the box.
top (float) – Top edge of the box.
Methods¶
|
Check if the point is inside the box. |
|
Get the minimal box which include both this and other box. |
|
Get the biggest box which is included in both this and the other box. |
|
Check if this and the other box have common points. |
|
Get translated copy of this box. |
Attributes¶
Bottom edge of the box. |
|
Center of the box. |
|
Height of the box. |
|
Left edge of the box. |
|
Lower left corner of the box. |
|
Right edge of the box. |
|
Size of the box. |
|
Top edge of the box. |
|
Upper right corner of the box. |
|
Width of the box. |
Descriptions¶
Method Details¶
- Box2D.contains(point)¶
Check if the point is inside the box.
- Parameters:
point (plask.vec) – Point to test.
- Box2D.extension(other)¶
Get the minimal box which include both this and other box.
- Parameters:
other (plask.geometry.Box2D) – Box.
- Box2D.intersection(other)¶
Get the biggest box which is included in both this and the other box.
- Parameters:
other (plask.geometry.Box2D) – Box to make intersection with.
- Box2D.intersects(other)¶
Check if this and the other box have common points.
- Parameters:
other (plask.geometry.Box2D) – Box to check common points with.
Attribute Details¶
- Box2D.bottom = <property object>¶
Bottom edge of the box.
- Box2D.center = <property object>¶
Center of the box.
- Box2D.height = <property object>¶
Height of the box.
- Box2D.left = <property object>¶
Left edge of the box.
- Box2D.lower = <property object>¶
Lower left corner of the box.
- Box2D.right = <property object>¶
Right edge of the box.
- Box2D.size = <property object>¶
Size of the box.
- Box2D.top = <property object>¶
Top edge of the box.
- Box2D.upper = <property object>¶
Upper right corner of the box.
- Box2D.width = <property object>¶
Width of the box.