7#include "utility_northstar.h"
23 GetEyePosition()
const
29 RenderUVToDisplayUV(
const Vector3 &inputUV);
32 RenderUVToDisplayUV(
const Vector2 &inputUV);
35 SolveDisplayUVToRenderUV(
const Vector2 &inputUV,
Vector2 const &initialGuess,
int iterations);
38 DisplayUVToRenderUVPreviousSeed(
const Vector2 &inputUV);
44 UpdateEyePosition(
const Vector3 &pos)
46 eyePosition.x = pos.x;
47 eyePosition.y = pos.y;
48 eyePosition.z = pos.z;
54 return cameraProjection;
58 setiters(
int init,
int opt)
60 m_iniSolverIters = init;
61 m_optSolverIters = opt;
65 UpdateClipToWorld(
const Matrix4x4 &eyeRotationMatrix)
67 Matrix4x4 eyeToWorld = Matrix4x4::Translate(eyePosition) * eyeRotationMatrix;
71 clipToWorld = eyeToWorld * cameraProjection.ComposeProjection().Inverse();
77 ViewportPointToRayDirection(
const Vector2 &UV,
86 Vector3 dir = clipToWorld.MultiplyPoint(
tmp * 2.f) - cameraPosition;
88 float mag = dir.Magnitude();
93 float ellipseMinorAxis;
94 float ellipseMajorAxis;
104 int m_iniSolverIters;
105 int m_optSolverIters;
107 std::map<float, std::map<float, Vector2> > m_requestedUVs;
114 Vector3 v2Norm = (v2 / v2.Magnitude());
115 return v2Norm * Vector3::Dot(v1, v2Norm);
119intersectLineSphere(
const Vector3 &Origin,
122 float SphereRadiusSqrd,
123 bool frontSide =
true)
125 Vector3 L = spherePos - Origin;
126 Vector3 offsetFromSphereCenterToRay = Project(L, Direction) - L;
127 return (offsetFromSphereCenterToRay.sqrMagnitude() <= SphereRadiusSqrd)
128 ? Vector3::Dot(L, Direction) - (sqrt(SphereRadiusSqrd - offsetFromSphereCenterToRay.sqrMagnitude()) *
129 (frontSide ? 1.f : -1.f))
137 float denom = Vector3::Dot((Vector3::Zero() - n), l);
138 if (denom > 1.4e-45f) {
140 float t = Vector3::Dot(p0l0, (Vector3::Zero() - n)) / denom;
Definition: utility_northstar.h:356
Definition: deformation_northstar.h:13
Definition: utility_northstar.h:270
Definition: utility_northstar.h:16
Definition: utility_northstar.h:665
Distortion information about an eye parsed from the configuration file.
Definition: ns_hmd.h:50
Definition: comp_scratch.c:122