/// <summary>
 /// Initialized and created the mesh
 /// </summary>
 /// <param name="plane"></param>
 public void Initialize(EazyARDetectedPlane plane)
 {
     detectedPlane         = plane;
     meshRenderer.material = detectedPlane.Direction == EazyARDetectedPlane.PlaneDirection.Horizontal ? EazyARCoreInterface.instance.detectedHorizontalPlanesMaterial : EazyARCoreInterface.instance.detectedVerticalPlanesMaterial;
     initialized           = true;
     Update();
 }
Exemple #2
0
        /// <summary>
        /// Creates the mesh of a detected plane in the environment
        /// </summary>
        /// <param name="detectedPlane"></param>
        /// <returns></returns>
        public static EazyARDetectedPlaneMesh CreateDetectedPlane(EazyARDetectedPlane detectedPlane)
        {
            //GameObject planeObject = Instantiate(instance.trackedPlanePrefab, Vector3.zero, Quaternion.identity, instance.transform);
            GameObject planeObject = new GameObject("DetectedPlane");

            planeObject.transform.position = Vector3.zero;
            planeObject.transform.rotation = Quaternion.identity;
            planeObject.transform.SetParent(instance.transform);

            EazyARDetectedPlaneMesh planeMesh = planeObject.AddComponent <EazyARDetectedPlaneMesh>();

            planeMesh.Initialize(detectedPlane);
            return(planeMesh);
        }
 public void Initialize(EazyARDetectedPlane plane)
 {
     detectedPlane           = plane;
     m_meshRenderer.material = material;
     Update();
 }