Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: device/vr/vr_math.h

Issue 2795793002: Implementation of elbow model for the controller position and rotation. (Closed)
Patch Set: nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_renderer.cc ('k') | device/vr/vr_math.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_math.h
diff --git a/device/vr/vr_math.h b/device/vr/vr_math.h
index 2426b3dccfd1b672bd5c9ceb7235794c4a736422..55c165c45f6c0b6f498347d263fec29d01fc9b1d 100644
--- a/device/vr/vr_math.h
+++ b/device/vr/vr_math.h
@@ -33,6 +33,27 @@ gfx::Vector3dF DEVICE_VR_EXPORT GetTranslation(const Mat4f& matrix);
void DEVICE_VR_EXPORT QuatToMatrix(const Quatf& quat, Mat4f* out);
+// Creates a rotation which rotates `from` vector to `to`.
+vr::Quatf DEVICE_VR_EXPORT GetVectorRotation(const gfx::Vector3dF& from,
+ const gfx::Vector3dF& to);
+
+vr::Quatf DEVICE_VR_EXPORT QuatSum(const vr::Quatf& a, const vr::Quatf& b);
+vr::Quatf DEVICE_VR_EXPORT QuatProduct(const vr::Quatf& a, const vr::Quatf& b);
+vr::Quatf DEVICE_VR_EXPORT ScaleQuat(const vr::Quatf& q, float s);
+
+vr::Quatf DEVICE_VR_EXPORT InvertQuat(const vr::Quatf& quat);
+
+float DEVICE_VR_EXPORT QuatAngleDegrees(const vr::Quatf& a, const vr::Quatf& b);
+
+vr::Quatf DEVICE_VR_EXPORT QuatLerp(const vr::Quatf& a,
+ const vr::Quatf& b,
+ float t);
+
+// Spherical linear interpolation.
+gfx::Vector3dF DEVICE_VR_EXPORT QuatSlerp(const gfx::Vector3dF& v_start,
+ const gfx::Vector3dF& v_end,
+ float percent);
+
// Normalize a vector, and return its original length.
float DEVICE_VR_EXPORT NormalizeVector(gfx::Vector3dF* vec);
@@ -49,6 +70,20 @@ bool DEVICE_VR_EXPORT XZAngle(const gfx::Vector3dF& vec1,
const gfx::Vector3dF& vec2,
float* angle);
+gfx::Vector3dF DEVICE_VR_EXPORT ToVector(const gfx::Point3F& p);
+
+gfx::Point3F DEVICE_VR_EXPORT ToPoint(const gfx::Vector3dF& p);
+
+// Scale components of the point by the components of the vector.
+gfx::Point3F DEVICE_VR_EXPORT ScalePoint(const gfx::Point3F& p,
+ const gfx::Vector3dF& s);
+
+// Scale components of a vector by the components of another.
+gfx::Vector3dF DEVICE_VR_EXPORT ScaleVector(const gfx::Vector3dF& p,
+ const gfx::Vector3dF& s);
+
+float DEVICE_VR_EXPORT Clampf(float value, float min, float max);
+
} // namespace vr
#endif // DEVICE_VR_VR_MATH_H_
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_renderer.cc ('k') | device/vr/vr_math.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698