public bool SetControllerTouchPoint(float x, float y)
        {
            NativeVector3f nv3    = new NativeVector3f(new Vector3(x, y, 0f));
            NativeResult   result = NativeApi.NRSIMControllerSetTouchPoint(m_ControllerHandle, ref nv3);

            return(result == NativeResult.Success);
        }
        public bool SetControllerAccelerometer(Vector3 accel)
        {
            NativeVector3f nv3    = new NativeVector3f(accel);
            NativeResult   result = NativeApi.NRSIMControllerSetAccelerometer(m_ControllerHandle, ref nv3);

            return(result == NativeResult.Success);
        }
        public bool SetControllerPosition(Vector3 postion)
        {
            NativeVector3f nv3    = new NativeVector3f(postion);
            NativeResult   result = NativeApi.NRSIMControllerSetPosition(m_ControllerHandle, ref nv3);

            return(result == NativeResult.Success);
        }
        public bool UpdateTrackablePlaneData(Vector3 centerPos, Quaternion centerQua, float extentX, float extentZ, UInt32 identifier, TrackingState state)
        {
            NativeVector3f pos    = new NativeVector3f(new Vector3(centerPos.x, centerPos.y, -centerPos.z));
            NativeVector4f qua    = new NativeVector4f(new Vector4(-centerQua.x, -centerQua.y, centerQua.z, centerQua.w));
            NativeResult   result = NativeApi.NRSIMTrackingUpdateTrackablePlaneData(m_TrackingHandle, ref pos, ref qua, extentX, extentZ, identifier, (int)state);

            return(result == NativeResult.Success);
        }
        public bool SetHeadTrackingPose(Vector3 position, Quaternion rotation)
        {
            NativeVector3f nativeVector3F = new NativeVector3f(new Vector3(position.x, position.y, -position.z));
            NativeVector4f nativeVector4F = new NativeVector4f(new Vector4(rotation.x, rotation.y, -rotation.z, -rotation.w));
            NativeResult   result         = NativeApi.NRSIMTrackingSetHeadTrackingPose(m_TrackingHandle, ref nativeVector3F, ref nativeVector4F);

            return(result == NativeResult.Success);
        }
        public Vector3 GetMag(int controllerIndex)
        {
            NativeVector3f vec3f  = new NativeVector3f();
            NativeResult   result = NativeApi.NRControllerStateGetMag(m_StateHandles[controllerIndex], ref vec3f);

            if (result == NativeResult.Success)
            {
                return(vec3f.ToUnityVector3());
            }
            return(Vector3.zero);
        }
 public static extern NativeResult NRControllerStateGetMag(UInt64 controller_state_handle, ref NativeVector3f out_controller_mag);
 public static extern NativeResult NRControllerStateGetAccel(UInt64 controller_state_handle, ref NativeVector3f out_controller_accel);
Exemple #9
0
 public NativeMat3f(Vector3 vec0, Vector3 vec1, Vector3 vec2)
 {
     column0 = new NativeVector3f(vec0);
     column1 = new NativeVector3f(vec1);
     column2 = new NativeVector3f(vec2);
 }
 public static extern NativeResult NRSIMControllerSetTouchPoint(UInt64 controller_handle, ref NativeVector3f point);
 public static extern NativeResult NRSIMControllerSetAccelerometer(UInt64 controller_handle, ref NativeVector3f accel);
 public static extern NativeResult NRSIMControllerSetPosition(UInt64 controller_handle, ref NativeVector3f position);
 public static extern NativeResult NRSIMTrackingUpdateTrackablePlaneData(UInt64 tracking_handle,
                                                                         ref NativeVector3f center_pos, ref NativeVector4f center_rotation,
                                                                         float extent_x, float extent_z, UInt32 identifier, int state);
 public static extern NativeResult NRSIMTrackingSetHeadTrackingPose(UInt64 tracking_handle,
                                                                    ref NativeVector3f position, ref NativeVector4f rotation);