Package nexus.model.structs

Examples of nexus.model.structs.Vector3


    Planes.makeQuad2f(b, a);
  }
 
  @Test
  public void makeQuad2fXAxis() {
    Vector3 a = new Vector3(0, 0, 0);
    Vector3 b = new Vector3(0, 1, 1);
    float[] result = Planes.makeQuad2f(a, b);
    float[] expected = new float[] { 0, 0, 0, 0, 1, 1, 0, 1, 0,
                     0, 1, 1, 0, 0, 0, 0, 0, 1 };
   
    System.out.println("x axis");
View Full Code Here


    assertEquals("got " + Arrays.toString(expected) + "\nexpected " + Arrays.toString(result), true, Arrays.equals(expected, result));
  }
 
  @Test
  public void makeQuad2fZAxis() {
    Vector3 a = new Vector3(0, 0, 0);
    Vector3 b = new Vector3(1, 1, 0);
    float[] result = Planes.makeQuad2f(a, b);
    float[] expected = new float[] { 0, 0, 0, 1, 1, 0, 0, 1, 0,
                     1, 1, 0, 0, 0, 0, 1, 0, 0 };
   
    System.out.println("z axis");
View Full Code Here

    assertEquals("got " + Arrays.toString(expected) + "\nexpected " + Arrays.toString(result), true, Arrays.equals(expected, result));
  }
 
  @Test
  public void makeQuad2fYAxis() {
    Vector3 a = new Vector3(0, 0, 0);
    Vector3 b = new Vector3(1, 0, 1);
    float[] result = Planes.makeQuad2f(a, b);
    float[] expected = new float[] { 0, 0, 0, 1, 0, 1, 0, 0, 1,
                     1, 0, 1, 0, 0, 0, 1, 0, 0 };
   
    System.out.println("y axis");
View Full Code Here

    assertEquals("got " + Arrays.toString(expected) + "\nexpected " + Arrays.toString(result), true, Arrays.equals(expected, result));
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void makeQuad2fNonOrtho() {
    Vector3 a = new Vector3(0, 0, 0);
    Vector3 b = new Vector3(1, 1, 1);
    Planes.makeQuad2f(a, b);
  }
View Full Code Here

public class Vector3Test {

  @Test
  public void testEqualsVector3True() {
    Vector3 a = new Vector3(0f, 1.001f, 2f);
    Vector3 b = new Vector3(0f, 1.001f, 2.0f);
   
    assertEquals(true, a.equals(b));
  }
View Full Code Here

    assertEquals(true, a.equals(b));
  }
 
  @Test
  public void testEqualsVector3False() {
    Vector3 a = new Vector3(0f, 1f, 0.0f);
    Vector3 b = new Vector3(1f, 1f, 1f);
   
    assertEquals(false, a.equals(b));
  }
View Full Code Here

    assertEquals(false, a.equals(b));
  }
 
  @Test
  public void testAdd() {
    Vector3 a = new Vector3(4f, -4f, -4f);
    Vector3 b = new Vector3(1f, 3f, -2f);
    Vector3 expect = new Vector3(5f, -1f, -6f);
    Vector3 result = a.add(b);
   
    assertEquals(result.toString(), true, result.equals(expect));
  }
View Full Code Here

    assertEquals(result.toString(), true, result.equals(expect));
  }

  @Test
  public void testSubtract() {
    Vector3 a = new Vector3(4f, -4f, -4f);
    Vector3 b = new Vector3(1f, 3f, -2f);
    Vector3 expect = new Vector3(3f, -7f, -2f);
    Vector3 result = a.subtract(b);
   
    assertEquals(result.toString(), true, result.equals(expect));
  }
View Full Code Here

    assertEquals(result.toString(), true, result.equals(expect));
  }

  @Test
  public void testLength() {
    Vector3 a = new Vector3(1f, 2f, 2f);
   
    assertEquals(3f, a.length(), 0);
  }
View Full Code Here

    assertEquals(3f, a.length(), 0);
  }

  @Test
  public void testLengthSquared() {
    Vector3 a = new Vector3(1f, 2f, 2f);
   
    assertEquals(9f, a.lengthSquared(), 0);
  }
View Full Code Here

TOP

Related Classes of nexus.model.structs.Vector3

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.