20 template <
typename Real>
55 template <
typename Real>
64 template <
typename Real>
78 lhs = (p[1] - U0[1])*(U1[0] - U0[0]);
79 rhs = (p[0] - U0[0])*(U1[1] - U0[1]);
86 else if (p[1] < U0[1])
88 lhs = (p[1] - U0[1])*(U1[0] - U0[0]);
89 rhs = (p[0] - U0[0])*(U1[1] - U0[1]);
99 template <
typename Real>
105 Real
ny = mPoints[i0][0] - mPoints[i1][0];
106 Real dx = p[0] - mPoints[i0][0];
107 Real dy = p[1] - mPoints[i0][1];
108 if (nx*dx + ny*dy >(Real)0)
116 template <
typename Real>
123 template <
typename Real>
133 Real
ny = mPoints[0][0] - mPoints[2][0];
134 Real dx = p[0] - mPoints[0][0];
135 Real dy = p[1] - mPoints[0][1];
137 if (nx*dx + ny*dy > (Real)0)
140 nx = mPoints[1][1] - mPoints[0][1];
141 ny = mPoints[0][0] - mPoints[1][0];
142 if (nx*dx + ny*dy > (Real)0.0)
147 nx = mPoints[2][1] - mPoints[1][1];
148 ny = mPoints[1][0] - mPoints[2][0];
149 dx = p[0] - mPoints[1][0];
150 dy = p[1] - mPoints[1][1];
151 if (nx*dx + ny*dy > (Real)0)
159 nx = mPoints[0][1] - mPoints[3][1];
160 ny = mPoints[3][0] - mPoints[0][0];
161 if (nx*dx + ny*dy > (Real)0)
166 nx = mPoints[3][1] - mPoints[2][1];
167 ny = mPoints[2][0] - mPoints[3][0];
168 dx = p[0] - mPoints[3][0];
169 dy = p[1] - mPoints[3][1];
170 if (nx*dx + ny*dy > (Real)0)
178 template <
typename Real>
185 if (diff == 1 || (diff < 0 && diff +
mNumPoints == 1))
188 ny = mPoints[i0][0] - mPoints[i1][0];
189 dx = p[0] - mPoints[i0][0];
190 dy = p[1] - mPoints[i0][1];
191 return nx*dx + ny*dy <= (Real)0;
198 mid = (i0 + i1) >> 1;
211 ny = mPoints[i0][0] - mPoints[mid][0];
212 dx = p[0] - mPoints[i0][0];
213 dy = p[1] - mPoints[i0][1];
214 if (nx*dx + ny*dy > (Real)0)
PointInPolygon2(int numPoints, Vector2< Real > const *points)
bool Contains(Vector2< Real > const &p) const
bool ContainsQuadrilateral(Vector2< Real > const &p) const
GLfixed GLfixed GLint GLint GLfixed points
bool ContainsConvexOrderLogN(Vector2< Real > const &p) const
bool ContainsConvexOrderN(Vector2< Real > const &p) const
Vector2< Real > const * mPoints
bool SubContainsPoint(Vector2< Real > const &p, int i0, int i1) const