Package general.datastructures

Examples of general.datastructures.Vector2f.y()


  @Test
  public void testVector2f() {
    Vector2f vec1 = new Vector2f(5, 7);
    assertEquals(5,vec1.x(),0.0001);
    assertEquals(7,vec1.y(),0.0001);
   
    Vector2f vec2 = new Vector2f(5);
    assertTrue(vec1.isInRange(vec2, 2.0001f));
    assertFalse(vec1.isInRange(vec2, 1.9999f));
    assertEquals(Math.sqrt(50), vec2.length(), 0.0001);   
View Full Code Here


    Vector2f vec3 = new Vector2f(vec1);
    assertEquals(vec1, vec3);
   
    vec3.add(vec1);
    assertEquals(10, vec3.x(),0.0001);
    assertEquals(14, vec3.y(),0.0001);
   
    Vector2f vec4 = new Vector2f(4,0);
    vec4.normalize();
    assertEquals(1, vec4.length(), 0.0001);
    vec4.scale(3f);
View Full Code Here

     
      glPushMatrix();
     
      tex.bind();   
     
      glTranslatef(Math.worldToScreen(wc_position.x(),viewport.getLeft()), Math.worldToScreen(wc_position.y(),viewport.getTop()), 0f);
     
      glRotatef(rotation, 0, 0, 1.0f);
      //glTranslatef(-texture.getImageWidth()/2, -texture.getImageHeight()/2, 0);
     
      glVertexPointer(2, 0, s.getVertexBuffer());
View Full Code Here

      Vector2f currentpoint = currentWP.getVector2f();

      newWaypoints = new Vector<Waypoint>(8);

      //8er Nachbarschaft hinzufuegen
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
View Full Code Here

      newWaypoints = new Vector<Waypoint>(8);

      //8er Nachbarschaft hinzufuegen
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y() ),     1      ,currentWP));
View Full Code Here

      newWaypoints = new Vector<Waypoint>(8);

      //8er Nachbarschaft hinzufuegen
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
View Full Code Here

      //8er Nachbarschaft hinzufuegen
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
View Full Code Here

      //8er Nachbarschaft hinzufuegen
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));

      //System.err.println("Alle punkte zum vektor hinzugefuegt");
View Full Code Here

      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));

      //System.err.println("Alle punkte zum vektor hinzugefuegt");
View Full Code Here

      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()-1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()-1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x() , currentpoint.y()+1 ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()-1 ),   Math.sqrt(2,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y() ),     1      ,currentWP));
      newWaypoints.add(new Waypoint(new Vector2f(currentpoint.x()+1 , currentpoint.y()+1 ),   Math.sqrt(2,currentWP));

      //System.err.println("Alle punkte zum vektor hinzugefuegt");

      for(Waypoint wp : newWaypoints)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.