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 TypeMethodDescriptionfloat
Gets the component of the frames border at given direction.boolean
intersects
(Frame otherFrame) Check whether this frame collides with another.boolean
intersects
(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:
true
if collision detected,false
otherwise
-
intersects
Check whether this frame collides with another object.- Parameters:
position
- of the object- Returns:
true
if collision detected,false
otherwise
-
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
-1
on failure
-
toString
-