Lines Matching refs:points

107  * Calculate the intersection of a ray with the line segment defined by two points.
141 * Sort points by their X coordinates
143 * @param points the points as a Vector2 array.
146 void SpotShadow::xsort(Vector2* points, int pointsLength) {
150 std::sort(points, points + pointsLength, cmp);
156 * @param points the points as a Vector2 array.
159 * @return the number of points in the polygon 0 if no intersection
161 int SpotShadow::hull(Vector2* points, int pointsLength, Vector2* retPoly) {
162 xsort(points, pointsLength);
165 lUpper[0] = points[0];
166 lUpper[1] = points[1];
171 lUpper[lUpperSize] = points[i];
186 lLower[0] = points[n - 1];
187 lLower[1] = points[n - 2];
192 lLower[lLowerSize] = points[i];
205 // output points in CW ordering
217 // TODO: Add test harness which verify that all the points are inside the hull.
222 * Test whether the 3 points form a counter clockwise turn.
232 * Sort points about a center point
243 * Swap points pointed to by i and j
245 void SpotShadow::swap(Vector2* points, int i, int j) {
246 Vector2 temp = points[i];
247 points[i] = points[j];
248 points[j] = temp;
254 void SpotShadow::quicksortCirc(Vector2* points, int low, int high,
258 float pivot = angle(points[p], center);
260 while (angle(points[i], center) > pivot) {
263 while (angle(points[j], center) < pivot) {
268 swap(points, i, j);
273 if (low < j) quicksortCirc(points, low, j, center);
274 if (i < high) quicksortCirc(points, i, high, center);
308 * @param len the number of points of the polygon
323 * @param len the number of points of the polygon
339 * @param points number of the points of the output polygon.
344 void SpotShadow::computeLightPolygon(int points, const Vector3& lightCenter,
347 for (int i = 0; i < points; i++) {
348 float angle = 2 * i * M_PI / points;
1018 * Calculate the bounds for generating random test points.