A* Pathfinding Project
3.1.4
The A* Pathfinding Project for Unity 3D
|
Holds a coordinate in integers. More...
Public Member Functions | |
Int3 (Vector3 position) | |
Int3 (int _x, int _y, int _z) | |
override bool | Equals (System.Object o) |
override int | GetHashCode () |
Int3 | NormalizeTo (int newMagn) |
override string | ToString () |
Returns a nicely formatted string representing the vector. | |
Static Public Member Functions | |
static int | Dot (Int3 lhs, Int3 rhs) |
static | operator Int3 (Vector3 ob) |
static implicit | operator string (Int3 ob) |
static | operator Vector3 (Int3 ob) |
static bool | operator!= (Int3 lhs, Int3 rhs) |
static Int3 | operator* (Int3 lhs, int rhs) |
static Int3 | operator* (Int3 lhs, float rhs) |
static Int3 | operator* (Int3 lhs, Vector3 rhs) |
static Int3 | operator+ (Int3 lhs, Int3 rhs) |
static Int3 | operator- (Int3 lhs, Int3 rhs) |
static Int3 | operator/ (Int3 lhs, float rhs) |
static bool | operator== (Int3 lhs, Int3 rhs) |
Public Attributes | |
const float | FloatPrecision = 1000F |
Precision as a float | |
const int | Precision = 1000 |
Precision for the integer coordinates. | |
const float | PrecisionFactor = 0.001F |
1 divided by Precision | |
int | x |
int | y |
int | z |
Properties | |
int | costMagnitude [get] |
Magnitude used for the cost between two nodes. | |
float | magnitude [get] |
Returns the magnitude of the vector. | |
float | safeMagnitude [get] |
To avoid number overflows. | |
float | safeSqrMagnitude [get] |
To avoid number overflows. | |
float | sqrMagnitude [get] |
The squared magnitude of the vector. | |
int | this[int i] [get] |
int | unsafeSqrMagnitude [get] |
float | worldMagnitude [get] |
The magnitude in world units. | |
static Int3 | zero [get] |
Static Private Attributes | |
static Int3 | _zero = new Int3(0,0,0) |
Holds a coordinate in integers.
const int Precision = 1000 |
Precision for the integer coordinates.
One world unit is divided into [value] pieces. A value of 1000 would mean millimeter precision, a value of 1 would mean meter precision (assuming 1 world unit = 1 meter). This value affects the maximum coordinates for nodes as well as how large the cost values are for moving between two nodes. A higher value means that you also have to set all penalty values to a higher value to compensate since the normal cost of moving will be higher.
|
get |
Magnitude used for the cost between two nodes.
The default cost between two nodes can be calculated like this:
|
get |
Returns the magnitude of the vector.
The magnitude is the 'length' of the vector from 0,0,0 to this point. Can be used for distance calculations:
|
get |
To avoid number overflows.
|
get |
To avoid number overflows.
The returned value is the squared magnitude of the world distance (i.e divided by Precision)
|
get |