/** Creates a {@code RaycastObstacleAvoidance} behavior. * @param owner the owner of this behavior * @param rayConfiguration the ray configuration * @param raycastCollisionDetector the collision detector * @param distanceFromBoundary the minimum distance to a wall (i.e., how far to avoid collision). */ public RaycastObstacleAvoidance (Steerable<T> owner, RayConfiguration<T> rayConfiguration, RaycastCollisionDetector<T> raycastCollisionDetector, float distanceFromBoundary) { super(owner); this.rayConfiguration = rayConfiguration; this.raycastCollisionDetector = raycastCollisionDetector; this.distanceFromBoundary = distanceFromBoundary; this.outputCollision = new Collision<T>(newVector(owner), newVector(owner)); this.minOutputCollision = new Collision<T>(newVector(owner), newVector(owner)); }
/** Creates a {@code RaycastObstacleAvoidance} behavior. * @param owner the owner of this behavior * @param rayConfiguration the ray configuration * @param raycastCollisionDetector the collision detector */ public RaycastObstacleAvoidance (Steerable<T> owner, RayConfiguration<T> rayConfiguration, RaycastCollisionDetector<T> raycastCollisionDetector) { this(owner, rayConfiguration, raycastCollisionDetector, 0); }
/** Returns the raycast collision detector of this behavior. */ public RaycastCollisionDetector<T> getRaycastCollisionDetector () { return raycastCollisionDetector; }
/** Sets the raycast collision detector of this behavior. * @param raycastCollisionDetector the raycast collision detector to set * @return this behavior for chaining. */ public RaycastObstacleAvoidance<T> setRaycastCollisionDetector (RaycastCollisionDetector<T> raycastCollisionDetector) { this.raycastCollisionDetector = raycastCollisionDetector; return this; }
/** Creates a {@code PathSmoother} using the given {@link RaycastCollisionDetector} * @param raycastCollisionDetector the raycast collision detector */ public PathSmoother (RaycastCollisionDetector<V> raycastCollisionDetector) { this.raycastCollisionDetector = raycastCollisionDetector; }