/* * Note - do not use - needs to be fixed */ bool C3ds::segInTriangle(FVector p, FVector d, FVector* v) { for (int j = 2, i = 0; i < 3; j = i, i++) { FVector e = v[i] - v[j]; FVector h = p - v[j]; FVector f = e % d; float dot = h * f; if (dot > 0.0f) { return false; } } FVector a = (v[1] - v[0]); FVector b = (v[2] - v[0]); FVector segNormal = (a % b).normalize(); FVector proj = b.normalize(); proj = a * (proj * proj); if (proj.magnitude() >= d.magnitude()) { std::cout << proj.magnitude() << std::endl; return true; } else return false; }
//angle in degrees float FVector::angle(FVector p) { float ang = RAD2DEG(acos(((*this)*p)/(this->magnitude()*p.magnitude()))); //if((p-(*this)).x>=0)ang+=90.0f; return ang; }