Package com.base.engine.core

Examples of com.base.engine.core.Vector2f


  private Vector3f m_normal;
  private Vector3f m_tangent;
 
  public Vertex(Vector3f pos)
  {
    this(pos, new Vector2f(0,0));
  }
View Full Code Here


    return Display.getTitle();
  }

  public Vector2f GetCenter()
  {
    return new Vector2f(GetWidth()/2, GetHeight()/2);
  }
View Full Code Here

              Float.valueOf(tokens[2]),
              Float.valueOf(tokens[3])));
        }
        else if(tokens[0].equals("vt"))
        {
          m_texCoords.add(new Vector2f(Float.valueOf(tokens[1]),
              1.0f - Float.valueOf(tokens[2])));
        }
        else if(tokens[0].equals("vn"))
        {
          m_normals.add(new Vector3f(Float.valueOf(tokens[1]),
View Full Code Here

    for(int i = 0; i < m_indices.size(); i++)
    {
      OBJIndex currentIndex = m_indices.get(i);

      Vector3f currentPosition = m_positions.get(currentIndex.GetVertexIndex());
      Vector2f currentTexCoord;
      Vector3f currentNormal;

      if(m_hasTexCoords)
        currentTexCoord = m_texCoords.get(currentIndex.GetTexCoordIndex());
      else
        currentTexCoord = new Vector2f(0,0);

      if(m_hasNormals)
        currentNormal = m_normals.get(currentIndex.GetNormalIndex());
      else
        currentNormal = new Vector3f(0,0,0);
View Full Code Here

  }

  @Override
  public void Input(float delta)
  {
    Vector2f centerPosition = new Vector2f(Window.GetWidth()/2, Window.GetHeight()/2);

    if(Input.GetKey(m_unlockMouseKey))
    {
      Input.SetCursor(true);
      m_mouseLocked = false;
    }
    if(Input.GetMouseDown(0))
    {
      Input.SetMousePosition(centerPosition);
      Input.SetCursor(false);
      m_mouseLocked = true;
    }

    if(m_mouseLocked)
    {
      Vector2f deltaPos = Input.GetMousePosition().Sub(centerPosition);

      boolean rotY = deltaPos.GetX() != 0;
      boolean rotX = deltaPos.GetY() != 0;

      if(rotY)
        GetTransform().Rotate(Y_AXIS, (float) Math.toRadians(deltaPos.GetX() * m_sensitivity));
      if(rotX)
        GetTransform().Rotate(GetTransform().GetRot().GetRight(), (float) Math.toRadians(-deltaPos.GetY() * m_sensitivity));

      if(rotY || rotX)
        Input.SetMousePosition(centerPosition);
    }
  }
View Full Code Here

TOP

Related Classes of com.base.engine.core.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.