1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-09-19 14:49:54 +00:00
DirectXMath/Stereo3D/Stereo3DMatrixHelper.h

64 lines
2.3 KiB
C
Raw Normal View History

2017-07-13 08:28:40 +00:00
//-------------------------------------------------------------------------------------
// Stereo3DMatrixHelper.h -- SIMD C++ Math helper for Stereo 3D matrices
//
2021-02-27 07:17:26 +00:00
// Copyright (c) Microsoft Corporation.
2018-02-24 07:16:27 +00:00
// Licensed under the MIT License.
2017-07-13 08:28:40 +00:00
//-------------------------------------------------------------------------------------
2017-07-13 08:26:41 +00:00
#pragma once
2017-07-13 08:28:40 +00:00
#include "DirectXMath.h"
2017-07-13 08:29:17 +00:00
namespace DirectX
2017-07-13 08:26:41 +00:00
{
2017-07-13 08:29:17 +00:00
// Enumeration for stereo channels (left and right).
enum STEREO_CHANNEL
{
STEREO_CHANNEL_LEFT = 0,
STEREO_CHANNEL_RIGHT
};
2017-07-13 08:26:41 +00:00
2017-07-13 08:29:17 +00:00
// Enumeration for stereo mode (normal or inverted).
enum STEREO_MODE
{
STEREO_MODE_NORMAL = 0,
STEREO_MODE_INVERTED,
};
2017-07-13 08:28:40 +00:00
2017-07-13 08:29:17 +00:00
//------------------------------------------------------------------------------
//
// Stereo calibration settings
//
// * Viewer distance to the display
// * Physical display size
// * Render resolution
//
// The stereo separation factor indicates how much separation is between the left and right
// eyes. 0 is no separation, 1 is full separation. It defaults to 1.0.
//
// The debug stereo exaggeration factor indicates how much to increase the interocular spacing and
// maximum acuity angle from comfortable defaults. For retail builds, this value should always
// be 1.0, but during development, on small screens, this value can be raised to up to 2.0 in
// order to exaggerate the 3D effect. Values over 1.0 may cause discomfort on normal sized
// displays. It defaults to 1.0.
//
struct STEREO_PARAMETERS
{
float fViewerDistanceInches;
float fDisplaySizeInches;
float fPixelResolutionWidth;
float fPixelResolutionHeight;
float fStereoSeparationFactor;
float fStereoExaggerationFactor;
};
2017-07-13 08:28:40 +00:00
2017-07-13 08:29:17 +00:00
void StereoCreateDefaultParameters(STEREO_PARAMETERS& stereoParameters);
2017-07-13 08:28:40 +00:00
2017-07-13 08:29:17 +00:00
XMMATRIX StereoProjectionFovLH(_In_opt_ const STEREO_PARAMETERS* pStereoParameters,
STEREO_CHANNEL Channel, float FovAngleY, float AspectRatio, float NearZ, float FarZ,
STEREO_MODE StereoMode = STEREO_MODE_NORMAL);
2017-07-13 08:28:40 +00:00
2017-07-13 08:29:17 +00:00
XMMATRIX StereoProjectionFovRH(_In_opt_ const STEREO_PARAMETERS* pStereoParameters,
STEREO_CHANNEL Channel, float FovAngleY, float AspectRatio, float NearZ, float FarZ,
STEREO_MODE StereoMode = STEREO_MODE_NORMAL);
}