Package javax.vecmath

Examples of javax.vecmath.Vector3f.normalize()


   
    worldTransform.getRotation(rot);
   
    //Vector3f v = new Vector3f(1,1,1);
    Vector3f v = new Vector3f(1,0,0);
    v.normalize();
   
    Vector3f out = new Vector3f();
   
    QuaternionUtil.quatRotate(rot, v, out);
   
View Full Code Here


        DirectionalLight lightDirectional = new DirectionalLight();
        lightDirectional.setInfluencingBounds(_bounds);

        Vector3f direction = new Vector3f(0.0f, -1.0f, -1.0f);
        direction.normalize();
        lightDirectional.setDirection(direction);
        lightDirectional.setColor(new Color3f(1.0f, 1.0f, 1.0f));
        lightRoot.addChild(lightDirectional);

        _simpleUniverse.getViewer().getView().setLocalEyeLightingEnable(true);
View Full Code Here

    }

    private Vector3f computeDirection() {
        Vector3f direction = new Vector3f(cosinusRiseAngle, -(sinusRiseAngle * sinusZenithAngle), -cosinusZenithAngle
                * sinusRiseAngle);
        direction.normalize();
        return direction;
    }

    private void computeZenithAngleData() {
        double zenithAngle = sun.getZenithAngle().getValue().doubleValue() * Math.PI / 2;
View Full Code Here

    }

    private Vector3f computeDirection() {
        Vector3f direction = new Vector3f(cosinusRiseAngle, -(sinusRiseAngle * sinusZenithAngle), -cosinusZenithAngle
                * sinusRiseAngle);
        direction.normalize();
        return direction;
    }

    private void computeZenithAngleData() {
        double zenithAngle = sun.getZenithAngle().doubleValue() * Math.PI / 2;
View Full Code Here

    s2.sub(base);
   
    Vector3f n = new Vector3f();
    n.cross(s1, s2);
   
    n.normalize();

    return n;
  }
  private float GetHFHeight(double[][] hf, int basex, int basey) {
    int w = hf.length;
View Full Code Here

    Vector3f normal = Stack.alloc(Vector3f.class);
    tmp1.sub(vertices1[1], vertices1[0]);
    tmp2.sub(vertices1[2], vertices1[0]);
    normal.cross(tmp1, tmp2);
    normal.normalize();

    plane.set(normal.x, normal.y, normal.z, vertices1[0].dot(normal));
  }

  public boolean overlap_test_conservative(TriangleShapeEx other) {
View Full Code Here

   */
  public static void edge_plane(Vector3f e1, Vector3f e2, Vector3f normal, Vector4f plane) {
    Vector3f planenormal = Stack.alloc(Vector3f.class);
    planenormal.sub(e2, e1);
    planenormal.cross(planenormal, normal);
    planenormal.normalize();

    plane.set(planenormal);
    plane.w = e2.dot(planenormal);
  }
 
View Full Code Here

    Vector3f normal = Stack.alloc(Vector3f.class);
    tmp1.sub(vertices[1], vertices[0]);
    tmp2.sub(vertices[2], vertices[0]);
    normal.cross(tmp1, tmp2);
    normal.normalize();

    plane.set(normal.x, normal.y, normal.z, vertices[0].dot(normal));
  }

  /**
 
View Full Code Here

        case 2: {
          tmp1.sub(simplex[1].w, simplex[0].w);
          tmp2.sub(simplex[2].w, simplex[0].w);
          Vector3f n = Stack.alloc(Vector3f.class);
          n.cross(tmp1, tmp2);
          n.normalize();

          Support(n, simplex[3]);

          tmp.negate(n);
          Support(tmp, simplex[4]);
View Full Code Here

        getEdge(i, pa, pb);
        Vector3f edge = Stack.alloc(Vector3f.class);
        edge.sub(pb, pa);
        Vector3f edgeNormal = Stack.alloc(Vector3f.class);
        edgeNormal.cross(edge, normal);
        edgeNormal.normalize();
        /*float*/ dist = pt.dot(edgeNormal);
        float edgeConst = pa.dot(edgeNormal);
        dist -= edgeConst;
        if (dist < -tolerance) {
          return false;
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.