gwnavruntime/channel/diskcangoinchannel.h Source File

diskcangoinchannel.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 #ifndef Navigation_DiskCanGoInChannel_H
8 #define Navigation_DiskCanGoInChannel_H
9 
11 
12 
13 namespace Kaim
14 {
15 
16 class ChannelSectionPtr;
17 class Channel;
18 
19 
21 {
22  DiskCanGoInChannel_NotInitialised,
23  DiskCanGoInChannel_NotProcessed,
25 
32 };
33 
34 
35 class DiskCanGoInChannel
36 {
37 public:
38  DiskCanGoInChannel();
39 
40  void Initialize(const Vec2f& startPos2f, const Channel* channel, KyUInt32 startSectionIdx, const Vec2f& destPos2f);
41 
42  void InitSymmetricRadius(KyFloat32 radius);
43  void InitAsymmetricRadius(KyFloat32 radiusLeft, KyFloat32 radiusRight);
44 
45  // if not set it will be computed in perform
46  void SetDestinationSectionIdx(KyUInt32 destSectionIdx);
47 
48  void Perform();
49 
50 private:
51  bool IsProperlyInitializedFromRayCast();
52  bool IsProperlyInitializedDestSectionProvided();
53 
54 public:
55  const Channel* m_channel;
56 
57  Vec2f m_startPos2f;
58  KyUInt32 m_startSectionIdx;
59 
60  Vec2f m_destPos2f;
61  KyUInt32 m_destSectionIdx;
62 
63  KyFloat32 m_radiusLeft;
64  KyFloat32 m_radiusRight;
65 
66  DiskCanGoInChannelResult m_result;
67 };
68 
69 
70 } // namespace Kaim
71 
72 #endif
A collision is detected with Channel borders.
Definition: diskcangoinchannel.h:31
The start section index is not valid (it is greater than the channel section count).
Definition: diskcangoinchannel.h:27
The Channel is not valid (it has less than 2 Gates and thus no section).
Definition: diskcangoinchannel.h:26
The start and end positions are both inside the Channel and all Gates in-between are correctly crosse...
Definition: diskcangoinchannel.h:24
DiskCanGoInChannelResult
Definition: diskcangoinchannel.h:20
The start position is inside the Channel and all Gates up to the Channel end one are correctly crosse...
Definition: diskcangoinchannel.h:28
The start position is outside the start section.
Definition: diskcangoinchannel.h:30
Definition: gamekitcrowddispersion.h:20
The start position is inside the Channel and all Gates up to the Channel start one are correctly cros...
Definition: diskcangoinchannel.h:29
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43