OROCHI
 
Loading...
Searching...
No Matches
GxPathSet.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_CHARACTER_NAMESPACE_BEGIN()
13
14//===========================================================================
16//===========================================================================
18{
19 //-------------------------------------------------------------
21 //-------------------------------------------------------------
23public:
24 // RTTI定義
25 GX_RTTI_CLASS(GxPathNode, GxClassBaseReference)
26 // GxClassBaseReference継承クラス用禁止宣言
28
29 class GxConnect;
30
32 static constexpr u32 NUM_DATA = 4;
33#if GX_DEVELOP
35 static constexpr u32 RENDER_SPHERE_DIV = 4;
37 static const f32 RENDER_SPHERE_RADIUS;
38#endif //GX_DEVELOP
39
41 //-----------------------------------------------------------
43 //-----------------------------------------------------------
45
47 GxPathNode(void) : _id(0), _connectList(GxAllocatorList::ALLOCATOR_TYPE::GLOBAL), _flag(0){ GX_MEMSET(_data, 0, sizeof(s32) * NUM_DATA); }
49 GxPathNode(const GxVector3& position);
51 void cleanup(void) override;
52
54 //-----------------------------------------------------------
56 //-----------------------------------------------------------
58
60 void addConnect(GxPathNode* pNode, f32 staticWeight);
62 void addConnect(GxConnect* pConnect);
64 void eraseAllConnect(void);
66 constexpr u32 getNumConnect(void) const { return _connectList.getCount(); }
68 GxConnect* getConnect(u32 id);
70 GX_FORCE_INLINE GxListClassBaseReference* getConnectList(void){ return &_connectList; }
72 GX_FORCE_INLINE GxListClassBaseReference::GxNodeClassBaseReference* getConnectTopNode(void) const { return _connectList.getTop(); }
74 constexpr u32 getId(void) const { return _id; }
76 constexpr void setId(u32 id){ _id = id; }
78 GX_FORCE_INLINE const GxVector3& getPosition(void) const { return _position; }
80 GX_FORCE_INLINE void setPosition(const GxVector3& position){ _position = position; }
82 constexpr s32 getData(u32 index) const { return _data[index]; }
84 constexpr void setData(u32 index, s32 data){ _data[index] = data; }
86 constexpr s32 getFlag(void) const { return _flag; }
88 constexpr void setFlag(s32 flag){ _flag = flag; }
89
91#if GX_DEVELOP
92 //-----------------------------------------------------------
94 //-----------------------------------------------------------
96
98 virtual void developRender(GxColor color = GxColor::BLUE, GxPathNode* pConnectNode = nullptr, b32 arrowFlag = false);
99
101#endif //GX_DEVELOP
102 //-----------------------------------------------------------
104 //-----------------------------------------------------------
106private:
107 u32 _id;
108 GxVector3 _position;
109 GxListClassBaseReference _connectList;
110 s32 _data[NUM_DATA];
111 s32 _flag;
112
114};
115
116//===========================================================================
118//===========================================================================
120{
121 //-------------------------------------------------------------
123 //-------------------------------------------------------------
125public:
126 // RTTI定義
128 // GxClassBaseReference継承クラス用禁止宣言
130
131
132 static constexpr u32 NUM_ADD_WEIGHT = 4;
133
135 //-----------------------------------------------------------
137 //-----------------------------------------------------------
139
141 GxConnect(void);
142
144 //-----------------------------------------------------------
146 //-----------------------------------------------------------
148
150 constexpr GxPathNode* getNode(void) const { return _pNode; }
152 constexpr void setNode(GxPathNode* pNode){ _pNode = pNode; }
154 constexpr f32 getStaticWeight(void) const { return _staticWeight; }
156 constexpr void setStaticWeight(f32 staticWeight){ _staticWeight = staticWeight; }
158 constexpr f32 getAddWeight(u32 index) const { return _addWeight[index]; }
160 constexpr void setAddWeight(u32 index, f32 weight){ _addWeight[index] = weight; }
162 constexpr f32 calculateDynamicWeight(GxClassBaseRoot* /*pObject*/) const { return 0.0f; }
164 GX_FORCE_INLINE b32 isValid(void) const { return _valid; }
166 GX_FORCE_INLINE void setValid(b32 flag){ _valid = flag; }
167
169 //-----------------------------------------------------------
171 //-----------------------------------------------------------
173private:
174 GxPathNode* _pNode;
175 f32 _staticWeight;
176 f32 _addWeight[NUM_ADD_WEIGHT];
177 b32 _valid;
178
180};
181
182//===========================================================================
184//===========================================================================
185class GxPath : public GxClassBase
186{
187 //-------------------------------------------------------------
189 //-------------------------------------------------------------
191public:
192 // RTTI定義
193 GX_RTTI_CLASS(GxPath, GxClassBase)
194 // GxClassBase継承クラス用禁止宣言
196
197
198 static const f32 GOAL_RANGE_DEFAULT;
200 static const f32 TURN_RADIUS_DEFAULT;
204 enum class MOVE_TYPE
205 {
206 LINEAR,
207 SPLINE,
208 BEZIER,
209 TURN,
210 };
211
213 //-----------------------------------------------------------
215 //-----------------------------------------------------------
217
219 GxPath(void);
221 ~GxPath(void) override;
223 void initialize(void);
224#if GX_DEVELOP
226 void developRender(void);
227#endif //GX_DEVELOP
228
230 //-----------------------------------------------------------
232 //-----------------------------------------------------------
234
236 GX_FORCE_INLINE void addTopNode(GxPathNode* pNode){ _nodeList.addTop(pNode); }
238 GX_FORCE_INLINE void addBottomNode(GxPathNode* pNode){ _nodeList.addBottom(pNode); }
240 void addPath(GxPath* pPath);
242 GX_FORCE_INLINE GxListClassBase* getNodeList(void){ return &_nodeList; }
244 void eraseBottomNode(void);
246 void eraseAllNode(void);
248 constexpr void setOwner(GxUnitLocate* pOwner){ _pOwner = pOwner; }
250 GX_FORCE_INLINE void setArriveNodeCallback(ARRIVE_NODE_CALLBACK pCallback){ _pArriveNodeCallback = pCallback; }
252 GX_FORCE_INLINE GxPathNode* getTargetNode(void) const { return _pTargetNode ? static_cast<GxPathNode*>(_pTargetNode->getObject()) : nullptr; }
254 void setTargetNode(GxPathNode* pNode);
256 GX_FORCE_INLINE GxPathNode* getBeforeNode(void) const { return _pBeforeNode ? static_cast<GxPathNode*>(_pBeforeNode->getObject()) : nullptr; }
258 GX_FORCE_INLINE GxPathNode* getNextNode(void) const { return (_pTargetNode && _pTargetNode->getNext()) ? static_cast<GxPathNode*>(_pTargetNode->getNext()->getObject()) : nullptr; }
260 constexpr f32 getGoalRange(void) const { return _goalRange; }
262 constexpr void setGoalRange(f32 range){ _goalRange = range; }
264 GX_FORCE_INLINE b32 isGoal(void) const { return _goalFlag; }
266 GX_FORCE_INLINE void setGoalFlag(b32 flag){ _goalFlag = flag; }
268 GX_FORCE_INLINE b32 isLoop(void) const { return _loopFlag; }
270 GX_FORCE_INLINE void setLoopFlag(b32 flag){ _loopFlag = flag; }
272 constexpr MOVE_TYPE getMoveType(void) const { return _moveType; }
274 constexpr void setMoveType(MOVE_TYPE type){ _moveType = type; }
276 constexpr void setRadius(f32 radius){ _radius = radius; }
278 virtual f32 calculateCost(GxClassBaseRoot* pObject);
280 void getDirect(GxVector3& direct);
281
282protected:
284 virtual b32 isArrivedAtTargetNode( void );
285
286private:
288 void getDirectLinear(GxVector3& direct);
290 void getDirectSpline(GxVector3& direct);
292 void getDirectBezier(GxVector3& direct);
294 void getDirectTurn(const GxVector3& directNow, GxVector3& directResult);
296 void executeArriveNodeCallback(GxPathNode* pNode);
298 GxListClassBaseReference::GxNodeClassBaseReference* getNextNode(GxListClassBaseReference::GxNodeClassBaseReference* pCurrentNode) const { return pCurrentNode->getNext() ? pCurrentNode->getNext() : pCurrentNode; }
300 void calculateSplineControl(const GxVector3& position0, const GxVector3& position1, const GxVector3& position2, const GxVector3& position3);
302 void calculateBezierControl(const GxVector3& position0, const GxVector3& position1, const GxVector3& position2, const GxVector3& position3);
304 void setTurnPoint(const GxVector3& position0, const GxVector3& position1, const GxVector3& direct);
305
307 //-----------------------------------------------------------
309 //-----------------------------------------------------------
311private:
312 GxListClassBaseReference _nodeList;
313 GxUnitLocate* _pOwner;
314 ARRIVE_NODE_CALLBACK _pArriveNodeCallback;
317 f32 _goalRange;
318 b32 _goalFlag;
319 b32 _loopFlag;
320 MOVE_TYPE _moveType;
321 f32 _timer;
322 GxVector3 _controlPoint[2];
323 GxVector3 _turnPointCenter;
324 GxVector3 _turnPointMiddle;
325 f32 _radius;
326
328};
329
330GX_CHARACTER_NAMESPACE_END()
331#include "GxResPathSet.h"
332GX_CHARACTER_NAMESPACE_BEGIN()
333
334//===========================================================================
336//===========================================================================
337class GxPathSet : public GxClassBase
338{
339 //-------------------------------------------------------------
341 //-------------------------------------------------------------
343public:
344 // RTTI定義
345 GX_RTTI_CLASS(GxPathSet, GxClassBase)
346 // GxClassBase継承クラス用禁止宣言
348
349 class GxPathSetArea;
350
352 //-----------------------------------------------------------
354 //-----------------------------------------------------------
356
358 GxPathSet(void);
360 ~GxPathSet(void) override;
362 void initialize(GxResPathSet* pResource);
363
365 //-----------------------------------------------------------
367 //-----------------------------------------------------------
369
371 void update(void);
372protected:
374 virtual GxPathSetArea* allocateArea(void);
376 GX_FORCE_INLINE virtual GxPathNode* allocateNode(void){ return GX_NEW GxPathNode; }
378 GX_FORCE_INLINE virtual GxPathNode::GxConnect* allocateConnect(void){ return GX_NEW GxPathNode::GxConnect; }
379
381 //-----------------------------------------------------------
383 //-----------------------------------------------------------
385public:
387 GxPathSetArea* getArea(s32 id);
389 GxPathSetArea* getArea(const GxVector3& position, const GxVector3* pTargetPosition = nullptr);
391 void eraseAllArea(void);
392
394 //-----------------------------------------------------------
396 //-----------------------------------------------------------
398private:
399 GxResPathSet* _pResource;
400 GxListClassBase _areaList;
401
403};
404
405//===========================================================================
407//===========================================================================
409{
410 //-------------------------------------------------------------
412 //-------------------------------------------------------------
414public:
415 // RTTI定義
417 // GxClassBase継承クラス用禁止宣言
420 enum class SEARCH_LENGTH
421 {
422 SHORT = 0,
423 LONG,
424 MAX,
425 };
426#if GX_DEVELOP
428 GX_ENUM_TABLE_MAX(SEARCH_LENGTH)
429#endif //GX_DEVELOP
431 enum class SEARCH_TYPE
432 {
433 NEAR_ = 0,
434 FAR_,
435 MAX,
436 };
437#if GX_DEVELOP
439 GX_ENUM_TABLE_MAX(SEARCH_TYPE)
440#endif //GX_DEVELOP
442 enum ATTRIBUTE
443 {
447 };
448
451 {
452 //-------------------------------------------------------------
454 //-------------------------------------------------------------
456 public:
458 GxAStarNode(void) : _costSum(0.0f), _costHeuristics(0.0f), _pNode(nullptr), _pParent(nullptr){}
460 virtual ~GxAStarNode(void){}
461
463 //-----------------------------------------------------------
465 //-----------------------------------------------------------
467
472
474 };
475
477 //-----------------------------------------------------------
479 //-----------------------------------------------------------
481
483 GxPathSetArea(void);
485 ~GxPathSetArea(void) override;
487 void createShape(GxResPathSet::GxAreaParam* pAreaParam);
488
490 //-----------------------------------------------------------
492 //-----------------------------------------------------------
494
495#if GX_DEVELOP
497 void developRender(void);
498#endif //GX_DEVELOP
500 b32 isInclude(const GxVector3& position) const;
501
503 b32 searchNoCost(GxPathNode* pStartNode, GxPathNode* pGoalNode, GxPath* pPath);
505 b32 searchFast(GxPathNode* pStartNode, GxPathNode* pGoalNode, GxPath* pPath, GxClassBaseRoot* pObject, SEARCH_LENGTH length = SEARCH_LENGTH::SHORT);
507 b32 searchAStar(GxPathNode* pStartNode, GxPathNode* pGoalNode, GxPath* pPath, GxClassBaseRoot* pObject, SEARCH_LENGTH length = SEARCH_LENGTH::SHORT);
509 b32 getRoute(s32 id, GxPath* pPath) const;
510protected:
512 b32 checkCollision(const GxVector3& startPosition, const GxVector3& endPosition);
513private:
515 b32 searchNoCostLoop(GxPathNode* pCurrentNode, GxPathNode* pGoalNode, GxPath* pPath, GxListClassBaseReference* pCloseNodeList);
517 b32 searchFastLoop(GxPathNode* pCurrentNode, GxPathNode* pGoalNode, GxPath* pPath, GxListClassBaseReference* pCloseNodeList, GxClassBaseRoot* pObject, SEARCH_LENGTH length);
519 b32 searchAStarLoop(GxAStarNode* pAStarCurrentNode, GxPathNode* pGoalNode, GxPath* pPath, GxList* pOpenNodeList, GxList* pCloseNodeList, GxClassBaseRoot* pObject, SEARCH_LENGTH length);
521 void rewindPath(GxPath* pPath, GxPathNode* pNode);
523 f32 calculateCostFast(GxPathNode* pCurrentNode, GxPathNode* pGoalNode, GxPathNode::GxConnect* pConnect, GxClassBaseRoot* pObject, SEARCH_LENGTH length);
525 f32 calculateCost(GxPathNode* pCurrentNode, GxPathNode* pNextNode, GxClassBaseRoot* pObject, SEARCH_LENGTH length);
527 f32 calculateCostHeuristics(GxPathNode* pCurrentNode, GxPathNode* pNextNode, GxPathNode* pGoalNode, GxClassBaseRoot* pObject, SEARCH_LENGTH length);
529 b32 isIncludeAStarNode(GxList* pAStarList, GxPathNode* pNode) const;
531 b32 isCloseNode(GxListClassBaseReference* pCloseNodeList, GxPathNode* pNode) const;
533 u32 getConnectMax(void);
534
536 //-----------------------------------------------------------
538 //-----------------------------------------------------------
540public:
542 constexpr s32 getId(void) const { return _id; }
544 constexpr void setId(s32 id){ _id = id; }
546 constexpr void setShape(GxShape* pShape){ _pShape = pShape; }
548 GX_FORCE_INLINE void addNode(GxPathNode* pNode){ _nodeList.addBottom(pNode); }
550 void addRoute(GxPath* pRoute, s32 id);
552 void eraseAllNode(void);
554 void eraseAllRoute(void);
556 GxPathNode* getNode(u32 id);
558 GxPathNode* getNode(u32 dataIndex, s32 dataValue);
560 GxPathNode* getNearNode(const GxVector3& position, u32 attribute = 0, const GxVector3* pTargetPosition = nullptr);
562 GxPathNode* getFarNode(const GxVector3& position);
563
565 //-----------------------------------------------------------
567 //-----------------------------------------------------------
569private:
570 s32 _id;
571 GxShape* _pShape;
572 GxListClassBaseReference _nodeList;
573 GxListClassBase _routeList;
575
577};
578
579//===========================================================================
581//===========================================================================
583{
584 //-------------------------------------------------------------
586 //-------------------------------------------------------------
588public:
589 // RTTI定義
591 // GxClassBase継承クラス用禁止宣言
593
594
595 enum class TREE_TYPE
596 {
597 GROUND,
598 AIR,
599 };
600
602 //-----------------------------------------------------------
604 //-----------------------------------------------------------
606
610 ~GxPathSetAreaRRT(void) override{};
611
613 //-----------------------------------------------------------
615 //-----------------------------------------------------------
617
619 void createRRT(const GxVector3& startPosition, const GxVector3& goalPosition, TREE_TYPE treeType = TREE_TYPE::GROUND, f32 searchAreaSize = 30.0f, f32 maxConnectLength = 2.0f, u32 maxNode = 32, f32 goalCheckDistance = 2.0f);
620
622};
623
624GX_CHARACTER_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
メモリアロケータリスト
Definition GxAllocator.h:347
オブジェクト基底クラス
Definition GxBase.h:88
参照オブジェクト基底クラス
Definition GxBase.h:122
基底クラス
Definition GxBase.h:51
GxClassBase用連結リストクラス
Definition GxListClassBase.h:18
GxNodeClassBase * addBottom(GxClassBaseRoot *pObject)
終端に追加
Definition GxListClassBase.cpp:101
GxNodeClassBase * addTop(GxClassBaseRoot *pObject)
先頭に追加
Definition GxListClassBase.cpp:77
GxClassBaseReference用連結リストノードクラス
Definition GxListClassBase.h:315
GX_FORCE_INLINE GxNodeClassBaseReference * getNext(void) const
次のノードを取得
Definition GxListClassBase.inl:194
GX_FORCE_INLINE GxClassBaseReference * getObject(void) const
オブジェクトを取得
Definition GxListClassBase.inl:203
GxClassBaseReference用連結リストクラス
Definition GxListClassBase.h:263
連結リストクラス
Definition GxList.h:18
パスクラス
Definition GxPathSet.h:186
virtual f32 calculateCost(GxClassBaseRoot *pObject)
コスト計算
Definition GxPathSet.cpp:324
void eraseAllNode(void)
全てのノードを削除
Definition GxPathSet.cpp:293
GX_FORCE_INLINE void setGoalFlag(b32 flag)
ゴールフラグを設定
Definition GxPathSet.h:266
GX_FORCE_INLINE GxPathNode * getBeforeNode(void) const
以前のノードを取得
Definition GxPathSet.h:256
GX_FORCE_INLINE b32 isGoal(void) const
ゴールに着いたか判定
Definition GxPathSet.h:264
GX_FORCE_INLINE void setLoopFlag(b32 flag)
ループさせるかフラグを設定
Definition GxPathSet.h:270
GX_FORCE_INLINE GxPathNode * getTargetNode(void) const
ターゲットノードを取得
Definition GxPathSet.h:252
GX_FORCE_INLINE void setArriveNodeCallback(ARRIVE_NODE_CALLBACK pCallback)
ノード到着コールバックを設定
Definition GxPathSet.h:250
virtual b32 isArrivedAtTargetNode(void)
ノードに到達したかどうか取得
Definition GxPathSet.cpp:381
MOVE_TYPE
移動方法
Definition GxPathSet.h:205
@ TURN
回転移動
@ LINEAR
直線移動
@ SPLINE
Bスプライン移動
@ BEZIER
ベジエ移動
void eraseBottomNode(void)
末尾のノードを削除
Definition GxPathSet.cpp:285
void addPath(GxPath *pPath)
パスを末尾に追加
Definition GxPathSet.cpp:274
void initialize(void)
初期化
Definition GxPathSet.cpp:224
constexpr void setGoalRange(f32 range)
到着判定距離を設定
Definition GxPathSet.h:262
constexpr void setMoveType(MOVE_TYPE type)
移動方法の設定
Definition GxPathSet.h:274
void getDirect(GxVector3 &direct)
方向ベクトルの取得
Definition GxPathSet.cpp:354
GxPath(void)
コンストラクタ
Definition GxPathSet.cpp:198
GX_FORCE_INLINE GxPathNode * getNextNode(void) const
次のノードを取得
Definition GxPathSet.h:258
constexpr void setOwner(GxUnitLocate *pOwner)
所持者を設定
Definition GxPathSet.h:248
constexpr void setRadius(f32 radius)
回転半径の設定
Definition GxPathSet.h:276
GX_FORCE_INLINE void addTopNode(GxPathNode *pNode)
ノードを頭に追加
Definition GxPathSet.h:236
void(GxClassBaseRoot::*) ARRIVE_NODE_CALLBACK(GxPathNode *pNode)
ノード到着コールバック定義
Definition GxPathSet.h:202
GX_FORCE_INLINE void addBottomNode(GxPathNode *pNode)
ノードを末尾に追加
Definition GxPathSet.h:238
void setTargetNode(GxPathNode *pNode)
ターゲットノードを設定
Definition GxPathSet.cpp:302
static const f32 TURN_RADIUS_DEFAULT
回転式の場合の半径
Definition GxPathSet.h:200
constexpr MOVE_TYPE getMoveType(void) const
移動方法の取得
Definition GxPathSet.h:272
GX_FORCE_INLINE GxListClassBase * getNodeList(void)
ノードリストを取得
Definition GxPathSet.h:242
~GxPath(void) override
デストラクタ
Definition GxPathSet.cpp:216
constexpr f32 getGoalRange(void) const
到着判定距離を取得
Definition GxPathSet.h:260
GX_FORCE_INLINE b32 isLoop(void) const
ループさせるか判定
Definition GxPathSet.h:268
static const f32 GOAL_RANGE_DEFAULT
到着判定範囲
Definition GxPathSet.h:198
経路ノード接続クラス
Definition GxPathSet.h:120
GX_FORCE_INLINE b32 isValid(void) const
有効判定
Definition GxPathSet.h:164
constexpr void setAddWeight(u32 index, f32 weight)
追加の重みを設定する
Definition GxPathSet.h:160
constexpr void setStaticWeight(f32 staticWeight)
静的な重みの設定
Definition GxPathSet.h:156
constexpr f32 calculateDynamicWeight(GxClassBaseRoot *) const
動的な重みを計算する
Definition GxPathSet.h:162
constexpr void setNode(GxPathNode *pNode)
相手ノードの取得
Definition GxPathSet.h:152
constexpr f32 getAddWeight(u32 index) const
追加の重みを取得する
Definition GxPathSet.h:158
constexpr f32 getStaticWeight(void) const
静的な重みの取得
Definition GxPathSet.h:154
constexpr GxPathNode * getNode(void) const
相手ノードの取得
Definition GxPathSet.h:150
GX_FORCE_INLINE void setValid(b32 flag)
有効設定
Definition GxPathSet.h:166
static constexpr u32 NUM_ADD_WEIGHT
追加の重みの数
Definition GxPathSet.h:132
経路ノードクラス
Definition GxPathSet.h:18
GX_FORCE_INLINE GxListClassBaseReference::GxNodeClassBaseReference * getConnectTopNode(void) const
最初の接続ノードを取得
Definition GxPathSet.h:72
constexpr u32 getNumConnect(void) const
接続数を取得
Definition GxPathSet.h:66
constexpr s32 getFlag(void) const
付加フラグの取得
Definition GxPathSet.h:86
constexpr s32 getData(u32 index) const
付加データの取得
Definition GxPathSet.h:82
GX_FORCE_INLINE const GxVector3 & getPosition(void) const
位置の取得
Definition GxPathSet.h:78
constexpr void setId(u32 id)
IDの設定
Definition GxPathSet.h:76
GxPathNode(void)
デフォルトコンストラクタ
Definition GxPathSet.h:47
GX_FORCE_INLINE GxListClassBaseReference * getConnectList(void)
接続リストを取得
Definition GxPathSet.h:70
constexpr void setFlag(s32 flag)
付加フラグの設定
Definition GxPathSet.h:88
constexpr void setData(u32 index, s32 data)
付加データの設定
Definition GxPathSet.h:84
constexpr u32 getId(void) const
IDの取得
Definition GxPathSet.h:74
GX_FORCE_INLINE void setPosition(const GxVector3 &position)
位置の設定
Definition GxPathSet.h:80
A*のオープンノードクラス
Definition GxPathSet.h:451
GxAStarNode(void)
コンストラクタ
Definition GxPathSet.h:458
GxAStarNode * _pParent
親のA*ノード
Definition GxPathSet.h:471
GxPathNode * _pNode
経路ノード
Definition GxPathSet.h:470
f32 _costHeuristics
ヒューリスティックコスト
Definition GxPathSet.h:469
virtual ~GxAStarNode(void)
デストラクタ
Definition GxPathSet.h:460
f32 _costSum
総コスト
Definition GxPathSet.h:468
経路セットエリアクラス
Definition GxPathSet.h:409
b32 searchAStar(GxPathNode *pStartNode, GxPathNode *pGoalNode, GxPath *pPath, GxClassBaseRoot *pObject, SEARCH_LENGTH length=SEARCH_LENGTH::SHORT)
A*探索
Definition GxPathSet.cpp:1041
GX_FORCE_INLINE void addNode(GxPathNode *pNode)
ノードを追加
Definition GxPathSet.h:548
b32 checkCollision(const GxVector3 &startPosition, const GxVector3 &endPosition)
衝突判定
Definition GxPathSet.cpp:1112
void eraseAllNode(void)
全てのノードを削除
Definition GxPathSet.cpp:1428
GxPathNode * getNearNode(const GxVector3 &position, u32 attribute=0, const GxVector3 *pTargetPosition=nullptr)
最も近いノードを取得
Definition GxPathSet.cpp:1501
SEARCH_TYPE
探索方法
Definition GxPathSet.h:432
b32 searchFast(GxPathNode *pStartNode, GxPathNode *pGoalNode, GxPath *pPath, GxClassBaseRoot *pObject, SEARCH_LENGTH length=SEARCH_LENGTH::SHORT)
高速探索
Definition GxPathSet.cpp:1010
void createShape(GxResPathSet::GxAreaParam *pAreaParam)
形状を作成
Definition GxPathSet.cpp:936
@ ATTRIBUTE_TARGET_FAR
ターゲットから遠いものを優先
Definition GxPathSet.h:446
@ ATTRIBUTE_COLLISION_INVALID
衝突無効
Definition GxPathSet.h:444
@ ATTRIBUTE_TARGET_NEAR
ターゲットから近いものを優先
Definition GxPathSet.h:445
constexpr void setId(s32 id)
IDを設定
Definition GxPathSet.h:544
GxPathNode * getFarNode(const GxVector3 &position)
最も遠いノードを取得
Definition GxPathSet.cpp:1559
GxPathNode * getNode(u32 id)
ノードを取得(ID指定)
Definition GxPathSet.cpp:1462
GxPathSetArea(void)
コンストラクタ
Definition GxPathSet.cpp:915
b32 searchNoCost(GxPathNode *pStartNode, GxPathNode *pGoalNode, GxPath *pPath)
コスト無視探索
Definition GxPathSet.cpp:984
void eraseAllRoute(void)
全てのルートを削除
Definition GxPathSet.cpp:1444
void addRoute(GxPath *pRoute, s32 id)
ルートを追加
Definition GxPathSet.cpp:1419
constexpr void setShape(GxShape *pShape)
コリジョンの形状を設定
Definition GxPathSet.h:546
~GxPathSetArea(void) override
デストラクタ
Definition GxPathSet.cpp:925
b32 getRoute(s32 id, GxPath *pPath) const
固定ルートを取得
Definition GxPathSet.cpp:1075
constexpr s32 getId(void) const
IDを取得
Definition GxPathSet.h:542
SEARCH_LENGTH
探索距離
Definition GxPathSet.h:421
RRT(Rapidly Random Tree)経路セットエリアクラス
Definition GxPathSet.h:583
~GxPathSetAreaRRT(void) override
デストラクタ
Definition GxPathSet.h:610
GxPathSetAreaRRT(void)
デフォルトコンストラクタ
Definition GxPathSet.h:608
TREE_TYPE
ツリーのタイプ
Definition GxPathSet.h:596
void createRRT(const GxVector3 &startPosition, const GxVector3 &goalPosition, TREE_TYPE treeType=TREE_TYPE::GROUND, f32 searchAreaSize=30.0f, f32 maxConnectLength=2.0f, u32 maxNode=32, f32 goalCheckDistance=2.0f)
RRT生成
Definition GxPathSet.cpp:1596
経路セットクラス
Definition GxPathSet.h:338
virtual GX_FORCE_INLINE GxPathNode * allocateNode(void)
ノードのメモリ確保
Definition GxPathSet.h:376
virtual GX_FORCE_INLINE GxPathNode::GxConnect * allocateConnect(void)
接続のメモリ確保
Definition GxPathSet.h:378
経路セットリソースクラス
Definition GxResPathSet.h:18
static constexpr u32 ROUTE_NODE_DATA_MAX
固定ルート内ノードの最大数
Definition GxResPathSet.h:32
形状基礎クラス
Definition GxShape.h:45
座標ユニット基礎クラス
Definition GxUnitLocate.h:23
Definition GxColor.h:21
static const GxColor BLUE
Definition GxColor.h:31
エリアパラメータ
Definition GxResPathSet.h:49
3次元ベクトル
Definition GxVector.h:245
32bitブーリアン
Definition GxDefine.h:173