gwnavruntime/math/geometryfunctions.h Source File

geometryfunctions.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 
9 // primary contact: LAPA - secondary contact: NOBODY
10 #ifndef Navigation_GeometryFunctions_H
11 #define Navigation_GeometryFunctions_H
12 
15 
16 namespace Kaim
17 {
18 class Vec2f;
19 class Vec2i;
20 namespace GeometryFunctions
21 {
22 // Tests whether or not a specified point is inside the area defined by a polyline in two
23 // dimensions, ignoring their altitude.
24 // \param p The point to test.
25 // \param points The list of points in the polyline. The list must also be closed: its last point must be the
26 // same as its first point.
27 // \param count The number of points in the points array.
28 // \return true if the point is inside the polyline (including borders by default, depending on insideIfOnBorder parameter) or false otherwise.
29 bool IsInside2d_Polyline(const Vec2f& p, const Vec2f* points, KyUInt32 count, bool* OnBorder = KY_NULL);
30 bool IsInside2d_Polyline(const Vec2i& p, const Vec2i* points, KyUInt32 count, bool* OnBorder = KY_NULL);
31 
32 PolygonWinding ComputePolygonWinding(const Vec2i* polygon, KyUInt32 count);
33 PolygonWinding ComputePolygonWinding(const Vec2f* polygon, KyUInt32 count);
34 inline PolygonWinding ComputePolygonWinding(const KyArrayPOD<Vec2i>& polygon)
35 {
36  return ComputePolygonWinding(polygon.GetDataPtr(), polygon.GetCount());
37 }
38 
39 
40 bool IsTwisted(const Vec2f* polygon, KyUInt32 count);
41 
42 } //namespace GeometryFunctions
43 
44 
45 } //namespace Kaim
46 
47 #endif // Navigation_GeometryFunctions_H
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36