gwnavruntime/channel/diskcangoinchannel.h Source File

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