141 if (dotprod <= 0.0) {
143 }
else if (dotprod >=
Length) {
177#ifdef ALLOW_TEMPORARIES
180 float top1 = cross2 * cross1;
181 float bottom1 = cross1 * cross1;
185 float top2 = cross4 * cross3;
186 float bottom2 = cross3 * cross3;
188 Vector3 cross1, cross2, cross3, cross4;
204 if (bottom1 != 0 && bottom2 != 0) {
205 float length1 = top1 / bottom1;
206 float length2 = top2 / bottom2;
212 (*p1) =
P0 + (
Dir * length1);
213 (*p2) = other_line.
P0 + (other_line.
Dir * length2);
218 if (fraction1 !=
NULL) {
219 (*fraction1) = length1 /
Length;
222 if (fraction2 !=
NULL) {
223 (*fraction2) = length2 /
Length;
Vector3 Find_Point_Closest_To(const Vector3 &pos) const
void Set(const Vector3 &p0, const Vector3 &p1)
bool Find_Intersection(const LineSegClass &other_line, Vector3 *p1, float *fraction1, Vector3 *p2, float *fraction2) const
void Set_Random(const Vector3 &min, const Vector3 &max)
Vector3 Rotate_Vector(const Vector3 &vect) const
static WWINLINE void Transform_Vector(const Matrix3D &tm, const Vector3 &in, Vector3 *out)
static WWINLINE float Dot_Product(const Vector3 &a, const Vector3 &b)
static WWINLINE void Cross_Product(const Vector3 &a, const Vector3 &b, Vector3 *result)
static float Random_Float(void)