// return true if visible // return false if error or invisible public bool updateMarkerTracking() { if (id != -1) { if (ARUWP.aruwpQueryMarkerTransformation(id, trans)) { transMatrix = ARUWPUtils.ConvertARUWPFloatArrayToMatrix4x4(trans); if (performMagicFunction) { MagicFunction(); } if (type != MarkerType.multi) { confidence = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_SQUARE_CONFIDENCE); } visible = true; return(true); } else { visible = false; confidence = 0.0f; return(false); } } else { Debug.Log(TAG + ": Transformation not valid for id -1"); visible = false; return(false); } }
/// <summary> /// Update tracking information, called by ARUWPController.cs. [internal use] /// </summary> public void UpdateTrackingInfo() { if (id != -1) { if (ARUWP.aruwpQueryMarkerTransformation(id, __info.trans)) { if (type != MarkerType.multi) { __info.confidence = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_SQUARE_CONFIDENCE); } __info.visible = true; } else { __info.visible = false; __info.confidence = 0.0f; } Interlocked.Exchange(ref _info, __info); signalTrackingUpdated = true; } else { Debug.Log(TAG + ": Transformation not valid for id -1"); } }
public void setOptionMinConfPattern(float o) { if (id != -1 && type == MarkerType.multi) { ARUWP.aruwpSetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_CONF_PATTERN, o); oMinConfSubPattern = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_CONF_PATTERN); if (oMinConfSubPattern != o) { Debug.Log(TAG + ": Unable to set ARUWP_MARKER_OPTION_MULTI_MIN_CONF_PATTERN to " + o); } } else { oMinConfSubPattern = o; } }
public void setOptionMinConfMatrix(float o) { if (id != -1 && type == MarkerType.multi) { ARUWP.aruwpSetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_CONF_MATRIX, o); oMinConfSubMatrix = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_CONF_MATRIX); if (oMinConfSubMatrix != o) { Debug.Log(TAG + ": Unable to set ARUWP_MARKER_OPTION_MULTI_MIN_CONF_MATRIX to " + o); } } else { oMinConfSubMatrix = o; } }
public void setOptionConfCutOff(float o) { if (id != -1 && type != MarkerType.multi) { ARUWP.aruwpSetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF, o); oConfCutOff = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF); if (oConfCutOff != o) { Debug.Log(TAG + ": Unable to set ARUWP_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF to " + o); } } else { oConfCutOff = o; } }
public void setOptionFilterCutoffFreq(float o) { if (id != -1 && oFiltered == true) { ARUWP.aruwpSetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_FILTER_CUTOFF_FREQ, o); oCutOffFreq = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_FILTER_CUTOFF_FREQ); if (oCutOffFreq != o) { Debug.Log(TAG + ": Unable to set ARUWP_MARKER_OPTION_FILTER_CUTOFF_FREQ to " + o); } } else { oCutOffFreq = o; } }
public void setOptionFilterSampleRate(float o) { if (id != -1 && oFiltered == true) { ARUWP.aruwpSetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_FILTER_SAMPLE_RATE, o); oSampleRate = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_FILTER_SAMPLE_RATE); if (oSampleRate != o) { Debug.Log(TAG + ": Unable to set ARUWP_MARKER_OPTION_FILTER_SAMPLE_RATE to " + o); } } else { oSampleRate = o; } }
/// <summary> /// Retrieve the marker information from the controller. The result represents the actual /// configuration of the marker being tracked, because some of the setting might not be /// taken for various reasons. [internal use] /// </summary> private void RetrieveMarkerInformation() { if (id != -1) { if (HasNativeHandle()) { oFiltered = ARUWP.aruwpGetMarkerOptionBool(id, ARUWP.ARUWP_MARKER_OPTION_FILTERED); if (oFiltered) { oSampleRate = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_FILTER_SAMPLE_RATE); oCutOffFreq = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_FILTER_CUTOFF_FREQ); } if (type != MarkerType.multi) { oUseContPoseEst = ARUWP.aruwpGetMarkerOptionBool(id, ARUWP.ARUWP_MARKER_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION); oConfCutOff = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF); } else { multiPatternCount = ARUWP.aruwpGetMarkerPatternCount(id); oMinSubMarkers = ARUWP.aruwpGetMarkerOptionInt(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_SUBMARKERS); oMinConfSubMatrix = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_CONF_MATRIX); oMinConfSubPattern = ARUWP.aruwpGetMarkerOptionFloat(id, ARUWP.ARUWP_MARKER_OPTION_MULTI_MIN_CONF_PATTERN); multiPatterns = new ARUWPPattern[multiPatternCount]; for (int i = 0; i < multiPatternCount; i++) { multiPatterns[i].patternID = i; multiPatterns[i].matrix = new float[16]; ARUWP.aruwpGetMarkerPatternConfig(id, i, multiPatterns[i].matrix, out multiPatterns[i].width, out multiPatterns[i].height, out multiPatterns[i].imageSizeX, out multiPatterns[i].imageSizeY); } } } else { Debug.Log(TAG + ": RetrieveMarkerInformation() unsupported status"); } } else { Debug.Log(TAG + ": Marker not added"); } }