コード例 #1
0
    /// <summary>
    /// Initialises the ARToolKit.
    /// </summary>
    /// <param name="pattSize"></param>
    /// <param name="pattCountMax"></param>
    /// <returns>true if successful, false if an error occurred.</returns>
    /// <remarks>For any square template (pattern) markers, the number of rows and columns in the template defaults to AR_PATT_SIZE1 and the maximum number of markers that may be loaded for a single matching pass defaults to AR_PATT_NUM_MAX.</remarks>
    /// <seealso cref="arwShutdownAR"/>
    public bool arwInitialiseAR()
    {
        string dllDir = "";

        dllDir = Environment.GetEnvironmentVariable("ARTOOLKIT5_ROOT64");
        if (string.IsNullOrEmpty(dllDir))
        {
            dllDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
        }
        if (dllDir.Equals(""))
        {
            throw new System.Exception("ARToolKitCSharpIntegration.ARToolKitFunctions.arwInitialiseAR(): ARTOOLKIT5_ROOT64 not set. Please set ARTOOLKIT5_ROOT64 in your environment variables to the path where you installed ARToolKit to.");
        }
        else
        {
            SetDllDirectory(dllDir + "\\");
        }

        bool ok;

        ok = ARNativePlugin.arwInitialiseAR();
        if (ok)
        {
            inited = true;
        }
        return(ok);
    }
コード例 #2
0
    public static bool arwGetVideoParamsStereo(out int widthL, out int heightL, out int pixelSizeL, out String pixelFormatL, out int widthR, out int heightR, out int pixelSizeR, out String pixelFormatR)
    {
        StringBuilder sbL = new StringBuilder(128);
        StringBuilder sbR = new StringBuilder(128);
        bool          ok;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            ok = ARNativePluginStatic.arwGetVideoParamsStereo(out widthL, out heightL, out pixelSizeL, sbL, sbL.Capacity, out widthR, out heightR, out pixelSizeR, sbR, sbR.Capacity);
        }
        else
        {
            ok = ARNativePlugin.arwGetVideoParamsStereo(out widthL, out heightL, out pixelSizeL, sbL, sbL.Capacity, out widthR, out heightR, out pixelSizeR, sbR, sbR.Capacity);
        }
        if (!ok)
        {
            pixelFormatL = "";
            pixelFormatR = "";
        }
        else
        {
            pixelFormatL = sbL.ToString();
            pixelFormatR = sbR.ToString();
        }
        return(ok);
    }
コード例 #3
0
    public bool arwGetMarkerPatternImage(int markerID, int patternID, [In, Out] Color[] colors)
    {
        bool ok;

        ok = ARNativePlugin.arwGetMarkerPatternImage(markerID, patternID, colors);
        return(ok);
    }
コード例 #4
0
    public bool arwUpdateARToolKit(byte[] imageBytes, bool doDatums)
    {
        bool     ok      = false;
        GCHandle handle  = GCHandle.Alloc(imageBytes, GCHandleType.Pinned);
        IntPtr   address = handle.AddrOfPinnedObject();

        ok = ARNativePlugin.arwUpdateARToolKit(address, doDatums);
        handle.Free();
        return(ok);
    }
コード例 #5
0
    // Uses 4 calibration factors
    public float arwCalibChessboardCornersSimple(int numImages, string file_name, out float[] projectErrorResults)
    {
        projectErrorResults = new float[numImages];
        GCHandle handle  = GCHandle.Alloc(projectErrorResults, GCHandleType.Pinned);
        IntPtr   address = handle.AddrOfPinnedObject();
        float    averageProjectionError = ARNativePlugin.arwCalibChessboardCornersSimple(file_name, address);

        handle.Free();
        return(averageProjectionError);
    }
コード例 #6
0
    public bool arwQueryTrackableMapperTransformation(int gMapUID, int trackableUID, double[] matrix)
    {
        GCHandle handle1  = GCHandle.Alloc(matrix, GCHandleType.Pinned);
        IntPtr   address1 = handle1.AddrOfPinnedObject();

        bool ret = ARNativePlugin.arwQueryTrackableMapperTransformation(gMapUID, trackableUID, address1);

        handle1.Free();
        return(ret);
    }
コード例 #7
0
    public bool arwUpdateTexture32([In, Out] Color32[] colors32)
    {
        bool     ok;
        GCHandle handle  = GCHandle.Alloc(colors32, GCHandleType.Pinned);
        IntPtr   address = handle.AddrOfPinnedObject();

        ok = ARNativePlugin.arwUpdateTexture32(address);
        handle.Free();
        return(ok);
    }
コード例 #8
0
 public static bool arwQueryMarkerVisibility(int markerID)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwQueryMarkerVisibility(markerID));
     }
     else
     {
         return(ARNativePlugin.arwQueryMarkerVisibility(markerID));
     }
 }
コード例 #9
0
 public static bool arwQueryMarkerTransformationStereo(int markerID, float[] matrixL, float[] matrixR)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwQueryMarkerTransformationStereo(markerID, matrixL, matrixR));
     }
     else
     {
         return(ARNativePlugin.arwQueryMarkerTransformationStereo(markerID, matrixL, matrixR));
     }
 }
コード例 #10
0
 public static bool arwRemoveMarker(int markerID)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwRemoveMarker(markerID));
     }
     else
     {
         return(ARNativePlugin.arwRemoveMarker(markerID));
     }
 }
コード例 #11
0
 public static int arwRemoveAllMarkers()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwRemoveAllMarkers());
     }
     else
     {
         return(ARNativePlugin.arwRemoveAllMarkers());
     }
 }
コード例 #12
0
 public static void arwSetTrackerOptionFloat(int option, float value)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         ARNativePluginStatic.arwSetTrackerOptionFloat(option, value);
     }
     else
     {
         ARNativePlugin.arwSetTrackerOptionFloat(option, value);
     }
 }
コード例 #13
0
 public static int arwAddMarker(string cfg)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwAddMarker(cfg));
     }
     else
     {
         return(ARNativePlugin.arwAddMarker(cfg));
     }
 }
コード例 #14
0
ファイル: PluginFunctions.cs プロジェクト: Pierr0/ARProject
 public static void arwSetNFTMultiMode(bool on)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         ARNativePluginStatic.arwSetNFTMultiMode(on);
     }
     else
     {
         ARNativePlugin.arwSetNFTMultiMode(on);
     }
 }
コード例 #15
0
 public static bool arwGetProjectionMatrixStereo(float[] matrixL, float[] matrixR)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetProjectionMatrixStereo(matrixL, matrixR));
     }
     else
     {
         return(ARNativePlugin.arwGetProjectionMatrixStereo(matrixL, matrixR));
     }
 }
コード例 #16
0
 public static bool arwGetTrackableAppearanceConfig(int markerID, int patternID, float[] matrix, out float width, out float height, out int imageSizeX, out int imageSizeY)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetTrackableAppearanceConfig(markerID, patternID, matrix, out width, out height, out imageSizeX, out imageSizeY));
     }
     else
     {
         return(ARNativePlugin.arwGetTrackableAppearanceConfig(markerID, patternID, matrix, out width, out height, out imageSizeX, out imageSizeY));
     }
 }
コード例 #17
0
ファイル: PluginFunctions.cs プロジェクト: Pierr0/ARProject
 public static bool arwGetNFTMultiMode()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetNFTMultiMode());
     }
     else
     {
         return(ARNativePlugin.arwGetNFTMultiMode());
     }
 }
コード例 #18
0
 public static int arwGetTrackableAppearanceCount(int markerID)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetTrackableAppearanceCount(markerID));
     }
     else
     {
         return(ARNativePlugin.arwGetTrackableAppearanceCount(markerID));
     }
 }
コード例 #19
0
 public static bool arwUpdateAR()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwUpdateAR());
     }
     else
     {
         return(ARNativePlugin.arwUpdateAR());
     }
 }
コード例 #20
0
ファイル: PluginFunctions.cs プロジェクト: Pierr0/ARProject
 public static bool arwLoadOpticalParams(string optical_param_name, byte[] optical_param_buff, int optical_param_buffLen, out float fovy_p, out float aspect_p, float[] m, float[] p)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwLoadOpticalParams(optical_param_name, optical_param_buff, optical_param_buffLen, out fovy_p, out aspect_p, m, p));
     }
     else
     {
         return(ARNativePlugin.arwLoadOpticalParams(optical_param_name, optical_param_buff, optical_param_buffLen, out fovy_p, out aspect_p, m, p));
     }
 }
コード例 #21
0
 public static void arwSetLogLevel(int logLevel)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         ARNativePluginStatic.arwSetLogLevel(logLevel);
     }
     else
     {
         ARNativePlugin.arwSetLogLevel(logLevel);
     }
 }
コード例 #22
0
 public static bool arwStartRunningB(string vconf, byte[] cparaBuff, int cparaBuffLen, float nearPlane, float farPlane)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwStartRunningB(vconf, cparaBuff, cparaBuffLen, nearPlane, farPlane));
     }
     else
     {
         return(ARNativePlugin.arwStartRunningB(vconf, cparaBuff, cparaBuffLen, nearPlane, farPlane));
     }
 }
コード例 #23
0
ファイル: PluginFunctions.cs プロジェクト: Pierr0/ARProject
 public static void arwSetImageProcMode(int mode)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         ARNativePluginStatic.arwSetImageProcMode(mode);
     }
     else
     {
         ARNativePlugin.arwSetImageProcMode(mode);
     }
 }
コード例 #24
0
 public static bool arwStartRunningStereoB(string vconfL, byte[] cparaBuffL, int cparaBuffLenL, string vconfR, byte[] cparaBuffR, int cparaBuffLenR, byte[] transL2RBuff, int transL2RBuffLen, float nearPlane, float farPlane)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwStartRunningStereoB(vconfL, cparaBuffL, cparaBuffLenL, vconfR, cparaBuffR, cparaBuffLenR, transL2RBuff, transL2RBuffLen, nearPlane, farPlane));
     }
     else
     {
         return(ARNativePlugin.arwStartRunningStereoB(vconfL, cparaBuffL, cparaBuffLenL, vconfR, cparaBuffR, cparaBuffLenR, transL2RBuff, transL2RBuffLen, nearPlane, farPlane));
     }
 }
コード例 #25
0
 public static int arwGetTrackableOptionInt(int markerID, int option)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetTrackableOptionInt(markerID, option));
     }
     else
     {
         return(ARNativePlugin.arwGetTrackableOptionInt(markerID, option));
     }
 }
コード例 #26
0
 public static int arwGetError()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetError());
     }
     else
     {
         return(ARNativePlugin.arwGetError());
     }
 }
コード例 #27
0
    /// <summary>
    /// Shuts down the ARToolKit and frees all resources.
    /// N.B.: If this is being called from the destructor of the same module which
    /// supplied the log callback, be sure to set the logCallback = NULL
    /// prior to calling this function.
    /// </summary>
    /// <returns>true if successful, false if an error occurred.</returns>
    /// <seealso cref="arwInitialiseAR"/>
    public bool arwShutdownAR()
    {
        bool ok = false;

        ok = ARNativePlugin.arwShutdownAR();
        if (ok)
        {
            inited = false;
        }
        return(ok);
    }
コード例 #28
0
 public static void arwSetTrackableOptionInt(int markerID, int option, int value)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         ARNativePluginStatic.arwSetTrackableOptionInt(markerID, option, value);
     }
     else
     {
         ARNativePlugin.arwSetTrackableOptionInt(markerID, option, value);
     }
 }
コード例 #29
0
 public static float arwGetTrackerOptionFloat(int option)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(ARNativePluginStatic.arwGetTrackerOptionFloat(option));
     }
     else
     {
         return(ARNativePlugin.arwGetTrackerOptionFloat(option));
     }
 }
コード例 #30
0
ファイル: PluginFunctions.cs プロジェクト: Pierr0/ARProject
 public static void arwSetMatrixCodeType(int type)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         ARNativePluginStatic.arwSetMatrixCodeType(type);
     }
     else
     {
         ARNativePlugin.arwSetMatrixCodeType(type);
     }
 }