Examples of divideLocal()


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

    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];
            float d110 = densities[x + 1][y + 1][z];
View Full Code Here

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

        height = fMinZ * (fMaxY - fMinY) * 0.5;

        final Vector3 newCenter = Vector3.fetchTempInstance();
        position.set((fMinX + fMaxX) * 0.5, (fMinY + fMaxY) * 0.5, 1.0, 1);
        shadowCam.getModelViewProjectionInverseMatrix().applyPre(position, position);
        position.divideLocal(position.getW());
        newCenter.set(position.getX(), position.getY(), position.getZ());

        shadowCam.lookAt(newCenter, Vector3.UNIT_Y);

        Vector3.releaseTempInstance(newCenter);
View Full Code Here

Examples of com.jme3.math.Vector2f.divideLocal()

    uv.subtractLocal(terrain.getWorldTranslation().x,
        terrain.getWorldTranslation().z); // center it on 0,0
    // float scaledSize = terrain.getTerrainSize()*scale;
    uv.addLocal(scaledWidth / 2, scaledWidth / 2); // shift the bottom left
                            // corner up to 0,0
    uv.divideLocal(scaledWidth); // get the location as a percentage

    return uv;
  }

  private static float byte2float(byte b) {
View Full Code Here

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

    //v3Ray /= fFar;
    Vector3f v3Ray = v3Pos.subtract(m_v3CameraPos);
    System.out.println("v3Ray: "+v3Ray);
    float fFar = v3Ray.length();
    System.out.println("fFar: "+fFar);
    v3Ray.divideLocal(fFar);
    System.out.println("v3Ray: "+v3Ray);
   
    // Calculate the closest intersection of the ray with the outer atmosphere (which is the near point of the ray passing through the atmosphere)
    // float fNear = getNearIntersection(m_v3CameraPos, v3Ray, m_fCameraHeight2, m_fOuterRadius2);
    float fNear = getNearIntersection(m_v3CameraPos, v3Ray, m_fCameraHeight2, m_fOuterRadius2);
View Full Code Here

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

        if (spatial != null) {
            Vector3f localLocation = spatial.getLocalTranslation();
            Quaternion localRotationQuat = spatial.getLocalRotation();
            if (spatial.getParent() != null) {
                localLocation.set(worldLocation).subtractLocal(spatial.getParent().getWorldTranslation());
                localLocation.divideLocal(spatial.getParent().getWorldScale());
                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);
                localRotationQuat.set(worldRotation);
                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().mult(localRotationQuat, localRotationQuat);
                spatial.setLocalTranslation(localLocation);
                spatial.setLocalRotation(localRotationQuat);
View Full Code Here

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

        if (enabled && spatial != null) {
            Vector3f localLocation = spatial.getLocalTranslation();
            Quaternion localRotationQuat = spatial.getLocalRotation();
            if (!applyLocal && spatial.getParent() != null) {
                localLocation.set(worldLocation).subtractLocal(spatial.getParent().getWorldTranslation());
                localLocation.divideLocal(spatial.getParent().getWorldScale());
                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);
                localRotationQuat.set(worldRotation);
                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().mult(localRotationQuat, localRotationQuat);

                spatial.setLocalTranslation(localLocation);
View Full Code Here

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

            Quaternion localRotationQuat = spatial.getLocalRotation();
            Vector3f localLocation = spatial.getLocalTranslation();
            if (!applyLocal && spatial.getParent() != null) {
                getPhysicsLocation(localLocation);
                localLocation.subtractLocal(spatial.getParent().getWorldTranslation());
                localLocation.divideLocal(spatial.getParent().getWorldScale());
                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);
                spatial.setLocalTranslation(localLocation);

                if (useViewDirection) {
                    localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
View Full Code Here

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

        }
        Quaternion localRotationQuat = wheelSpatial.getLocalRotation();
        Vector3f localLocation = wheelSpatial.getLocalTranslation();
        if (!applyLocal && wheelSpatial.getParent() != null) {
            localLocation.set(wheelWorldLocation).subtractLocal(wheelSpatial.getParent().getWorldTranslation());
            localLocation.divideLocal(wheelSpatial.getParent().getWorldScale());
            tmp_inverseWorldRotation.set(wheelSpatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);

            localRotationQuat.set(wheelWorldRotation);
            tmp_inverseWorldRotation.set(wheelSpatial.getParent().getWorldRotation()).inverseLocal().mult(localRotationQuat, localRotationQuat);
View Full Code Here

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

            // find center of frustum
            Vector3f center = new Vector3f();
            for (int i = 0; i < 8; i++) {
                center.addLocal(points[i]);
            }
            center.divideLocal(8f);

            Vector3f cDir = new Vector3f();
            for (int i = 0; i < 8; i++) {
                cDir.set(points[i]).subtractLocal(center);
                cDir.multLocal(scale - 1.0f);
View Full Code Here

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

            maxy = y > maxy ? y : maxy;
            miny = y < miny ? y : miny;
            maxz = z > maxz ? z : maxz;
            minz = z < minz ? z : minz;
        }
        center.divideLocal(limit / 3);

        float radius = Math.max(maxx - minx, maxy - miny) * 0.5f;
        return new BoundingTube(radius, maxz - minz, center);
    }

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.