コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Tango3DReconstruction"/> class.
        /// </summary>
        /// <param name="resolution">Size in meters of each grid cell.</param>
        /// <param name="generateColor">If true the reconstruction will contain color information.</param>
        /// <param name="spaceClearing">If true the reconstruction will clear empty space it detects.</param>
        internal Tango3DReconstruction(float resolution, bool generateColor, bool spaceClearing)
        {
            IntPtr config = API.Tango3DR_Config_create((int)APIConfigType.Context);

            API.Tango3DR_Config_setDouble(config, "resolution", resolution);
            API.Tango3DR_Config_setBool(config, "generate_color", generateColor);
            API.Tango3DR_Config_setBool(config, "use_space_clearing", spaceClearing);

            // The 3D Reconstruction library can not handle a left handed transformation during update.  Instead,
            // transform into the Unity world space via the external_T_tango config.
            APIMatrix3x3 unityWorld_T_startService = new APIMatrix3x3();

            unityWorld_T_startService.SetRow(0, new Vector3(1, 0, 0));
            unityWorld_T_startService.SetRow(1, new Vector3(0, 0, 1));
            unityWorld_T_startService.SetRow(2, new Vector3(0, 1, 0));
            API.Tango3DR_Config_setMatrix3x3(config, "external_T_tango", ref unityWorld_T_startService);
            API.Tango3DR_Config_setBool(config, "use_clockwise_winding_order", true);

            m_context = API.Tango3DR_create(config);
            API.Tango3DR_Config_destroy(config);
        }
コード例 #2
0
 public static int Tango3DR_Config_getMatrix3x3(IntPtr config, string key, out APIMatrix3x3 value)
 {
     value.r00 = value.r11 = value.r22 = 1;
     value.r10 = value.r20 = value.r01 = value.r21 = value.r02 = value.r12 = 0;
     return((int)Status.SUCCESS);
 }
コード例 #3
0
 public static int Tango3DR_Config_setMatrix3x3(IntPtr config, string key, ref APIMatrix3x3 value)
 {
     return((int)Status.SUCCESS);
 }
コード例 #4
0
 public static extern int Tango3DR_Config_getMatrix3x3(IntPtr config, string key, out APIMatrix3x3 value);
コード例 #5
0
 public static int Tango3DR_Config_getMatrix3x3(IntPtr config, string key, out APIMatrix3x3 value)
 {
     value.r00 = value.r11 = value.r22 = 1;
     value.r10 = value.r20 = value.r01 = value.r21 = value.r02 = value.r12 = 0;
     return (int)Status.SUCCESS;
 }
コード例 #6
0
 public static int Tango3DR_Config_setMatrix3x3(IntPtr config, string key, ref APIMatrix3x3 value)
 {
     return (int)Status.SUCCESS;
 }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Tango3DReconstruction"/> class.
        /// </summary>
        /// <param name="resolution">Size in meters of each grid cell.</param>
        /// <param name="generateColor">If true the reconstruction will contain color information.</param>
        /// <param name="spaceClearing">If true the reconstruction will clear empty space it detects.</param> 
        /// <param name="minNumVertices">
        /// If non-zero, any submesh with less than this number of vertices will get removed, assumed to be noise.
        /// </param>
        /// <param name="updateMethod">Method used to update voxels.</param>
        internal Tango3DReconstruction(float resolution, bool generateColor, bool spaceClearing, int minNumVertices,
                                       UpdateMethod updateMethod)
        {
            IntPtr config = API.Tango3DR_Config_create((int)APIConfigType.Context);
            API.Tango3DR_Config_setDouble(config, "resolution", resolution);
            API.Tango3DR_Config_setBool(config, "generate_color", generateColor);
            API.Tango3DR_Config_setBool(config, "use_space_clearing", spaceClearing);
            API.Tango3DR_Config_setInt32(config, "min_num_vertices", minNumVertices);
            API.Tango3DR_Config_setInt32(config, "update_method", (int)updateMethod);

            // The 3D Reconstruction library can not handle a left handed transformation during update.  Instead,
            // transform into the Unity world space via the external_T_tango config.
            APIMatrix3x3 unityWorld_T_startService = new APIMatrix3x3();
            unityWorld_T_startService.SetRow(0, new Vector3(1, 0, 0));
            unityWorld_T_startService.SetRow(1, new Vector3(0, 0, 1));
            unityWorld_T_startService.SetRow(2, new Vector3(0, 1, 0));
            API.Tango3DR_Config_setMatrix3x3(config, "external_T_tango", ref unityWorld_T_startService);
            API.Tango3DR_Config_setBool(config, "use_clockwise_winding_order", true);

            m_context = API.Tango3DR_create(config);
            API.Tango3DR_Config_destroy(config);
        }
コード例 #8
0
 public static extern int Tango3DR_Config_getMatrix3x3(IntPtr config, string key, out APIMatrix3x3 value);