Examples of normalizeLocal()


Examples of com.jme3.math.Vector3f.normalizeLocal()

    }

    public Vector3f getNormal(){
        Vector3f normal = new Vector3f(pointb);
        normal.subtractLocal(pointa).crossLocal(pointc.x-pointa.x, pointc.y-pointa.y, pointc.z-pointa.z);
        normal.normalizeLocal();
        return normal;
    }

    public float getExtreme(int axis, boolean left){
        float v1, v2, v3;
View Full Code Here

Examples of com.jme3.math.Vector3f.normalizeLocal()

                    float distance = curvePoints[indexes[1]].subtract(curvePoints[indexes[0]], subtractResult).length();
                    Vector3f[] bevel = bevels.get(indexes[0]);
                    Vector3f[] nextBevel = bevels.get(indexes[1]);
                    for (int i = 0; i < bevel.length; ++i) {
                        float d = bevel[i].subtract(nextBevel[i], subtractResult).length();
                        subtractResult.normalizeLocal().multLocal(distance - d);
                        bevel[i].addLocal(subtractResult);
                    }
                }
            }
View Full Code Here

Examples of com.jme3.math.Vector3f.normalizeLocal()

    private Vector3f[] transformBevel(Vector3f[] bevel, Vector3f prevPos, Vector3f currPos, Vector3f nextPos) {
        bevel = bevel.clone();

        // currPos and directionVector define the line in 3D space
        Vector3f directionVector = prevPos != null ? currPos.subtract(prevPos) : nextPos.subtract(currPos);
        directionVector.normalizeLocal();

        // plane is described by equation: Ax + By + Cz + D = 0 where planeNormal = [A, B, C] and D = -(Ax + By + Cz)
        Vector3f planeNormal = null;
        if (prevPos != null) {
            planeNormal = currPos.subtract(prevPos).normalizeLocal();
View Full Code Here

Examples of com.jme3.math.Vector3f.normalizeLocal()

    }

    public Vector3f getNormal(){
        Vector3f normal = new Vector3f(pointb);
        normal.subtractLocal(pointa).crossLocal(pointc.x-pointa.x, pointc.y-pointa.y, pointc.z-pointa.z);
        normal.normalizeLocal();
        return normal;
    }

}
View Full Code Here

Examples of com.jme3.math.Vector3f.normalizeLocal()

                normal.set(normalBuffer.get(idx), normalBuffer.get(idx+1), normalBuffer.get(idx+2));
                tangent.set(normal.cross(new Vector3f(0,0,1)));
                binormal.set(new Vector3f(1,0,0).cross(normal));
               
                BufferUtils.setInBuffer(tangent.normalizeLocal(), tangentStore, (r * getWidth() + c)); // save the tangent
                BufferUtils.setInBuffer(binormal.normalizeLocal(), binormalStore, (r * getWidth() + c)); // save the binormal
            }
        }

/*        for (int r = 0; r < getHeight(); r++) {
            for (int c = 0; c < getWidth(); c++) {
View Full Code Here

Examples of com.jme3.math.Vector3f.normalizeLocal()

                        normal.addLocal( getNormal(leftPoint, rootPoint, bottomPoint, scale, tmp1) );
                        normal.addLocal( getNormal(bottomPoint, rootPoint, rightPoint, scale, tmp1) );
                        normal.addLocal( getNormal(rightPoint, rootPoint, topPoint, scale, tmp1) );
                    }
                }
                normal.normalizeLocal();
                BufferUtils.setInBuffer(normal, store, (r * getWidth() + c)); // save the normal
            }
        }
        vars.release();
       
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.normalizeLocal()

    //Get direction vector from eye to camera
    Vector3D dirToCamVect = camPos.getSubtracted(viewCenterPos);
    //get the length of that vector
    float mag = dirToCamVect.length();
    //normalize the vector
    dirToCamVect.normalizeLocal();
    //scale the normalized vector with the original amount + the zoom amount
    dirToCamVect.scaleLocal(mag + amount);
   
    if (dirToCamVect.length() > zoomMinDistance){
      //Get the Vector to the camera from origin
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.normalizeLocal()

          //Also checks if normals are attempted to be added that are equal to this faces normal
          //or normals that have already been added -> those are not added
         
//          /*
          Vector3D normalizedFaceNormal = this.normal.getCopy();
          normalizedFaceNormal.normalizeLocal();

          logger.debug("");
          logger.debug("Face " + index + " normal: " + this.normal + " Normalized: " + normalizedFaceNormal);
          logger.debug("P0:");

View Full Code Here

Examples of org.mt4j.util.math.Vector3D.normalizeLocal()

            MyFace neighborFaceP0 = smoothNeighborsP0.get(i);

            Vector3D nextSmoothNeighborNormal       = neighborFaceP0.normal;
            Vector3D nextSmoothNeighborNormalNormalized = nextSmoothNeighborNormal.getCopy();
            //TODO doch nochmal probieren mit vorher ausgerechneter normal? sonst performance loss!
            nextSmoothNeighborNormalNormalized.normalizeLocal();//neighborFaceP0.normalNormalized;
            boolean alreadyAddedSameNormalIn = false;
           
           
            //Dont add faces normals that are equal to this faces normals
            if (!useNormalsEqualToFace && nextSmoothNeighborNormalNormalized.equalsVectorWithTolerance(normalizedFaceNormal, ToolsMath.ZERO_TOLERANCE)){
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.normalizeLocal()

            MyFace neighborFaceP1 = smoothNeighborsP1.get(i);

            Vector3D nextSmoothNeighborNormal       = neighborFaceP1.normal;
            Vector3D nextSmoothNeighborNormalNormalized = nextSmoothNeighborNormal.getCopy();
            //TODO doch nochmal probieren mit vorher ausgerechneter normal? sonst performance loss!
            nextSmoothNeighborNormalNormalized.normalizeLocal();//neighborFaceP1.normalNormalized;
            boolean alreadyAddedSameNormalIn = false;
           
            //Dont add faces normals that are equal to this faces normals
            if (!useNormalsEqualToFace && nextSmoothNeighborNormalNormalized.equalsVectorWithTolerance(normalizedFaceNormal, ToolsMath.ZERO_TOLERANCE)){
              alreadyAddedSameNormalIn = true;
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.