Package rekit.primitives.geometry
Class Frame
java.lang.Object
rekit.primitives.geometry.Frame
This class defines a Frame which will be used to check collisions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatGets the component of the frames border at given direction.booleanintersects(Frame otherFrame) Check whether this frame collides with another.booleanintersects(Vec position) Check whether this frame collides with another object.toString()
-
Constructor Details
-
Frame
Create a frame by two anchors.- Parameters:
v1- the upperLeft anchorv2- the bottomRight anchor
-
-
Method Details
-
intersects
Check whether this frame collides with another.- Parameters:
otherFrame- the other frame- Returns:
trueif collision detected,falseotherwise
-
intersects
Check whether this frame collides with another object.- Parameters:
position- of the object- Returns:
trueif collision detected,falseotherwise
-
getBorder
Gets the component of the frames border at given direction.- Parameters:
dir- The direction of border- Returns:
- the corresponding coordinate component of the border or
-1on failure
-
toString
-