Example usage for com.badlogic.gdx.graphics.glutils ShapeRenderer point

List of usage examples for com.badlogic.gdx.graphics.glutils ShapeRenderer point

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.glutils ShapeRenderer point.

Prototype

public void point(float x, float y, float z) 

Source Link

Document

Draws a point using ShapeType#Point , ShapeType#Line or ShapeType#Filled .

Usage

From source file:com.tussle.collision.CollisionEdge.java

License:Open Source License

public void draw(ShapeRenderer drawer) {

    double len = FastMath.hypot(endx - startx, endy - starty);
    if (len > 0) {
        double dx = (starty - endy) * 10 / len;
        double dy = (endx - startx) * 10 / len;
        drawer.line((float) startx, (float) starty, (float) endx, (float) endy);
        drawer.line((float) startx, (float) starty, (float) (startx - dx), (float) (starty - dy));
        drawer.line((float) endx, (float) endy, (float) (endx - dx), (float) (endy - dy));
    } else/*  w  ww . jav  a  2  s .  co m*/
        drawer.point((float) startx, (float) starty, 0);
}