Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Vector3f


  }

  @Override
  public Vector3f getPosition() {
    Vector2f pos = paddle.getPosition();
    return new Vector3f(pos.x, pos.y, 0.0f);
  }
View Full Code Here


    time = 0.0f;
    this.period = period;

    rotation = new Quaternion();
    rotation.setFromAxisAngle(new Vector4f(rotX, rotY, rotZ, angle));
    position = new Vector3f();

    light = Lighting.addLight(position, 0.1f * red, 0.1f * green, 0.1f * blue, red, green, blue, red, green, blue);

    // create display list
    displayList = GL11.glGenLists(1);
View Full Code Here

    GL11.glPopMatrix();
  }

  @Override
  public Vector3f getPosition() {
    return new Vector3f(position.x, position.y, position.z);
  }
View Full Code Here

    super(color, goManager);

    ballGlowVShader = ShaderManager.getInstance().getShader("ballGlow.arbvp1");
    ballGlowFShader = ShaderManager.getInstance().getShader("ballGlow.arbfp1");

    pos2d = new Vector3f(x, y, z);
    position = new Vector3f(x, y, z);
    this.textDist = textDist;
    tailDistance = new Vector3f(0.0f, 0.0f, 2.0f);
    rotationMatrix = new Matrix4f();

    state = State.NORMAL;
    normalColor = new Color(1.0f, 0.9f, 0.7f);
    this.hoverColor = hoverColor;
    applyColor = new Color(0.3f, 1.0f, 0.0f);
    discardColor = new Color(1.0f, 0.2f, 0.0f);

    tailColor = normalColor;

    float red = color.getR();
    float green = color.getG();
    float blue = color.getB();

    // create head light
    headLight = Lighting.addLight(position, 0.1f * red, 0.1f * green, 0.1f * blue, red, green, blue, red, green,
        blue);

    // create head display list
    headDisplayList = GL11.glGenLists(1);
    GL11.glNewList(headDisplayList, GL11.GL_COMPILE);

    GL11.glBegin(GL11.GL_QUADS);

    GL11.glVertex3f(-HEAD_RADIUS, -HEAD_RADIUS, 0.0f); // bottom left
    GL11.glVertex3f(HEAD_RADIUS, -HEAD_RADIUS, 0.0f); // bottom right
    GL11.glVertex3f(HEAD_RADIUS, HEAD_RADIUS, 0.0f); // top right
    GL11.glVertex3f(-HEAD_RADIUS, HEAD_RADIUS, 0.0f); // top left

    GL11.glEnd();

    GL11.glEndList();

    // create tail light
    tailPosition = new Vector3f();
    Vector3f.add(position, tailDistance, tailPosition);

    tailLight = Lighting.addLight(tailPosition, ambientFactor * normalColor.getR(),
        ambientFactor * normalColor.getG(), ambientFactor * normalColor.getB(),
        diffuseFactor * normalColor.getR(), diffuseFactor * normalColor.getG(),
 
View Full Code Here

    GL11.glPopMatrix();
  }

  @Override
  public Vector3f getPosition() {
    return new Vector3f(position.x, position.y, position.z);
  }
View Full Code Here

  public void setRotation(float x, float y) {
    rotationMatrix.setIdentity();

    // convert angles from degrees to radians
    rotationMatrix.rotate((float) (y * Math.PI / 180.0), new Vector3f(0.0f, 1.0f, 0.0f));
    rotationMatrix.rotate((float) (x * Math.PI / 180.0), new Vector3f(1.0f, 0.0f, 0.0f));

    applyRotation();
  }
View Full Code Here

   */
  public Vector3f getTextPosition() {
    Vector4f v1 = new Vector4f(pos2d.x, pos2d.y, pos2d.z - textDist, 1.0f);
    Vector4f v2 = Matrix4f.transform(rotationMatrix, v1, null);

    return new Vector3f(v2.x, v2.y, v2.z);
  }
View Full Code Here

      float rotZ, boolean lit, GraphicsObjectsManager goManager) {
    super(appearance, goManager);
    this.string = string;
    this.size = size;
    this.font = new Font();
    this.position = new Vector3f(position);
    this.rotX = rotX;
    this.rotY = rotY;
    this.rotZ = rotZ;
    this.lit = lit;
  }
View Full Code Here

    this.string = string;
  }

  @Override
  public Vector3f getPosition() {
    return new Vector3f(position);
  }
View Full Code Here

    position.y += y;
    position.z += z;
  }

  public void setPosition(Vector3f position) {
    this.position = new Vector3f(position);
  }
View Full Code Here

TOP

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

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.