Skip to main content

Auki::ConjureKit::Manna::DefaultTextureToNDCMatrices

Public Functions

Name
Matrix4x4InsensitiveGenericMatrix(TextureCorner originOfTextureInPortraitMode, bool widthIsHorizontalInPortraitMode, int textureWidth, int textureHeight, int screenWidth, int screenHeight, ScreenOrientation screenOrientation)
Matrix4x4SensitiveGenericMatrix(TextureCorner originOfTextureInPortraitMode, bool widthIsHorizontalInPortraitMode, int textureWidth, int textureHeight, int screenWidth, int screenHeight, ScreenOrientation screenOrientation)
Matrix4x4ARFoundationDefaultMatrix(int textureWidth, int textureHeight, int screenWidth, int screenHeight, ScreenOrientation screenOrientation)
Computes a projectedToTextureCoordinatesMatrix that is suited for a texture created via the Manna ARFoundation code samples. See Manna.ProcessVideoFrameTexture for more details on creating a custom textureToProjectedCoordinatesMatrix.
Matrix4x4GenericMatrix(TextureCorner originOfTextureInPortraitMode, bool widthIsHorizontalInPortraitMode, bool insensitiveToLandscapeMode, int textureWidth, int textureHeight, int screenWidth, int screenHeight, ScreenOrientation screenOrientation)
Generic option-based constructor for a textureToProjectedCoordinatesMatrix when the projected coordinates are NDC (Normalized Device Coordinates), as in most systems. Note that normalized device coordinates go from -1 to 1 left-to-right and bottom-to-top across the screen and that only the ratio screenWidth / screenHeight matters to the resulting matrix, and not the actual values of screenWidth and screenHeight.

Public Functions Documentation

function InsensitiveGenericMatrix

static Matrix4x4 InsensitiveGenericMatrix(
TextureCorner originOfTextureInPortraitMode,
bool widthIsHorizontalInPortraitMode,
int textureWidth,
int textureHeight,
int screenWidth,
int screenHeight,
ScreenOrientation screenOrientation
)

function SensitiveGenericMatrix

static Matrix4x4 SensitiveGenericMatrix(
TextureCorner originOfTextureInPortraitMode,
bool widthIsHorizontalInPortraitMode,
int textureWidth,
int textureHeight,
int screenWidth,
int screenHeight,
ScreenOrientation screenOrientation
)

function ARFoundationDefaultMatrix

static Matrix4x4 ARFoundationDefaultMatrix(
int textureWidth,
int textureHeight,
int screenWidth,
int screenHeight,
ScreenOrientation screenOrientation
)

Computes a projectedToTextureCoordinatesMatrix that is suited for a texture created via the Manna ARFoundation code samples. See Manna.ProcessVideoFrameTexture for more details on creating a custom textureToProjectedCoordinatesMatrix.

function GenericMatrix

static Matrix4x4 GenericMatrix(
TextureCorner originOfTextureInPortraitMode,
bool widthIsHorizontalInPortraitMode,
bool insensitiveToLandscapeMode,
int textureWidth,
int textureHeight,
int screenWidth,
int screenHeight,
ScreenOrientation screenOrientation
)

Generic option-based constructor for a textureToProjectedCoordinatesMatrix when the projected coordinates are NDC (Normalized Device Coordinates), as in most systems. Note that normalized device coordinates go from -1 to 1 left-to-right and bottom-to-top across the screen and that only the ratio screenWidth / screenHeight matters to the resulting matrix, and not the actual values of screenWidth and screenHeight.

Parameters:

  • originOfTextureInPortraitMode TextureCorner enum value
  • widthIsHorizontalInPortraitMode Set this bool to true if the texture coordinate ranging from 0 to texture.width is a horizontal coordinate in portrait mode
  • insensitiveToLandscapeMode Set this bool to true if the texture coordinate system does not change when the device passes from portrait mode to landscape mode (e.g., texture.width and texture.height do not switch)
  • textureWidth Pixel width of the texture (texture.width)
  • textureHeight Pixel height of the texture (texture.height)
  • screenWidth Pixel screen width, typically Screen.width
  • screenHeight Pixel screen height, typically Screen.height
  • screenOrientation The current potrait or landscape mode, typically Screen.orientation