Walls And Holes  1
M2M_Private::SideTools Namespace Reference

Functions

QPoint neighborOffset (SideDirection side)
 neighborOffset Computes the offset for the coordinates of a neighbor of a tile. More...
 
QVector2D awayDirection (SideDirection side)
 awayDirection Computes the "away" direction for a side on a tile, in XZ coordinates. More...
 
QVector3D normalDirection (SideDirection side)
 normalDirection Computes the normal direction for a vertical side of a tile. More...
 
M2M::Quad makeTopQuadFragment (SideDirection side, QVector2D quadCenter, QVector2D minusQuadCenter, float minusQuadSize, M2M::ImageInfo quadImage, M2M::PhongInfo quadMaterial)
 makeTopQuadFragment Creates a fragment of a top-facing quad. More...
 

Function Documentation

◆ awayDirection()

QVector2D M2M_Private::SideTools::awayDirection ( SideDirection  side)

awayDirection Computes the "away" direction for a side on a tile, in XZ coordinates.

Parameters
sideThe direction a side is facing.
Returns
NORTH -> (0, -1) EAST -> (1, 0) SOUTH -> (0, 1) WEST -> (-1, 0)
Here is the caller graph for this function:

◆ makeTopQuadFragment()

M2M::Quad M2M_Private::SideTools::makeTopQuadFragment ( SideDirection  side,
QVector2D  quadCenter,
QVector2D  minusQuadCenter,
float  minusQuadSize,
M2M::ImageInfo  quadImage,
M2M::PhongInfo  quadMaterial 
)

makeTopQuadFragment Creates a fragment of a top-facing quad.

Parameters
sideWhich fragment? (there are 4!)
quadCenterCenter in XZ coordinates of the quad. The quad is assumed to be size (1, 1).
minusQuadCenterCenter in XZ coordinates of the quad that is subtracted.
minusQuadSizeSize of the subtracted quad (so it is assumed a square).
quadImageTexture for the main quad.
quadMaterialMaterial for the main quad.
Returns
TODO

TODO: Preconditions.

Here is the call graph for this function:

◆ neighborOffset()

QPoint M2M_Private::SideTools::neighborOffset ( SideDirection  side)

neighborOffset Computes the offset for the coordinates of a neighbor of a tile.

Parameters
sideThe direction towards the neighbor.
Returns
NORTH -> (0, -1) EAST -> (1, 0) SOUTH -> (0, -1) WEST -> (-1, 0)

◆ normalDirection()

QVector3D M2M_Private::SideTools::normalDirection ( SideDirection  side)

normalDirection Computes the normal direction for a vertical side of a tile.

Parameters
sideThe direction a side is facing.
Returns
NORTH -> (0, 0, -1) EAST -> (1, 0, 0) SOUTH -> (0, 0, 1) WEST -> (-1, 0, 0)
Here is the call graph for this function:
Here is the caller graph for this function: