Vector3f upXemit = upVector.cross(emissionDirection);
  public void updateRotationMatrix() {    float emit = emissionDirection.length();    if (emit < 0.1F) {      return;    }    Vector3f abUpMinUp = new Vector3f();    Vector3f absUpVector = new Vector3f();    float matData[][] = new float[3][3];    emissionDirection.multLocal(1.0f / emit);    Vector3f upXemit = upVector.cross(emissionDirection);    float upDotEmit = upVector.dot(emissionDirection);    if ( ( (double) FastMath.abs(upDotEmit)) > 1.0d - FastMath.DBL_EPSILON) {      absUpVector.x = upVector.x <= 0.0f ? -upVector.x : upVector.x;      absUpVector.y = upVector.y <= 0.0f ? -upVector.y : upVector.y;      absUpVector.z = upVector.z <= 0.0f ? -upVector.z : upVector.z;      if (absUpVector.x < absUpVector.y) {        if (absUpVector.x < absUpVector.z) {          absUpVector.x = 1.0f;          absUpVector.y = absUpVector.z = 0.0f;        } else {          absUpVector.z = 1.0f;          absUpVector.x = absUpVector.y = 0.0f;        }      } else      if (absUpVector.y < absUpVector.z) {        absUpVector.y = 1.0f;        absUpVector.x = absUpVector.z = 0.0f;      } else {        absUpVector.z = 1.0f;        absUpVector.x = absUpVector.y = 0.0f;      }      abUpMinUp = absUpVector.subtract(upVector);      upXemit = absUpVector.subtract(emissionDirection);      float f4 = 2.0f / abUpMinUp.dot(abUpMinUp);      float f6 = 2.0f / upXemit.dot(upXemit);      float f8 = f4 * f6 * abUpMinUp.dot(upXemit);      float af1[] = {          abUpMinUp.x, abUpMinUp.y, abUpMinUp.z      };      float af2[] = {          upXemit.x, upXemit.y, upXemit.z      };      for (int i = 0; i < 3; i++) {        for (int j = 0; j < 3; j++) {          matData[i][j] = ( -f4 * af1[i] * af1[j] - f6 * af2[i] * af2[j]) +              f8 * af2[i] * af1[j];        }        matData[i][i]++;      }    } else {      float f2 = 1.0f / (1.0f + upDotEmit);      float f5 = f2 * upXemit.x;      float f7 = f2 * upXemit.z;      float f9 = f5 * upXemit.y;      float f10 = f5 * upXemit.z;      float f11 = f7 * upXemit.y;      matData[0][0] = upDotEmit + f5 * upXemit.x;      matData[0][1] = f9 - upXemit.z;      matData[0][2] = f10 + upXemit.y;      matData[1][0] = f9 + upXemit.z;      matData[1][1] = upDotEmit + f2 * upXemit.y * upXemit.y;      matData[1][2] = f11 - upXemit.x;      matData[2][0] = f10 - upXemit.y;      matData[2][1] = f11 + upXemit.x;      matData[2][2] = upDotEmit + f7 * upXemit.z;    }    rotMatrix.set(matData);  }