Android Open Source - touchgloid Vector






From Project

Back to project page touchgloid.

License

The source code is released under:

MIT License

If you think the Android project touchgloid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package rucamzu.opengl;
//w  w  w  .  j av a  2s.c  om
public class Vector {

  private final float[] elements;

  private Vector() {
    elements = new float[4];
  }

  private Vector(float[] elements) {
    this.elements = elements;
  }

  public static Vector create() {
    return create(0.0f, 0.0f, 0.0f, 1.0f);
  }

  public static Vector create(float x, float y, float z, float w) {
    Vector vector = new Vector();

    vector.elements[0] = x;
    vector.elements[1] = y;
    vector.elements[2] = z;
    vector.elements[3] = w;

    return vector;
  }

  public float x() {
    return elements[0];
  }

  public float y() {
    return elements[1];
  }

  public float z() {
    return elements[2];
  }

  public float w() {
    return elements[3];
  }

  public float[] getElements() {
    return elements;
  }

}




Java Source Code List

rucamzu.opengl.Buffer.java
rucamzu.opengl.FragmentShader.java
rucamzu.opengl.IndexBuffer.java
rucamzu.opengl.Object.java
rucamzu.opengl.Program.java
rucamzu.opengl.Shader.java
rucamzu.opengl.Transform.java
rucamzu.opengl.Vector.java
rucamzu.opengl.VertexBuffer.java
rucamzu.opengl.VertexShader.java
rucamzu.touchgloid.TouchgloidActivity.java
rucamzu.touchgloid.TouchgloidRenderer.java
rucamzu.touchgloid.TouchgloidView.java