Examples of normalizeLocal()


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

        // Orient bone to point along axis formed by start and end points.
        final Matrix3 orient = Matrix3.fetchTempInstance();
        orient.lookAt(endPnt.subtractLocal(stPnt).normalizeLocal(), Vector3.UNIT_Y);
        final Quaternion q = new Quaternion().fromRotationMatrix(orient);
        q.normalizeLocal();
        SkeletalDebugger.bone.setWorldRotation(q);

        // Offset with skin transform
        SkeletalDebugger.bone.setWorldTransform(scene.getWorldTransform().multiply(
                SkeletalDebugger.bone.getWorldTransform(), null));
View Full Code Here

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

        if (kQ0.dot(kQ1) < 0.0) {
            kQ1.multiplyLocal(-1.0);
        }

        final Quaternion kQ = kQ0.addLocal(kQ1);
        kQ.normalizeLocal();

        final Matrix3 kBoxaxis = kQ.toRotationMatrix(Matrix3.fetchTempInstance());
        final Vector3 newXaxis = kBoxaxis.getColumn(0, Vector3.fetchTempInstance());
        final Vector3 newYaxis = kBoxaxis.getColumn(1, Vector3.fetchTempInstance());
        final Vector3 newZaxis = kBoxaxis.getColumn(2, Vector3.fetchTempInstance());
View Full Code Here

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

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

    /**
 
View Full Code Here

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

            double dz0 = (d001 - d000) * sx0 + (d101 - d100) * sx1;
            double dz1 = (d011 - d010) * sx0 + (d111 - d110) * sx1;
            double dz = dz0 * sy0 + dz1 * sy1;

            Vector3 normal = new Vector3(-dx, -dy, -dz);
            normal.normalizeLocal();
            return normal;
        } catch (Exception ex) {
            VoxelWorld.logger.log(Level.SEVERE,"NORMÁLGENERÁLÁSI HIBA");
            return new Vector3(0,1,0);
        }
View Full Code Here

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

                    final double eval3 = function.eval(heightX << baseClipmapLevel, heightY - 1 << baseClipmapLevel, 0);
                    final double eval4 = function.eval(heightX << baseClipmapLevel, heightY + 1 << baseClipmapLevel, 0);

                    normal.setX((eval1 - eval2) / 2.);
                    normal.setY((eval3 - eval4) / 2.);
                    normal.normalizeLocal();

                    final int index = (x + y * tileSize) * 3;
                    data.put(index, (byte) (normal.getX() * 255));
                    data.put(index + 1, (byte) (normal.getY() * 255));
                    data.put(index + 2, (byte) (normal.getZ() * 255));
 
View Full Code Here

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

    private void setNormalData() {
        final Vector3 norm = new Vector3();
        for (int i = 0; i < NUM_POINTS; i++) {
            BufferUtils.populateFromBuffer(norm, _meshData.getVertexBuffer(), i);
            norm.normalizeLocal();
            BufferUtils.setInBuffer(norm, _meshData.getNormalBuffer(), i);
        }
    }

    private void setVertexData() {
View Full Code Here

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

    private void setNormalData() {
        final Vector3 norm = new Vector3();
        for (int i = 0; i < NUM_POINTS; i++) {
            BufferUtils.populateFromBuffer(norm, _meshData.getVertexBuffer(), i);
            norm.normalizeLocal();
            BufferUtils.setInBuffer(norm, _meshData.getNormalBuffer(), i);
        }
    }

    private void setVertexData() {
View Full Code Here

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

    private void setNormalData() {
        final Vector3 norm = new Vector3();
        for (int i = 0; i < NUM_POINTS; i++) {
            BufferUtils.populateFromBuffer(norm, _meshData.getVertexBuffer(), i);
            norm.normalizeLocal();
            BufferUtils.setInBuffer(norm, _meshData.getNormalBuffer(), i);
        }
    }

    private void setVertexData() {
View Full Code Here

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

                final double phi = MathUtils.TWO_PI * radialFraction;
                final double cosPhi = MathUtils.cos(phi);
                final double sinPhi = MathUtils.sin(phi);
                tempNormal.set(radialAxis).multiplyLocal(cosPhi);
                tempNormal.setZ(tempNormal.getZ() + sinPhi);
                tempNormal.normalizeLocal();
                if (!_viewInside) {
                    _meshData.getNormalBuffer().put((float) tempNormal.getX()).put((float) tempNormal.getY())
                            .put((float) tempNormal.getZ());
                } else {
                    _meshData.getNormalBuffer().put((float) -tempNormal.getX()).put((float) -tempNormal.getY())
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
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.