Example usage for com.badlogic.gdx.ai.steer GroupBehavior subclass-usage

List of usage examples for com.badlogic.gdx.ai.steer GroupBehavior subclass-usage

Introduction

In this page you can find the example usage for com.badlogic.gdx.ai.steer GroupBehavior subclass-usage.

Usage

From source file com.mygdx.game.CustomCollisionAvoidance.java

/** {@code CollisionAvoidance} behavior steers the owner to avoid obstacles lying in its path. An obstacle is any object that can be
 * approximated by a circle (or sphere, if you are working in 3D).
 * <p>
 * This implementation uses collision prediction working out the closest approach of two agents and determining if their distance
 * at this point is less than the sum of their bounding radius. For avoiding groups of characters, averaging positions and
 * velocities do not work well with this approach. Instead, the algorithm needs to search for the character whose closest approach

From source file com.mygdx.game.CustomSeperation.java

/** {@code Separation} is a group behavior producing a steering acceleration repelling from the other neighbors which are the agents
 * in the immediate area defined by the given {@link Proximity}. The acceleration is calculated by iterating through all the
 * neighbors, examining each one. The vector to each agent under consideration is normalized, multiplied by a strength decreasing
 * according to the inverse square law in relation to distance, and accumulated.
 *
 * @param <T> Type of vector, either 2D or 3D, implementing the {@link Vector} interface