Examples of normalizeLocal()


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

            for (int j = 0; j <= radialSamples; j++) {
                final Vector3 kRadial = tempA.set(cos[j], 0, sin[j]);
                kRadial.multiplyLocal(radius);
                verts.put(kRadial.getXf()).put((float) center).put(kRadial.getZf());
                kRadial.normalizeLocal();
                norms.put(kRadial.getXf()).put(kRadial.getYf()).put(kRadial.getZf());
                final double radialFraction = 1 - (j * inverseRadial); // in [0,1)
                texs.put((float) radialFraction).put((float) lengthFraction);
            }

View Full Code Here

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

            for (int j = 0; j <= radialSamples; j++) {
                final Vector3 kRadial = tempA.set(cos[j], 0, sin[j]);
                kRadial.multiplyLocal(fSliceRadius);
                verts.put(kRadial.getXf()).put((float) (-center - halfHeight)).put(kRadial.getZf());
                kRadial.setY(-center);
                kRadial.normalizeLocal();
                norms.put(kRadial.getXf()).put(kRadial.getYf()).put(kRadial.getZf());
                final double radialFraction = 1 - (j * inverseRadial); // in [0,1)
                texs.put((float) radialFraction).put((float) lengthFraction);
            }
        }
View Full Code Here

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

     *            the position (in terms of vectors, not floats) of the vector to normalize
     */
    public static void normalizeVector3(final FloatBuffer buf, final int index) {
        final Vector3 temp = Vector3.fetchTempInstance();
        populateFromBuffer(temp, buf, index);
        temp.normalizeLocal();
        setInBuffer(temp, buf, index);
        Vector3.releaseTempInstance(temp);
    }

    /**
 
View Full Code Here

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

            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);
        }

        // ROTATION
        int rotX = 0, rotY = 0;
View Full Code Here

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

        final Vector3 store = new Vector3();
        for (int x = 0; x < _vertexCount; x++) {
            BufferUtils.populateFromBuffer(store, _normalCoords.getBuffer(), x);
            transform.applyForwardVector(store, store);
            if (normalize) {
                store.normalizeLocal();
            }
            BufferUtils.setInBuffer(store, _normalCoords.getBuffer(), x);
        }
    }
View Full Code Here

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

        if (xzp.equals(Vector3.ZERO)) {
            return;
        }

        _look.normalizeLocal();
        xzp.normalizeLocal();
        final double cosp = _look.dot(xzp);

        // compute the local orientation matrix for the billboard
        _orient.setValue(0, 0, xzp.getZ());
        _orient.setValue(0, 1, xzp.getX() * -_look.getY());
 
View Full Code Here

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

        }

        final Vector3 wanderTarget = _wanderTargets.get(index);

        wanderTarget.addLocal(calcNewJitter(), calcNewJitter(), calcNewJitter());
        wanderTarget.normalizeLocal();
        wanderTarget.multiplyLocal(_wanderRadius);

        _workVect.set(particle.getVelocity()).normalizeLocal().multiplyLocal(_wanderDistance);
        _workVect.addLocal(wanderTarget).normalizeLocal();
        _workVect.multiplyLocal(particle.getVelocity().length());
View Full Code Here

Examples of com.ardor3d.math.Vector4.normalizeLocal()

     *            the position (in terms of vectors, not floats) of the vector to normalize
     */
    public static void normalizeVector4(final FloatBuffer buf, final int index) {
        final Vector4 temp = Vector4.fetchTempInstance();
        populateFromBuffer(temp, buf, index);
        temp.normalizeLocal();
        setInBuffer(temp, buf, index);
        Vector4.releaseTempInstance(temp);
    }

    /**
 
View Full Code Here

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

        Quaternion viewRotation = viewTransform.getRotation(null);

        Vector3f v1 = new Vector3f(0, 0, 1);
        Vector3f normal = new Vector3f(0, 1, 0);
        Vector3f v2 = viewRotation.mult(v1);
        v2.normalizeLocal();

        // Compute the signed angle between v1 and v2. We do this with the
        // following formula: angle = atan2(normal dot (v1 cross v2), v1 dot v2)
        float dotProduct = v1.dot(v2);
        Vector3f crossProduct = v1.cross(v2);
View Full Code Here

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

     
            //Speed limiter
            float newVelocity = jump.length() / deltaTime;

            if (newVelocity > MAX_SPEED) {
                jump.normalizeLocal();
                jump.multLocal(MAX_SPEED * deltaTime);
            }
    
            jump.multLocal(1.0f/deltaTime);
            oldVelocity = jump;
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.