-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error - OculusTouchCursor.cs - UnityEngine.Matrix4x4 does not contain 'GetRotation' method #57
Comments
Hi @richyz, thanks for posting this bug. The My mistake -- I have both Steam VR (for Vive) and Oculus packages installed in my local project, so I didn't see this compilation error. As an immediate workaround, you could use the code from the Steam VR package: public static Quaternion GetRotation(this Matrix4x4 matrix) {
Quaternion q = new Quaternion();
q.w = Mathf.Sqrt(Mathf.Max(0, 1 matrix.m00 matrix.m11 matrix.m22)) / 2;
q.x = Mathf.Sqrt(Mathf.Max(0, 1 matrix.m00 - matrix.m11 - matrix.m22)) / 2;
q.y = Mathf.Sqrt(Mathf.Max(0, 1 - matrix.m00 matrix.m11 - matrix.m22)) / 2;
q.z = Mathf.Sqrt(Mathf.Max(0, 1 - matrix.m00 - matrix.m11 matrix.m22)) / 2;
q.x = _copysign(q.x, matrix.m21 - matrix.m12);
q.y = _copysign(q.y, matrix.m02 - matrix.m20);
q.z = _copysign(q.z, matrix.m10 - matrix.m01);
return q;
} I'll look into a code fix that avoids this dependency. |
@richyz, the commit link above includes a proper fix for this issue. It turns out that the method's use of For now, please patch this updated method into your code. This change will be included in the next Hover UI Kit release. private void UpdateDataWithLocalOffsets(ICursorDataForInput pData,
HoverInputOculusTouch.ControlState pState) {
pData.SetWorldPosition(
OriginTransform.TransformPoint(pState.LocalPos) pState.LocalRot*LocalPosition);
pData.SetWorldRotation(
OriginTransform.rotation*pState.LocalRot*Quaternion.Euler(LocalRotation));
} |
Hi Zach, that resolved the issue. I sent you an email, Thanks for the quick response and fix! -Rich |
Hello, awesome software, wow very nice!!!
When I compile, I get this error:
Assets/Hover/InputModules/OculusTouch/Scripts/OculusTouchCursor.cs(120,36): error CS1061: Type
UnityEngine.Matrix4x4' does not contain a definition for
GetRotation' and no extension methodGetRotation' of type
UnityEngine.Matrix4x4' could be found. Are you missing an assembly reference?From this function (error is shown in comments):
` /--------------------------------------------------------------------------------------------/
private void UpdateDataWithLocalOffsets(ICursorDataForInput pData,
HoverInputOculusTouch.ControlState pState) {
Matrix4x4 txMat = OriginTransform.localToWorldMatrix;
Matrix4x4 txRotMat = txMat*Matrix4x4.TRS(Vector3.zero, pState.LocalRot, Vector3.one);
`
Also, I'd like to try and use different data in your Force Directed Graph example. Is this possible with this code? Any suggestion on how to do this?
Thanks for sharing this excellent software!
Rich
The text was updated successfully, but these errors were encountered: