Example usage for com.badlogic.gdx.ai.steer Steerable newVector

List of usage examples for com.badlogic.gdx.ai.steer Steerable newVector

Introduction

In this page you can find the example usage for com.badlogic.gdx.ai.steer Steerable newVector.

Prototype

public T newVector();

Source Link

Document

Returns a new vector.

Usage

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

License:Apache License

/** Creates a {@code CollisionAvoidance} behavior for the specified owner and proximity.
 * @param owner the owner of this behavior
 * @param proximity the proximity of this behavior. */
public CustomCollisionAvoidance(Steerable<T> owner, Proximity<T> proximity) {
    super(owner, proximity);

    this.firstRelativePosition = owner.newVector();
    this.firstRelativeVelocity = owner.newVector();

    this.relativeVelocity = owner.newVector();
}

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

License:Apache License

/** Creates a {@code Separation} behavior for the specified owner and proximity.
 * @param owner the owner of this behavior
 * @param proximity the proximity to detect the owner's neighbors */
public CustomSeperation(Steerable<T> owner, Proximity<T> proximity) {
    super(owner, proximity);

    this.toAgent = owner.newVector();
    linear = owner.newVector();//from   w  w w .  j  ava  2s  .  c  o  m
}