Example usage for com.badlogic.gdx.graphics.g3d.utils MeshPartBuilder arrow

List of usage examples for com.badlogic.gdx.graphics.g3d.utils MeshPartBuilder arrow

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d.utils MeshPartBuilder arrow.

Prototype

public void arrow(float x1, float y1, float z1, float x2, float y2, float z2, float capLength,
        float stemThickness, int divisions);

Source Link

Document

Add an arrow

Usage

From source file:com.mbrlabs.mundus.utils.Compass.java

License:Apache License

public Compass(PerspectiveCamera worldCam) {
    this.worldCam = worldCam;
    this.ownCam = new PerspectiveCamera();

    ModelBuilder modelBuilder = new ModelBuilder();
    modelBuilder.begin();//from w w  w .  j  av  a 2  s  . co  m

    MeshPartBuilder builder = modelBuilder.part("compass", GL20.GL_TRIANGLES,
            VertexAttributes.Usage.Position | VertexAttributes.Usage.ColorUnpacked, new Material());
    builder.setColor(Color.RED);
    builder.arrow(0, 0, 0, ARROW_LENGTH, 0, 0, ARROW_CAP_SIZE, ARROW_THIKNESS, ARROW_DIVISIONS);
    builder.setColor(Color.GREEN);
    builder.arrow(0, 0, 0, 0, ARROW_LENGTH, 0, ARROW_CAP_SIZE, ARROW_THIKNESS, ARROW_DIVISIONS);
    builder.setColor(Color.BLUE);
    builder.arrow(0, 0, 0, 0, 0, ARROW_LENGTH, ARROW_CAP_SIZE, ARROW_THIKNESS, ARROW_DIVISIONS);
    compassModel = modelBuilder.end();
    compassInstance = new ModelInstance(compassModel);

    // translate to top left corner
    compassInstance.transform.translate(0.93f, 0.94f, 0);
}