static public boolean intersect2(DwRay3D ray, float[] A, float[] B, float[] C, boolean two_sided, float[] ptr_hit_backface, float[] tuv){
    DwVec3.sub_ref(B, A, E1); // edge1: v0 -> v1
    DwVec3.sub_ref(C, A, E2); // edge2: v0 -> v2
    
    DwVec3.cross_ref(E1, E2, n);     // normal
    if( DwVec3.dot(n, ray.d) > 0.0){ // angle > 0.0
      ptr_hit_backface[0] = -1.0f;   // if there is any intersection it would be with a backface
      if( two_sided ) {              // so if the triangle is two_sided, switch edges for further computation
        E_TMP = E1; E1 = E2; E2 = E_TMP;
      } else {
        return false;      // otherwise return "no intersection"
      }
    } else {
      ptr_hit_backface[0]= +1.0f;    // no backface, so normal direction stays the same
    }

    DwVec3.cross_ref(ray.d, E2, P); // cross of ray-direction and edge2
    det = DwVec3.dot(E1, P);        // determinant
    if( Math.abs(det) < epsilon ) return false;
//    if( det < epsilon ) return false;
    
    DwVec3.sub_ref(ray.o, A, T);   // vector: v0 -> ray-origin
    u = DwVec3.dot(T, P);        // param u, + testing bounds
    if( u < 0.0 || u > det) return false;

    DwVec3.cross_ref(T, E1, Q); // cross of T and edge2
    v = DwVec3.dot(Q, ray.d);        // param v, + testing bounds
    if( v < 0.0 || (u+v) > det) return false;

    det = 1f/det;
    tuv[0] = det*DwVec3.dot(Q, E2);
    tuv[1] = det*u;
    tuv[2] = det*v;
    return true;
  }