You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
899 B

package mock.model.collider;
import mock.model.MockBoat;
/**
* Interface for all objects sensitive to collision in a race.
*/
public interface Collider {
/**
* Indicates whether a ray cast from a boat to a target collider is within the specified length.
* @param boat potentially colliding with target
* @param distance distance for valid collision
* @return whether or not a collision has occurred
*/
boolean rayCast(MockBoat boat, double distance);
/**
* Indicates whether a ray cast from a boat to a target collider triggers a collision. Distance is set by the object.
* @param boat potentially colliding with target
* @return whether or not a collision has occurred
*/
boolean rayCast(MockBoat boat);
/**
* Handle a collision event
* @param e details of collision
*/
void onCollisionEnter(Collision e);
}