Examples of multiplyLocal()


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

            // compute radius of slice
            final double fSliceRadius = Math.sqrt(Math.abs(radius * radius - center * center));

            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)
View Full Code Here

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

            final double center = halfHeight - (i * height / axisSamples);
            final double lengthFraction = (center + halfHeight + radius) / (height + 2 * radius);

            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.multiplyLocal()

            // compute radius of slice
            final double fSliceRadius = Math.sqrt(Math.abs(radius * radius - center * center));

            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)
View Full Code Here

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

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

    /**
 
View Full Code Here

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

                final double a = 1 - b - c;

                final Vector3 work = Vector3.fetchTempInstance();
                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntA);
                work.multiplyLocal(a);
                result.set(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntB);
                work.multiplyLocal(b);
                result.addLocal(work);
View Full Code Here

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

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntA);
                work.multiplyLocal(a);
                result.set(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntB);
                work.multiplyLocal(b);
                result.addLocal(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntC);
                work.multiplyLocal(c);
                result.addLocal(work);
View Full Code Here

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

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntB);
                work.multiplyLocal(b);
                result.addLocal(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntC);
                work.multiplyLocal(c);
                result.addLocal(work);
                Vector3.releaseTempInstance(work);
                break;
            }
            case Points: {
View Full Code Here

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

        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());
        particle.getVelocity().set(_workVect);
View Full Code Here

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

            final double angle = workVect.smallestAngleBetween(workVect2);
            if (angle < _deviance) {
                // if it is, increase the speed speedBump over time
                if (pVelocity.lengthSquared() < _maxSpeedSQ) {
                    final double change = _speedBump * dt;
                    workVect2.multiplyLocal(change); // where workVector2 = pVelocity.normalizeLocal()
                    pVelocity.addLocal(workVect2);
                }
            } else {
                final Vector3 axis = workVect2.crossLocal(workVect);
                // if it is not, shift the velocity to bring it back in line
View Full Code Here

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

        final Vector3 origin = store.set(source);
        final Vector3 direction = tmpStorage.set(destination).subtractLocal(origin);

        final double t = (planeHeight - origin.getY()) / (direction.getY());

        direction.multiplyLocal(t);
        origin.addLocal(direction);

        return t >= 0.0 && t <= 1.0;
    }
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.