Example usage for com.badlogic.gdx.ai.steer SteeringAcceleration SteeringAcceleration

List of usage examples for com.badlogic.gdx.ai.steer SteeringAcceleration SteeringAcceleration

Introduction

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

Prototype

public SteeringAcceleration(T linear) 

Source Link

Document

Creates a SteeringAcceleration with the given linear acceleration and zero angular acceleration.

Usage

From source file:AITest.Box2DSteeringEntity.java

public Box2DSteeringEntity(Body body, float boundingRadius) {
    this.body = body;
    this.boundingRadius = boundingRadius;
    this.maxAngularAcceleration = 5;
    this.maxAngularSpeed = 5;
    this.maxLinearSpeed = 5;
    this.maxLinearAcceleration = 500;
    this.tagged = false;
    this.steeringOutput = new SteeringAcceleration<Vector2>(new Vector2());
    this.body.setUserData(this);
}

From source file:com.mygdx.entities.DynamicEntities.SteerableEntity.java

public SteerableEntity(Vector2 pos, float w, float h) {
    super(pos, w, h);

    bd.position.set(pos.x / PPM, pos.y / PPM);
    bd.type = BodyDef.BodyType.DynamicBody;
    cshape.setRadius(width / PPM);/*from   w ww  .j  a v a 2 s.  co  m*/
    shape.setAsBox(width / PPM, height / PPM);
    fd.shape = cshape;
    userdata = "steerable_" + id;

    this.maxLinearSpeed = 500f;
    this.maxLinearAcceleration = 500f;
    this.maxAngularSpeed = 30f;
    this.maxAngularAcceleration = 5f;

    boundingRadius = cshape.getRadius();

    this.tagged = false;
    this.steeringOutput = new SteeringAcceleration<Vector2>(new Vector2());

}