Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Vector2f


    private void initObjects() {
        System.out.println("Initialising objects");

        grid = new TileGrid();
        grid.load(new File("res/maps/map.xml"));
        player = new Player(new Vector2f(32, 32), 32, 32);
        menu = new Menu();

        State.setState(State.MENU);
    }
View Full Code Here


public class Tile extends TileObject {

    private boolean solidTile = false;

    public Tile(TileType type, float x, float y, float width, float height) {
        init(new Vector2f(x, y), width, height);
        this.texture = Textures.loadTexture(type.texturePath);
        this.type = type;
    }
View Full Code Here

        this.texture = Textures.loadTexture(type.texturePath);
        this.type = type;
    }

    public void render() {
        Textures.drawTexture(texture, new Vector2f(position.x * 32, position.y * 32));
    }
View Full Code Here

   * for sorting.
   *
   * @param p The control point
   */
  public void addControlPoint(Vector2f p) {
    _addControlPoint(new Vector2f(p));
  }
View Full Code Here

   * @return
   */
  public Vector2f getControlPoint(int idx) {
    if (idx < 0 || idx >= controlPoints.size())
      throw new InvalidParameterException("Curve index should be in a valid range. Got " + idx + " expected it in [0," + controlPoints.size() + "]");
    return new Vector2f(controlPoints.get(idx));
  }
View Full Code Here

    controlPoints.get(idx).y = y;
  }

  public void setControlPointX(int idx, float x) {
    //!!TODO: optimize this
    Vector2f p = controlPoints.remove(idx);
    p.x = x;
    _addControlPoint(p);
  }
View Full Code Here

 
 
  public static void main(String[] args) {
    Curve c = new Curve();
   
    c.addControlPoint(new Vector2f(0.5f, 0.0f));
    c.addControlPoint(new Vector2f(1.0f, 1.0f));
    c.addControlPoint(new Vector2f(0.0f, 1.0f));
   
    System.out.println(c.interpolate(-1.0f));
    System.out.println(c.interpolate(0.0f));
    System.out.println(c.interpolate(0.1f));
    System.out.println(c.interpolate(0.5f));
View Full Code Here

   
  }

  @Override
  public int addVertexToMesh(Vector3f point) {
    return addVertexToMesh(point, new Vector3f(0.0f, 0.0f, 0.0f), new Vector2f(0.0f, 0.0f), Color.WHITE);
  }
View Full Code Here

    return addVertexToMesh(point, new Vector3f(0.0f, 0.0f, 0.0f), new Vector2f(0.0f, 0.0f), Color.WHITE);
  }
 
  @Override
  public int addVertexToMesh(Vector3f point, Color color) {
    return addVertexToMesh(point, new Vector3f(0.0f, 0.0f, 0.0f), new Vector2f(0.0f, 0.0f), color);
  }
View Full Code Here

    return addVertexToMesh(point, new Vector3f(0.0f, 0.0f, 0.0f), texture, Color.WHITE);
  }

  @Override
  public int addVertexToMesh(Vector3f point, Vector3f normal, Color color) {
    return addVertexToMesh(point, normal, new Vector2f(0.0f, 0.0f), color);
  }
View Full Code Here

TOP

Related Classes of org.lwjgl.util.vector.Vector2f

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.