gwnavruntime/math/cardinaldir.h Source File

cardinaldir.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 
8 // Primary contact: JUBA - secondary contact: NOBODY
9 #ifndef Navigation_CardinalDir_H
10 #define Navigation_CardinalDir_H
11 
13 
14 namespace Kaim
15 {
16 
24 
25 static const CardinalDir CardinalDir_EAST = 0;
26 static const CardinalDir CardinalDir_NORTH = 1;
27 static const CardinalDir CardinalDir_WEST = 2;
28 static const CardinalDir CardinalDir_SOUTH = 3;
29 static const CardinalDir CardinalDir_INVALID = KyUInt32MAXVAL;
30 
34 KY_INLINE CardinalDir GetOppositeCardinalDir(const CardinalDir dir) { return (dir + 2) & 3 /*% 4*/; }
35 KY_INLINE CardinalDir GetNextCardinalDir_CCW(const CardinalDir dir) { return (dir + 1) & 3 /*% 4*/; }
36 KY_INLINE CardinalDir GetNextCardinalDir_CW(const CardinalDir dir) { return (dir + 3) & 3 /*% 4*/; }
37 }
38 
39 #endif
40 
CardinalDir GetOppositeCardinalDir(const CardinalDir dir)
Returns the CardinalDir that lies in the opposite direction from the specified CardinalDir.
Definition: cardinaldir.h:35
static const CardinalDir CardinalDir_NORTH
Identifies North, defined as the positive direction of the Y axis.
Definition: cardinaldir.h:26
KyUInt32 CardinalDir
Defines a type that refers to one of the cardinal points on the compass:
Definition: cardinaldir.h:23
static const CardinalDir CardinalDir_INVALID
Identifies an invalid cardinal direction.
Definition: cardinaldir.h:29
static const CardinalDir CardinalDir_SOUTH
Identifies South, defined as the negative direction of the Y axis.
Definition: cardinaldir.h:28
static const CardinalDir CardinalDir_EAST
Identifies East, defined as the positive direction of the X axis.
Definition: cardinaldir.h:25
static const CardinalDir CardinalDir_WEST
Identifies West, defined as the negative direction of the X axis.
Definition: cardinaldir.h:27
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226