Examples of subtractLocal()


Examples of com.ardor3d.math.Vector3.subtractLocal()

    }

    public Vector3 computeVoxelNormal(int x, int y, int z, ReadOnlyVector3 position) {
       
        Vector3 local = new Vector3(position);
        local.subtractLocal(basePosition);
        local.divideLocal(pool.getLevel().getScale());
        try {
            float d000 = densities[x][y][z];
            float d100 = densities[x + 1][y][z];
            float d010 = densities[x][y + 1][z];
View Full Code Here

Examples of com.ardor3d.math.Vector3.subtractLocal()

        double scale = level.getScale();
        int blockSize = VoxelWorld.BLOCK_SIZE;

        if (hasBoundingBox()) {
            Vector3 lower = getLowerBound();
            lower.subtractLocal(basePosition);
            Vector3 upper = getUpperBound();
            upper.subtractLocal(basePosition);
            minX = Math.max(0,(int)Math.floor(lower.getX() / scale));
            minY = Math.max(0,(int)Math.floor(lower.getY() / scale));
            minZ = Math.max(0,(int)Math.floor(lower.getZ() / scale));
View Full Code Here

Examples of com.ardor3d.math.Vector3.subtractLocal()

        if (hasBoundingBox()) {
            Vector3 lower = getLowerBound();
            lower.subtractLocal(basePosition);
            Vector3 upper = getUpperBound();
            upper.subtractLocal(basePosition);
            minX = Math.max(0,(int)Math.floor(lower.getX() / scale));
            minY = Math.max(0,(int)Math.floor(lower.getY() / scale));
            minZ = Math.max(0,(int)Math.floor(lower.getZ() / scale));
            maxX = Math.min(blockSize+1,(int)Math.ceil(upper.getX() / scale));
            maxY = Math.min(blockSize+1,(int)Math.ceil(upper.getY() / scale));
View Full Code Here

Examples of com.ardor3d.math.Vector3.subtractLocal()

        if (moveFB != 0 || strafeLR != 0) {
            final Vector3 loc = _workerStoreA.zero();
            if (moveFB == 1) {
                loc.addLocal(camera.getDirection());
            } else if (moveFB == -1) {
                loc.subtractLocal(camera.getDirection());
            }
            if (strafeLR == 1) {
                loc.addLocal(camera.getLeft());
            } else if (strafeLR == -1) {
                loc.subtractLocal(camera.getLeft());
View Full Code Here

Examples of com.ardor3d.math.Vector3.subtractLocal()

                loc.subtractLocal(camera.getDirection());
            }
            if (strafeLR == 1) {
                loc.addLocal(camera.getLeft());
            } else if (strafeLR == -1) {
                loc.subtractLocal(camera.getLeft());
            }
            loc.normalizeLocal().multiplyLocal(_moveSpeed * tpf).addLocal(camera.getLocation());
            camera.setLocation(loc);
        }

View Full Code Here

Examples of com.ardor3d.math.Vector3.subtractLocal()

            if (first.getVnIndex() == -1 || second.getVnIndex() == -1 || third.getVnIndex() == -1) {
                // Generate flat face normal.
                final Vector3 v = new Vector3(_dataStore.getVertices().get(second.getVIndex()));
                final Vector3 w = new Vector3(_dataStore.getVertices().get(third.getVIndex()));
                v.subtractLocal(_dataStore.getVertices().get(first.getVIndex()));
                w.subtractLocal(_dataStore.getVertices().get(first.getVIndex()));
                v.crossLocal(w);
                v.normalizeLocal();
                _dataStore.getGeneratedNormals().add(v);
                final int genIndex = -1 * (_dataStore.getGeneratedNormals().size() - 1) - 2;
                if (first.getVnIndex() == -1) {
View Full Code Here

Examples of com.jme.math.Vector2f.subtractLocal()

     */
    public synchronized void userMovePlanarUpdate (Vector2f dragVector) {
       
        // Calculate the delta of the movement since the last update
        Vector2f deltaDragVector = dragVector.clone();
        deltaDragVector.subtractLocal(userMovePlanarDragVectorPrev);
        userMovePlanarDragVectorPrev = dragVector;

        applyDeltaTranslationUser(new Vector3f(deltaDragVector.x, deltaDragVector.y, 0f), true);
    }

View Full Code Here

Examples of com.jme.math.Vector3f.subtractLocal()

  logger.finer("Set targetPosition " + targetPosition
      + " rotation " + rotation);

        Vector3f positionError  = new Vector3f(targetPosition);
            positionError.subtractLocal(currentPosition);
 
  float length = positionError.length();

  logger.fine("current " + currentPosition + "target "
      + targetPosition + " error " + length);
View Full Code Here

Examples of com.jme.math.Vector3f.subtractLocal()

        continue;
            }
       
            //Difference between where we are and where we want to be.
            Vector3f positionError = new Vector3f(targetPosition);
            positionError.subtractLocal(currentPosition);
   
            if (positionError.length() < EPSILON) {
    logger.fine("Orb reached target position.");

    if (listener != null) {
View Full Code Here

Examples of com.jme.math.Vector3f.subtractLocal()

        // Then substitute t into the Ray Equation to get the intersection point.
        //
        // Source: Various: Lars Bishop book, Geometry Toolbox, Doug T.

        Vector3f pointDiffVec = new Vector3f(planePoint);
        pointDiffVec.subtractLocal(ray.getOrigin());
        float numerator = planeNormal.dot(pointDiffVec);
        float denominator = planeNormal.dot(ray.getDirection());
        if (denominator == 0f) {
            // No intersection
            return null;
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.