Example #1
0
            static void DrawGizmoForGrid(MicroLightPlayAera manager, GizmoType gizmoType)
            {
                if (MicroLightManager.Instance.PlayAeraEditorDrawGrid)
                {
                    if (MicroLightManager.Instance.PlayAeraEditorSection > 0)
                    {
                        float distance01 = Vector3.Distance(manager.Corner0, manager.Corner1);
                        float distance12 = Vector3.Distance(manager.Corner1, manager.Corner2);
                        float distance23 = Vector3.Distance(manager.Corner2, manager.Corner3);
                        float distance03 = Vector3.Distance(manager.Corner0, manager.Corner3);

                        Vector3 direction01 = (manager.Corner1 - manager.Corner0).normalized;
                        Vector3 direction12 = (manager.Corner2 - manager.Corner1).normalized;
                        Vector3 direction32 = (manager.Corner2 - manager.Corner3).normalized;
                        Vector3 direction03 = (manager.Corner3 - manager.Corner0).normalized;

                        Gizmos.color = MicroLightManager.Instance.PlayAeraDrawGridColor;

                        //Vertical
                        for (int i = 0; i < MicroLightManager.Instance.PlayAeraEditorSection; i++)
                        {
                            Vector3 toppoint    = manager.Corner1 + (distance12 / MicroLightManager.Instance.PlayAeraEditorSection) * i * direction12;
                            Vector3 buttompoint = manager.Corner0 + (distance03 / MicroLightManager.Instance.PlayAeraEditorSection) * i * direction03;
                            Gizmos.DrawLine(toppoint, buttompoint);
                        }

                        //Horizontal
                        for (int i = 0; i < MicroLightManager.Instance.PlayAeraEditorSection; i++)
                        {
                            Vector3 leftpoint  = manager.Corner0 + (distance01 / MicroLightManager.Instance.PlayAeraEditorSection) * i * direction01;
                            Vector3 rightpoint = manager.Corner3 + (distance23 / MicroLightManager.Instance.PlayAeraEditorSection) * i * direction32;
                            Gizmos.DrawLine(leftpoint, rightpoint);
                        }
                    }


                    Gizmos.color = MicroLightManager.Instance.PlayAeraDrawGridOutlineColor;
                    Gizmos.DrawLine(manager.Corner0, manager.Corner1);
                    Gizmos.DrawLine(manager.Corner1, manager.Corner2);
                    Gizmos.DrawLine(manager.Corner2, manager.Corner3);
                    Gizmos.DrawLine(manager.Corner3, manager.Corner0);

                    Gizmos.color = Color.red;
                    Gizmos.DrawSphere(manager.Corner0, 0.01F);
                    Gizmos.color = Color.green;
                    Gizmos.DrawSphere(manager.Corner1, 0.01F);
                    Gizmos.color = Color.blue;
                    Gizmos.DrawSphere(manager.Corner2, 0.01F);
                    Gizmos.color = Color.cyan;
                    Gizmos.DrawSphere(manager.Corner3, 0.01F);
                }
            }
Example #2
0
        public void UpdateBindings()
        {
            //Get PlayAera Size by Native API
            mPlayAeraSize.mSurfaceSize              = MicroLightPlugin.HoloGraphicUtilities.GetPlayAeraSize();
            mPlayAeraSize.mTrapezoidRoomSize        = MicroLightPlugin.HoloGraphicUtilities.GetTrapezoidRoomSize();
            mPlayAeraSize.ProjectionFaceInclination = MicroLightPlugin.HoloGraphicUtilities.GetProjectionFaceInclination();

            switch (mProjectionMode)
            {
            case ProjectionMode.Surface:
            {
                //SurfacePlayAera

                if (LTypeRoomFrontPlayAera)
                {
                    DestroyImmediate(LTypeRoomFrontPlayAera.gameObject);
                    LTypeRoomFrontPlayAera = null;
                }
                if (LTypeRoomFloorPlayAera)
                {
                    DestroyImmediate(LTypeRoomFloorPlayAera.gameObject);
                    LTypeRoomFloorPlayAera = null;
                }
                if (TrapezoidRoomLeftPlayAera)
                {
                    DestroyImmediate(TrapezoidRoomLeftPlayAera.gameObject);
                    TrapezoidRoomLeftPlayAera = null;
                }
                if (TrapezoidRoomFrontPlayAera)
                {
                    DestroyImmediate(TrapezoidRoomFrontPlayAera.gameObject);
                    TrapezoidRoomFrontPlayAera = null;
                }
                if (TrapezoidRoomRightPlayAera)
                {
                    DestroyImmediate(TrapezoidRoomRightPlayAera.gameObject);
                    TrapezoidRoomRightPlayAera = null;
                }
                if (TrapezoidRoomFloorPlayAera)
                {
                    DestroyImmediate(TrapezoidRoomFloorPlayAera.gameObject);
                    TrapezoidRoomFloorPlayAera = null;
                }


                if (SurfacePlayAera == null)
                {
                    MicroLightPlayAera[] mTransformS = transform.GetComponentsInChildren <MicroLightPlayAera>();
                    for (int i = 0; i < mTransformS.Length; i++)
                    {
                        DestroyImmediate(mTransformS[i].gameObject);
                    }

                    SurfacePlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                    SurfacePlayAera.transform.parent = transform;
                    SurfacePlayAera.id = TrackingSpaceId.Surface;
                }
                if (SurfacePlayAera)
                {
                    SurfacePlayAera.transform.localPosition    = Vector3.zero;
                    SurfacePlayAera.transform.localEulerAngles = new Vector3(-mPlayAeraSize.ProjectionFaceInclination, 0, 0);
                    if (mPlayAeraSize.mSurfaceSize.x != 0 && mPlayAeraSize.mSurfaceSize.y != 0)
                    {
                        SurfacePlayAera.transform.localScale = new Vector3(mPlayAeraSize.mSurfaceSize.x, mPlayAeraSize.mSurfaceSize.y, mPlayAeraSize.mSurfaceSize.y);
                    }
                }

                if (mCameraRig && TempmProjectionMode != mProjectionMode)
                {
                    DestroyImmediate(mCameraRig.gameObject);
                }
                //mCameraRig
                if (mCameraRig == null)
                {
                    MicroLightCameraRig[] mTransformS = transform.GetComponentsInChildren <MicroLightCameraRig>();
                    for (int i = 0; i < mTransformS.Length; i++)
                    {
                        DestroyImmediate(mTransformS[i].gameObject);
                    }
                    mCameraRig = new GameObject("MicroLightCameraRig").AddComponent <MicroLightCameraRig>();

                    mCameraRig.transform.parent = transform;
                    mCameraRig.id = 0;
                    mCameraRig.transform.localPosition    = Vector3.zero;
                    mCameraRig.transform.localEulerAngles = Vector3.zero;
                    mCameraRig.transform.localScale       = Vector3.one;

                    MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpace").AddComponent <MicroLightTrackingSpace>();
                    mTrackingSpace.transform.parent = mCameraRig.transform;
                    mTrackingSpace.id = TrackingSpaceId.Surface;
                    mTrackingSpace.transform.localPosition    = Vector3.zero;
                    mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                    mTrackingSpace.transform.localScale       = Vector3.one;
                    mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                    MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                    mLeftEye.transform.parent           = mTrackingSpace.transform;
                    mLeftEye.mEyeTye                    = EyeTye.Left;
                    mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                    mLeftEye.transform.localEulerAngles = Vector3.zero;
                    mLeftEye.transform.localScale       = Vector3.one;
                    mTrackingSpace.LeftEye              = mLeftEye;

                    MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                    mRightEye.transform.parent           = mTrackingSpace.transform;
                    mRightEye.mEyeTye                    = EyeTye.Right;
                    mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                    mRightEye.transform.localEulerAngles = Vector3.zero;
                    mRightEye.transform.localScale       = Vector3.one;
                    mTrackingSpace.RightEye              = mRightEye;
                }
            }
            break;

            case ProjectionMode.LTypeRoom:
            {
                //PlayAera
                {
                    if (SurfacePlayAera)
                    {
                        DestroyImmediate(SurfacePlayAera.gameObject);
                        SurfacePlayAera = null;
                    }

                    if (TrapezoidRoomLeftPlayAera)
                    {
                        DestroyImmediate(TrapezoidRoomLeftPlayAera.gameObject);
                        TrapezoidRoomLeftPlayAera = null;
                    }
                    if (TrapezoidRoomFrontPlayAera)
                    {
                        DestroyImmediate(TrapezoidRoomFrontPlayAera.gameObject);
                        TrapezoidRoomFrontPlayAera = null;
                    }
                    if (TrapezoidRoomRightPlayAera)
                    {
                        DestroyImmediate(TrapezoidRoomRightPlayAera.gameObject);
                        TrapezoidRoomRightPlayAera = null;
                    }
                    if (TrapezoidRoomFloorPlayAera)
                    {
                        DestroyImmediate(TrapezoidRoomFloorPlayAera.gameObject);
                        TrapezoidRoomFloorPlayAera = null;
                    }

                    MicroLightPlayAera[] mTransformS = transform.GetComponentsInChildren <MicroLightPlayAera>();
                    for (int i = 0; i < mTransformS.Length; i++)
                    {
                        DestroyImmediate(mTransformS[i].gameObject);
                    }

                    if (LTypeRoomFrontPlayAera == null)
                    {
                        LTypeRoomFrontPlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                        LTypeRoomFrontPlayAera.transform.parent = transform;
                        LTypeRoomFrontPlayAera.id = TrackingSpaceId.LTypeRoomFront;
                        LTypeRoomFrontPlayAera.transform.localPosition    = Vector3.zero;
                        LTypeRoomFrontPlayAera.transform.localEulerAngles = new Vector3(-90, 0, 0);
                        if (mPlayAeraSize.mSurfaceSize.x != 0 && mPlayAeraSize.mSurfaceSize.y != 0)
                        {
                            LTypeRoomFrontPlayAera.transform.localScale = new Vector3(mPlayAeraSize.mSurfaceSize.x, mPlayAeraSize.mSurfaceSize.y, mPlayAeraSize.mSurfaceSize.y);
                        }
                    }
                    if (LTypeRoomFloorPlayAera == null)
                    {
                        LTypeRoomFloorPlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                        LTypeRoomFloorPlayAera.transform.parent = transform;
                        LTypeRoomFloorPlayAera.id = TrackingSpaceId.LTypeRoomFloor;
                        LTypeRoomFloorPlayAera.transform.localPosition    = new Vector3(0, -mPlayAeraSize.mSurfaceSize.y * 0.5f, -mPlayAeraSize.mSurfaceSize.y * 0.5f);
                        LTypeRoomFloorPlayAera.transform.localEulerAngles = Vector3.zero;
                        if (mPlayAeraSize.mSurfaceSize.x != 0 && mPlayAeraSize.mSurfaceSize.y != 0)
                        {
                            LTypeRoomFloorPlayAera.transform.localScale = new Vector3(mPlayAeraSize.mSurfaceSize.x, mPlayAeraSize.mSurfaceSize.y, mPlayAeraSize.mSurfaceSize.y);
                        }
                    }
                }

                if (mCameraRig && TempmProjectionMode != mProjectionMode)
                {
                    DestroyImmediate(mCameraRig.gameObject);
                }
                //mCameraRig
                if (mCameraRig == null)
                {
                    MicroLightCameraRig[] mTransformS = transform.GetComponentsInChildren <MicroLightCameraRig>();
                    for (int i = 0; i < mTransformS.Length; i++)
                    {
                        DestroyImmediate(mTransformS[i].gameObject);
                    }
                    mCameraRig = new GameObject("MicroLightCameraRig").AddComponent <MicroLightCameraRig>();

                    mCameraRig.transform.parent = transform;
                    mCameraRig.id = 0;
                    mCameraRig.transform.localPosition    = Vector3.zero;
                    mCameraRig.transform.localEulerAngles = Vector3.zero;
                    mCameraRig.transform.localScale       = Vector3.one;
                    //TrackingSpaceFront
                    {
                        MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpaceFront").AddComponent <MicroLightTrackingSpace>();
                        mTrackingSpace.transform.parent = mCameraRig.transform;
                        mTrackingSpace.id = TrackingSpaceId.LTypeRoomFront;
                        mTrackingSpace.transform.localPosition    = Vector3.zero;
                        mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                        mTrackingSpace.transform.localScale       = Vector3.one;
                        mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                        MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                        mLeftEye.transform.parent           = mTrackingSpace.transform;
                        mLeftEye.mEyeTye                    = EyeTye.Left;
                        mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                        mLeftEye.transform.localEulerAngles = Vector3.zero;
                        mLeftEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.LeftEye              = mLeftEye;

                        MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                        mRightEye.transform.parent           = mTrackingSpace.transform;
                        mRightEye.mEyeTye                    = EyeTye.Right;
                        mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                        mRightEye.transform.localEulerAngles = Vector3.zero;
                        mRightEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.RightEye              = mRightEye;
                    }
                    //TrackingSpaceFLoor
                    {
                        MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpaceFLoor").AddComponent <MicroLightTrackingSpace>();
                        mTrackingSpace.transform.parent = mCameraRig.transform;
                        mTrackingSpace.id = TrackingSpaceId.LTypeRoomFloor;
                        mTrackingSpace.transform.localPosition    = Vector3.zero;
                        mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                        mTrackingSpace.transform.localScale       = Vector3.one;
                        mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                        MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                        mLeftEye.transform.parent           = mTrackingSpace.transform;
                        mLeftEye.mEyeTye                    = EyeTye.Left;
                        mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                        mLeftEye.transform.localEulerAngles = Vector3.zero;
                        mLeftEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.LeftEye              = mLeftEye;

                        MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                        mRightEye.transform.parent           = mTrackingSpace.transform;
                        mRightEye.mEyeTye                    = EyeTye.Right;
                        mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                        mRightEye.transform.localEulerAngles = Vector3.zero;
                        mRightEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.RightEye              = mRightEye;
                    }
                }
            }
            break;

            case ProjectionMode.TrapezoidRoom:
            {
                {
                    if (SurfacePlayAera)
                    {
                        DestroyImmediate(SurfacePlayAera.gameObject);
                        SurfacePlayAera = null;
                    }
                    if (LTypeRoomFrontPlayAera)
                    {
                        DestroyImmediate(LTypeRoomFrontPlayAera.gameObject);
                        LTypeRoomFrontPlayAera = null;
                    }
                    if (LTypeRoomFloorPlayAera)
                    {
                        DestroyImmediate(LTypeRoomFloorPlayAera.gameObject);
                        LTypeRoomFloorPlayAera = null;
                    }


                    MicroLightPlayAera[] mTransformS = transform.GetComponentsInChildren <MicroLightPlayAera>();
                    for (int i = 0; i < mTransformS.Length; i++)
                    {
                        DestroyImmediate(mTransformS[i].gameObject);
                    }

                    if (TrapezoidRoomLeftPlayAera == null)
                    {
                        TrapezoidRoomLeftPlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                        TrapezoidRoomLeftPlayAera.transform.parent = transform;
                        TrapezoidRoomLeftPlayAera.id = TrackingSpaceId.TrapezoidRoomLeft;
                        float Angles = mPlayAeraSize.mTrapezoidRoomSize.IntersectionAngle - 90;
                        float x      = Mathf.Sin(Angles * Mathf.Deg2Rad) * mPlayAeraSize.mTrapezoidRoomSize.LeftWidth * 0.5f;
                        float z      = Mathf.Cos(Angles * Mathf.Deg2Rad) * mPlayAeraSize.mTrapezoidRoomSize.LeftWidth * 0.5f;
                        TrapezoidRoomLeftPlayAera.transform.localScale       = new Vector3(mPlayAeraSize.mTrapezoidRoomSize.LeftWidth, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight);
                        TrapezoidRoomLeftPlayAera.transform.localPosition    = new Vector3(-((x) + mPlayAeraSize.mTrapezoidRoomSize.FrontWidth * 0.5f), 0, -z);
                        TrapezoidRoomLeftPlayAera.transform.localEulerAngles = new Vector3(-90, -(90 - Angles), 0);
                    }
                    if (TrapezoidRoomFrontPlayAera == null)
                    {
                        TrapezoidRoomFrontPlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                        TrapezoidRoomFrontPlayAera.transform.parent = transform;
                        TrapezoidRoomFrontPlayAera.id = TrackingSpaceId.TrapezoidRoomFront;
                        TrapezoidRoomFrontPlayAera.transform.localPosition    = Vector3.zero;
                        TrapezoidRoomFrontPlayAera.transform.localEulerAngles = new Vector3(-90, 0, 0);
                        TrapezoidRoomFrontPlayAera.transform.localScale       = new Vector3(mPlayAeraSize.mTrapezoidRoomSize.FrontWidth, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight);
                    }
                    if (TrapezoidRoomRightPlayAera == null)
                    {
                        TrapezoidRoomRightPlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                        TrapezoidRoomRightPlayAera.transform.parent = transform;
                        TrapezoidRoomRightPlayAera.id = TrackingSpaceId.TrapezoidRoomRight;

                        float Angles = mPlayAeraSize.mTrapezoidRoomSize.IntersectionAngle - 90;
                        float x      = Mathf.Sin(Angles * Mathf.Deg2Rad) * mPlayAeraSize.mTrapezoidRoomSize.LeftWidth * 0.5f;
                        float z      = Mathf.Cos(Angles * Mathf.Deg2Rad) * mPlayAeraSize.mTrapezoidRoomSize.LeftWidth * 0.5f;
                        TrapezoidRoomRightPlayAera.transform.localScale       = new Vector3(mPlayAeraSize.mTrapezoidRoomSize.LeftWidth, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight);
                        TrapezoidRoomRightPlayAera.transform.localPosition    = new Vector3(((x) + mPlayAeraSize.mTrapezoidRoomSize.FrontWidth * 0.5f), 0, -z);
                        TrapezoidRoomRightPlayAera.transform.localEulerAngles = new Vector3(-90, (90 - Angles), 0);
                    }
                    if (TrapezoidRoomFloorPlayAera == null)
                    {
                        TrapezoidRoomFloorPlayAera = new GameObject("MicroLightPlayAera").AddComponent <MicroLightPlayAera>();

                        TrapezoidRoomFloorPlayAera.transform.parent = transform;
                        TrapezoidRoomFloorPlayAera.id = TrackingSpaceId.TrapezoidRoomFloor;

                        float Angles = mPlayAeraSize.mTrapezoidRoomSize.IntersectionAngle - 90;
                        float x      = Mathf.Sin(Angles * Mathf.Deg2Rad) * mPlayAeraSize.mTrapezoidRoomSize.LeftWidth * 0.5f;
                        float z      = Mathf.Cos(Angles * Mathf.Deg2Rad) * mPlayAeraSize.mTrapezoidRoomSize.LeftWidth * 0.5f;

                        TrapezoidRoomFloorPlayAera.transform.localScale       = new Vector3(mPlayAeraSize.mTrapezoidRoomSize.LeftWidth + x * 4, mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight, z * 2);
                        TrapezoidRoomFloorPlayAera.transform.localPosition    = new Vector3(0, -mPlayAeraSize.mTrapezoidRoomSize.GlobalHeight * 0.5f, -z);
                        TrapezoidRoomFloorPlayAera.transform.localEulerAngles = new Vector3(0, 0, 0);
                    }
                }



                if (mCameraRig && TempmProjectionMode != mProjectionMode)
                {
                    DestroyImmediate(mCameraRig.gameObject);
                }
                //mCameraRig
                if (mCameraRig == null)
                {
                    MicroLightCameraRig[] mTransformS = transform.GetComponentsInChildren <MicroLightCameraRig>();
                    for (int i = 0; i < mTransformS.Length; i++)
                    {
                        DestroyImmediate(mTransformS[i].gameObject);
                    }
                    mCameraRig = new GameObject("MicroLightCameraRig").AddComponent <MicroLightCameraRig>();

                    mCameraRig.transform.parent = transform;
                    mCameraRig.id = 0;
                    mCameraRig.transform.localPosition    = Vector3.zero;
                    mCameraRig.transform.localEulerAngles = Vector3.zero;
                    mCameraRig.transform.localScale       = Vector3.one;
                    //TrackingSpaceLeft
                    {
                        MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpaceLeft").AddComponent <MicroLightTrackingSpace>();
                        mTrackingSpace.transform.parent = mCameraRig.transform;
                        mTrackingSpace.id = TrackingSpaceId.TrapezoidRoomLeft;
                        mTrackingSpace.transform.localPosition    = Vector3.zero;
                        mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                        mTrackingSpace.transform.localScale       = Vector3.one;
                        mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                        MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                        mLeftEye.transform.parent           = mTrackingSpace.transform;
                        mLeftEye.mEyeTye                    = EyeTye.Left;
                        mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                        mLeftEye.transform.localEulerAngles = Vector3.zero;
                        mLeftEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.LeftEye              = mLeftEye;

                        MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                        mRightEye.transform.parent           = mTrackingSpace.transform;
                        mRightEye.mEyeTye                    = EyeTye.Right;
                        mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                        mRightEye.transform.localEulerAngles = Vector3.zero;
                        mRightEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.RightEye              = mRightEye;
                    }

                    //TrackingSpaceFront
                    {
                        MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpaceFront").AddComponent <MicroLightTrackingSpace>();
                        mTrackingSpace.transform.parent = mCameraRig.transform;
                        mTrackingSpace.id = TrackingSpaceId.TrapezoidRoomFront;
                        mTrackingSpace.transform.localPosition    = Vector3.zero;
                        mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                        mTrackingSpace.transform.localScale       = Vector3.one;
                        mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                        MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                        mLeftEye.transform.parent           = mTrackingSpace.transform;
                        mLeftEye.mEyeTye                    = EyeTye.Left;
                        mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                        mLeftEye.transform.localEulerAngles = Vector3.zero;
                        mLeftEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.LeftEye              = mLeftEye;

                        MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                        mRightEye.transform.parent           = mTrackingSpace.transform;
                        mRightEye.mEyeTye                    = EyeTye.Right;
                        mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                        mRightEye.transform.localEulerAngles = Vector3.zero;
                        mRightEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.RightEye              = mRightEye;
                    }
                    //TrackingSpaceRight
                    {
                        MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpaceRight").AddComponent <MicroLightTrackingSpace>();
                        mTrackingSpace.transform.parent = mCameraRig.transform;
                        mTrackingSpace.id = TrackingSpaceId.TrapezoidRoomRight;
                        mTrackingSpace.transform.localPosition    = Vector3.zero;
                        mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                        mTrackingSpace.transform.localScale       = Vector3.one;
                        mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                        MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                        mLeftEye.transform.parent           = mTrackingSpace.transform;
                        mLeftEye.mEyeTye                    = EyeTye.Left;
                        mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                        mLeftEye.transform.localEulerAngles = Vector3.zero;
                        mLeftEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.LeftEye              = mLeftEye;

                        MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                        mRightEye.transform.parent           = mTrackingSpace.transform;
                        mRightEye.mEyeTye                    = EyeTye.Right;
                        mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                        mRightEye.transform.localEulerAngles = Vector3.zero;
                        mRightEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.RightEye              = mRightEye;
                    }
                    //TrackingSpaceFLoor
                    {
                        MicroLightTrackingSpace mTrackingSpace = new GameObject("TrackingSpaceFLoor").AddComponent <MicroLightTrackingSpace>();
                        mTrackingSpace.transform.parent = mCameraRig.transform;

                        mTrackingSpace.id = TrackingSpaceId.TrapezoidRoomFloor;
                        mTrackingSpace.transform.localPosition    = Vector3.zero;
                        mTrackingSpace.transform.localEulerAngles = Vector3.zero;
                        mTrackingSpace.transform.localScale       = Vector3.one;
                        mCameraRig.mTrackingSpaces.Add(mTrackingSpace);


                        MicroLightCamera mLeftEye = new GameObject("LeftEye").AddComponent <MicroLightCamera>();
                        mLeftEye.transform.parent           = mTrackingSpace.transform;
                        mLeftEye.mEyeTye                    = EyeTye.Left;
                        mLeftEye.transform.localPosition    = new Vector3(-PDI * 0.5F, 0, 0);
                        mLeftEye.transform.localEulerAngles = Vector3.zero;
                        mLeftEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.LeftEye              = mLeftEye;

                        MicroLightCamera mRightEye = new GameObject("RightEye").AddComponent <MicroLightCamera>();
                        mRightEye.transform.parent           = mTrackingSpace.transform;
                        mRightEye.mEyeTye                    = EyeTye.Right;
                        mRightEye.transform.localPosition    = new Vector3(PDI * 0.5F, 0, 0);
                        mRightEye.transform.localEulerAngles = Vector3.zero;
                        mRightEye.transform.localScale       = Vector3.one;
                        mTrackingSpace.RightEye              = mRightEye;
                    }
                }
            }

            break;
            }

            TempmProjectionMode = mProjectionMode;
        }