83 if (t >= 0. && t <= 1. && s >= 0.)
92 bool solveLin2x2(
double a11,
double a12,
double a21,
double a22,
double b1,
double b2,
double& x1,
double& x2)
94 const double det{a11 * a22 - a21 * a12};
103 const double det_inv{1. / det};
104 x1 = (a22 * b1 - a12 * b2) * det_inv;
105 x2 = (a11 * b2 - a21 * b1) * det_inv;
bool solveLin2x2(double a11, double a12, double a21, double a22, double b1, double b2, double &x1, double &x2)
Solve a 2x2 linear system of equations Ax = b.
bool segmentIntersectsSemiLine2D(const OVector3D &vAB, const OVector3D &vMN, const OVector3D &vAM)
Test if the segment [MN] intersects the semi-line [AB) in 2D (horizontal plane z = 0)
OVector3D buildVector2D(const OPoint3D &pA2D, const OPoint3D &pB2D)
Optimized way to build a vector in 2D (horizontal plane z = 0) from point A to B To use as a replacem...
double _y
y coordinate of OCoord3D
double _x
x coordinate of OCoord3D
Class to define a segment.
OPoint3D _ptA
Point A of the segment.
OPoint3D _ptB
Point B of the segment.
void invert()
Inverts this vector.
double scalar(const OVector3D &vector) const
Performs the scalar product between this object and another vector.
OVector3D cross(const OVector3D &vector) const
Cross product.
bool segmentIntersectsBorderCone(const OPoint3D &pM2D, const OPoint3D &pN2D) const
Test if the segment [MN] intersects the borders of the visibility cone.
bool pointIsInCone(const OPoint3D &pM2D) const
Test if the point M lies inside the visibility cone.
bool segmentIsVisibleInCone(const OSegment3D &segmentToTest) const
Test if a segment is visible in the visibility cone.
void setupNormalsOfCone()
Compute exterior normal of the cone.
VisibilityCone(const OPoint3D &pA, const OPoint3D &pB, const OPoint3D &pC)
Builds a visibility cone spanned from point A into points B and C This cone is such that [BC] segment...