Coordinates of a tile in a pyramid (see IPyramidBase).
struct
|
PyramidCoords
|
implements
|
IEquatable<PyramidCoords>
|
public
static
readonly
field
|
All
|
||
type
|
PyramidCoords
|
Undefined set of pyramid coordinates.
public
static
readonly
field
|
Undefined
|
||
type
|
PyramidCoords
|
Do these pyramid tile coordinates lie outside of the cubemap face and can be wrapped at the cubemap edges?
public
property
|
CanWrap
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
coordinates
can
be
wrapped,
false
if
not. |
See also:
WrapThe cubemap face.
public
readonly
field
|
Face
|
||
type
|
CubemapFace
|
Is this a leaf node (i.e. it does not have children)?
public
property
|
IsLeaf
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
is
a
leaf,
false
if
not. |
See also:
ChildIs this a root node (i.e. it does not have a parent)?
public
property
|
IsRoot
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
is
a
root,
false
if
not. |
See also:
ParentIs this set of pyramid coordinates undefined?
public
property
|
IsUndefined
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
these
pyramid
coordinates
are
undefined,
false
if
they
are
valid.
|
The pyramid level.
public
readonly
field
|
Level
|
||
type
|
int32
|
X-coordinate of tile in pyramid level.
public
readonly
field
|
TileX
|
||
type
|
int32
|
Y-coordinate of tile in pyramid level.
public
readonly
field
|
TileY
|
||
type
|
int32
|
Creates a new instance of PyramidCoords.
public
constructor
|
PyramidCoords
(CubemapFace face,
int32 level,
int32 tileX,
int32 tileY)
|
||
params
|
face
|
The cubemap face. | |
level
|
The pyramid level. | ||
tileX
|
X-coordinate of tile in pyramid level. | ||
tileY
|
Y-coordinate of tile in pyramid level. |
Returns the coordinates of a child node.
public
method
|
Child
(int32 index)
|
||
type
|
PyramidCoords
|
||
params
|
index
|
[0..3]
|
The child index. |
returns
|
The child coordinates or Undefined if this node is a leaf. |
Remarks:
Child indices are mapped to tile coordinates as follows:
+---+---+ | | 0 | 1 | | +---+---+ ----+---> X | 2 | 3 | | +---+---+ v Y
See also:
IsLeafChecks if this pyramid tile contains the given one.
public
method
|
Contains
(PyramidCoords other)
|
||
type
|
bool
|
||
params
|
other
|
The other pyramid tile. | |
returns
|
true
if
this
pyramid
tile
contains
the
given
one,
false
if
not.
|
public
method
|
Equals
(PyramidCoords other)
|
||
type
|
bool
|
||
params
|
other
|
public
override
method
|
GetHashCode
()
|
||
type
|
int32
|
Packs these pyramid tile coordinates into a 54-bit value.
public
method
|
Pack
()
|
||
type
|
int64
|
||
returns
|
The packed 54-bit value. |
Packs the given pyramid tile coordinates into a 54-bit value.
public
static
method
|
Pack
(CubemapFace face,
int32 level,
int32 tileX,
int32 tileY)
|
||
type
|
int64
|
||
params
|
face
|
The cubemap face. | |
level
|
[0..25]
|
The pyramid level. | |
tileX
|
[0..33554431]
|
Tile X-coordinate. | |
tileY
|
[0..33554431]
|
Tile Y-coordinate. | |
returns
|
The packed 54-bit value. |
Returns the coordinates of the parent node.
public
method
|
Parent
()
|
||
type
|
PyramidCoords
|
||
returns
|
The parent coordinates or Undefined if this node is a cubemap root. |
See also:
IsRootReturns the pyramid coordinates of the tile that corresponds to the given CLOD mesh sector.
public
static
method
|
Sector
(Vec3I sector,
int32 heightmapSize = HeightmapsUtil.MaxSize)
|
||
type
|
PyramidCoords
|
||
params
|
sector
|
Heightmap coordinates of mesh sector center vertex. | |
heightmapSize
|
[pow2+1]
|
Size of mesh heightmap. Defaults to MaxSize. | |
returns
|
The pyramid tile coordinates. |
Returns the pyramid coordinates of the tile that corresponds to the given CLOD mesh sector.
public
static
method
|
Sector
(int32 sectorX,
int32 sectorY,
int32 sectorZ,
int32 heightmapSize = HeightmapsUtil.MaxSize)
|
||
type
|
PyramidCoords
|
||
params
|
sectorX
|
Heightmap X-coordinate of mesh sector center vertex. | |
sectorY
|
Heightmap Y-coordinate of mesh sector center vertex. | ||
sectorZ
|
Heightmap Z-coordinate of mesh sector center vertex. | ||
heightmapSize
|
[pow2+1]
|
Size of mesh heightmap. Defaults to MaxSize. | |
returns
|
The pyramid tile coordinates. |
Returns the size of the given pyramid level.
public
static
method
|
Size
(int32 level)
|
||
type
|
int32
|
||
params
|
level
|
[0..30]
|
The pyramid level. |
returns
|
|
The pyramid level size, in tiles. |
public
override
method
|
ToString
()
|
||
type
|
string
|
Unpacks the given 54-bit value back to pyramid tile coordinates.
public
static
method
|
Unpack
(int64 value)
|
||
type
|
PyramidCoords
|
||
params
|
value
|
The packed 54-bit value. | |
returns
|
The pyramid tile coordinates. |
Wraps the pyramid coordinates at the cubemap edges.
public
method
|
Wrap
(out PyramidCoords coords)
|
||
type
|
Transform
|
||
params
|
coords
|
The wrapped pyramid tile coordinates. | |
returns
|
The transform that must be applied to the pyramid tile. |
See also:
CanWrap