Debian Codegraph @

DetourCrowd/Include/DetourLocalBoundary.h

raw symbols SCIP
1 //
2 // Copyright (c) 2009-2010 Mikko Mononen [email protected]
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 // Permission is granted to anyone to use this software for any purpose,
8 // including commercial applications, and to alter it and redistribute it
9 // freely, subject to the following restrictions:
10 // 1. The origin of this software must not be misrepresented; you must not
11 // claim that you wrote the original software. If you use this software
12 // in a product, an acknowledgment in the product documentation would be
13 // appreciated but is not required.
14 // 2. Altered source versions must be plainly marked as such, and must not be
15 // misrepresented as being the original software.
16 // 3. This notice may not be removed or altered from any source distribution.
17 //
18
19 #ifndef DETOURLOCALBOUNDARY_H
20 #define DETOURLOCALBOUNDARY_H
21
22 #include "DetourNavMeshQuery.h"
23
24
25 class dtLocalBoundary
26 {
27 static const int MAX_LOCAL_SEGS = 8;
28 static const int MAX_LOCAL_POLYS = 16;
29
30 struct Segment
31 {
32 float s[6]; ///< Segment start/end
33 float d; ///< Distance for pruning.
34 };
35
36 float m_center[3];
37 Segment m_segs[MAX_LOCAL_SEGS];
38 int m_nsegs;
39
40 dtPolyRef m_polys[MAX_LOCAL_POLYS];
41 int m_npolys;
42
43 void addSegment(const float dist, const float* s);
44
45 public:
46 dtLocalBoundary();
47 ~dtLocalBoundary();
48
49 void reset();
50
51 void update(dtPolyRef ref, const float* pos, const float collisionQueryRange,
52 dtNavMeshQuery* navquery, const dtQueryFilter* filter);
53
54 bool isValid(dtNavMeshQuery* navquery, const dtQueryFilter* filter);
55
56 inline const float* getCenter() const { return m_center; }
57 inline int getSegmentCount() const { return m_nsegs; }
58 inline const float* getSegment(int i) const { return m_segs[i].s; }
59
60 private:
61 // Explicitly disabled copy constructor and copy assignment operator.
62 dtLocalBoundary(const dtLocalBoundary&);
63 dtLocalBoundary& operator=(const dtLocalBoundary&);
64 };
65
66 #endif // DETOURLOCALBOUNDARY_H