UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DetourStatus.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2// Modified version of Recast/Detour's source file
3
4//
5// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
6//
7// This software is provided 'as-is', without any express or implied
8// warranty. In no event will the authors be held liable for any damages
9// arising from the use of this software.
10// Permission is granted to anyone to use this software for any purpose,
11// including commercial applications, and to alter it and redistribute it
12// freely, subject to the following restrictions:
13// 1. The origin of this software must not be misrepresented; you must not
14// claim that you wrote the original software. If you use this software
15// in a product, an acknowledgment in the product documentation would be
16// appreciated but is not required.
17// 2. Altered source versions must be plainly marked as such, and must not be
18// misrepresented as being the original software.
19// 3. This notice may not be removed or altered from any source distribution.
20//
21
22#ifndef DETOURSTATUS_H
23#define DETOURSTATUS_H
24
25#include "CoreMinimal.h"
26
27typedef unsigned int dtStatus;
28
29// High level status.
30static const unsigned int DT_FAILURE = 1u << 31; // Operation failed.
31static const unsigned int DT_SUCCESS = 1u << 30; // Operation succeed.
32static const unsigned int DT_IN_PROGRESS = 1u << 29; // Operation still in progress.
33
34// Detail information for status.
35static const unsigned int DT_STATUS_DETAIL_MASK = 0x0ffffff;
36//static const unsigned int DT_WRONG_MAGIC = 1 << 0; // Input data is not recognized. NOTE: UE magic removed to save memory
37static const unsigned int DT_WRONG_VERSION = 1 << 1; // Input data is in wrong version.
38static const unsigned int DT_OUT_OF_MEMORY = 1 << 2; // Operation ran out of memory.
39static const unsigned int DT_INVALID_PARAM = 1 << 3; // An input parameter was invalid.
40static const unsigned int DT_BUFFER_TOO_SMALL = 1 << 4; // Result buffer for the query was too small to store all results.
41static const unsigned int DT_OUT_OF_NODES = 1 << 5; // Query ran out of nodes during search.
42static const unsigned int DT_PARTIAL_RESULT = 1 << 6; // Query did not reach the end location, returning best guess.
43static const unsigned int DT_INVALID_CYCLE_PATH = 1 << 7; // Query found a path containing a cycle
44
45
46// Returns true of status is success.
47inline bool dtStatusSucceed(dtStatus status)
48{
49 return (status & DT_SUCCESS) != 0;
50}
51
52// Returns true of status is failure.
53inline bool dtStatusFailed(dtStatus status)
54{
55 return (status & DT_FAILURE) != 0;
56}
57
58// Returns true of status is in progress.
59inline bool dtStatusInProgress(dtStatus status)
60{
61 return (status & DT_IN_PROGRESS) != 0;
62}
63
64// Returns true if specific detail is set.
65inline bool dtStatusDetail(dtStatus status, unsigned int detail)
66{
67 return (status & detail) != 0;
68}
69
70#endif // DETOURSTATUS_H
bool dtStatusDetail(dtStatus status, unsigned int detail)
Definition DetourStatus.h:65
unsigned int dtStatus
Definition DetourStatus.h:27
bool dtStatusInProgress(dtStatus status)
Definition DetourStatus.h:59
bool dtStatusSucceed(dtStatus status)
Definition DetourStatus.h:47
bool dtStatusFailed(dtStatus status)
Definition DetourStatus.h:53
unsigned int dtStatus
Definition RecastGraphAStar.h:29