Skip to content

Commit

Permalink
ViewAdjustment refactors: don't keep local copies of pos tracking mul…
Browse files Browse the repository at this point in the history
…tipliers, min/max convergence as real constants
  • Loading branch information
jimrandomh committed May 10, 2015
1 parent c75be7d commit dbb56a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
14 changes: 6 additions & 8 deletions DxProxy/DxProxy/ViewAdjustment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define PI 3.141592654

// TODO : max, min convergence; arbitrary now
const float minConvergence = -10.0f;
const float maxConvergence = 10.0f;

/**
* Constructor.
* Sets class constants, identity matrices and a projection matrix.
Expand All @@ -42,15 +46,9 @@ ViewAdjustment::ViewAdjustment(HMDisplayInfo *displayInfo, float metersToWorldUn
hmdInfo(displayInfo),
metersToWorldMultiplier(metersToWorldUnits),
rollImpl(roll),
m_roll(0.0f),
x_scaler(DEFAULT_POS_TRACKING_X_MULT),
y_scaler(DEFAULT_POS_TRACKING_Y_MULT),
z_scaler(DEFAULT_POS_TRACKING_Z_MULT)
m_roll(0.0f)
{
// TODO : max, min convergence; arbitrary now
convergence = 0.0f;
minConvergence = -10.0f;
maxConvergence = 10.0f;

ipd = IPD_DEFAULT;

Expand Down Expand Up @@ -241,7 +239,7 @@ void ViewAdjustment::UpdatePosition(float yaw, float pitch, float roll, float xP

//Now apply game specific scaling for the X/Y/Z
D3DXMATRIX gamescalingmatrix;
D3DXMatrixScaling(&gamescalingmatrix, x_scaler, y_scaler, z_scaler);
D3DXMatrixScaling(&gamescalingmatrix, config->position_x_multiplier, config->position_y_multiplier, config->position_z_multiplier);
D3DXVec3TransformNormal(&positionTransformVec, &positionTransformVec, &gamescalingmatrix);

D3DXMatrixTranslation(&matPosition, positionTransformVec.x, positionTransformVec.y, positionTransformVec.z);
Expand Down
13 changes: 0 additions & 13 deletions DxProxy/DxProxy/ViewAdjustment.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ class ViewAdjustment
int GetStereoType();
HMDisplayInfo* HMDInfo();

public:
float x_scaler;
float y_scaler;
float z_scaler;

private:
ProxyConfig *config;

Expand All @@ -126,14 +121,6 @@ class ViewAdjustment

D3DXVECTOR3 positionTransformVec;

/**
* Constant minimum convergence.
***/
float minConvergence;
/**
* Constant maximum convergence.
***/
float maxConvergence;
/**
* Positional translation matrix
**/
Expand Down

0 comments on commit dbb56a5

Please sign in to comment.