Class Frame

java.lang.Object
rekit.primitives.geometry.Frame

public final class Frame extends Object
This class defines a Frame which will be used to check collisions.
  • Constructor Details

    • Frame

      public Frame(Vec v1, Vec v2)
      Create a frame by two anchors.
      Parameters:
      v1 - the upperLeft anchor
      v2 - the bottomRight anchor
  • Method Details

    • intersects

      public boolean intersects(Frame otherFrame)
      Check whether this frame collides with another.
      Parameters:
      otherFrame - the other frame
      Returns:
      true if collision detected, false otherwise
    • intersects

      public boolean intersects(Vec position)
      Check whether this frame collides with another object.
      Parameters:
      position - of the object
      Returns:
      true if collision detected, false otherwise
    • getBorder

      public float getBorder(Direction dir)
      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

      public String toString()
      Overrides:
      toString in class Object