Exemple #1
0
        internal void Create(ref Vector3[] boundsCorners, Transform parent, bool isFlattened)
        {
            // create corners
            for (int i = 0; i < boundsCorners.Length; ++i)
            {
                GameObject corner = new GameObject
                {
                    name = "corner_" + i.ToString()
                };
                corner.transform.parent        = parent;
                corner.transform.localPosition = boundsCorners[i];

                GameObject visualsScale = new GameObject();
                visualsScale.name                    = "visualsScale";
                visualsScale.transform.parent        = corner.transform;
                visualsScale.transform.localPosition = Vector3.zero;

                // Compute mirroring scale
                {
                    Vector3 p = boundsCorners[i];
                    visualsScale.transform.localScale = new Vector3(Mathf.Sign(p[0]), Mathf.Sign(p[1]), Mathf.Sign(p[2]));
                }

                Bounds visualBounds = CreateVisual(visualsScale, isFlattened);
                var    invScale     = visualBounds.size.x == 0.0f ? 0.0f : config.HandleSize / visualBounds.size.x;
                VisualUtils.AddComponentsToAffordance(corner, new Bounds(visualBounds.center * invScale, visualBounds.size * invScale),
                                                      HandlePrefabCollider.Box, CursorContextInfo.CursorAction.Scale, config.ColliderPadding, parent, config.DrawTetherWhenManipulating);
                handles.Add(corner.transform);
            }

            VisualUtils.HandleIgnoreCollider(config.HandlesIgnoreCollider, handles);
            objectsChangedEvent.Invoke(this);
        }
        private void ScaleObject(ProximityState state, Transform scaleVisual, float objectSize, bool lerp = false)
        {
            float targetScale = 1.0f, weight = 0.0f;

            switch (state)
            {
            case ProximityState.FullsizeNoProximity:
                targetScale = config.FarScale;
                weight      = lerp ? config.FarGrowRate : 1.0f;
                break;

            case ProximityState.MediumProximity:
                targetScale = config.MediumScale;
                weight      = lerp ? config.MediumGrowRate : 1.0f;
                break;

            case ProximityState.CloseProximity:
                targetScale = config.CloseScale;
                weight      = lerp ? config.CloseGrowRate : 1.0f;
                break;
            }

            float maxScaleAxis  = VisualUtils.GetMaxComponent(scaleVisual.localScale);
            float newLocalScale = (maxScaleAxis * (1.0f - weight)) + (objectSize * targetScale * weight);

            scaleVisual.localScale = new Vector3(newLocalScale, newLocalScale, newLocalScale);
        }
Exemple #3
0
 private void TrySetDefaultMaterial()
 {
     if (wireframeMaterial == null)
     {
         wireframeMaterial = VisualUtils.CreateDefaultMaterial();
     }
 }
 protected void UpdateColliderBounds()
 {
     foreach (var handle in handles)
     {
         var handleBounds = VisualUtils.GetMaxBounds(GetVisual(handle).gameObject);
         UpdateColliderBounds(handle, handleBounds.size);
     }
 }
Exemple #5
0
 internal void SetHighlighted()
 {
     // Update the box material to the grabbed material
     if (boxDisplay != null)
     {
         VisualUtils.ApplyMaterialToAllRenderers(boxDisplay, config.BoxGrabbedMaterial);
     }
 }
Exemple #6
0
        private Vector3 GetBoxDisplayScale(Vector3 currentBoundsExtents, FlattenModeType flattenAxis)
        {
            // When a box is flattened one axis is normally scaled to zero, this doesn't always work well with visuals so we take
            // that flattened axis and re-scale it to the flattenAxisDisplayScale.
            Vector3 displayScale = VisualUtils.FlattenBounds(currentBoundsExtents, flattenAxis, config.FlattenAxisDisplayScale);

            return(2.0f * displayScale);
        }
Exemple #7
0
 internal void UpdateLinkPositions(ref Vector3[] boundsCorners)
 {
     if (boundsCorners != null)
     {
         for (int i = 0; i < links.Count; ++i)
         {
             links[i].transform.position = VisualUtils.GetLinkPosition(i, ref boundsCorners);
         }
     }
 }
Exemple #8
0
 /// <inheritdoc/>
 internal override void CalculateHandlePositions(ref Vector3[] boundsCorners)
 {
     if (boundsCorners != null && HandlePositions != null)
     {
         for (int i = 0; i < HandlePositions.Length; ++i)
         {
             HandlePositions[i] = VisualUtils.GetLinkPosition(i, ref boundsCorners);
         }
         UpdateHandles();
     }
 }
Exemple #9
0
        internal void CreateLinks(ref Vector3[] boundsCorners, Transform parent, Vector3 currentBoundsExtents)
        {
            // create links
            if (links != null)
            {
                GameObject link;
                Vector3    linkDimensions = GetLinkDimensions(currentBoundsExtents);
                for (int i = 0; i < VisualUtils.EdgeAxisType.Length; ++i)
                {
                    if (config.WireframeShape == WireframeType.Cubic)
                    {
                        link = GameObject.CreatePrimitive(PrimitiveType.Cube);
                        Object.Destroy(link.GetComponent <BoxCollider>());
                    }
                    else
                    {
                        link = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
                        Object.Destroy(link.GetComponent <CapsuleCollider>());
                    }
                    link.name = "link_" + i.ToString();

                    CardinalAxisType axisType            = VisualUtils.EdgeAxisType[i];
                    float            wireframeEdgeRadius = config.WireframeEdgeRadius;
                    if (axisType == CardinalAxisType.Y)
                    {
                        link.transform.localScale = new Vector3(wireframeEdgeRadius, linkDimensions.y, wireframeEdgeRadius);
                        link.transform.Rotate(new Vector3(0.0f, 90.0f, 0.0f));
                    }
                    else if (axisType == CardinalAxisType.Z)
                    {
                        link.transform.localScale = new Vector3(wireframeEdgeRadius, linkDimensions.z, wireframeEdgeRadius);
                        link.transform.Rotate(new Vector3(90.0f, 0.0f, 0.0f));
                    }
                    else//X
                    {
                        link.transform.localScale = new Vector3(wireframeEdgeRadius, linkDimensions.x, wireframeEdgeRadius);
                        link.transform.Rotate(new Vector3(0.0f, 0.0f, 90.0f));
                    }

                    link.transform.position = VisualUtils.GetLinkPosition(i, ref boundsCorners);
                    link.transform.parent   = parent;
                    Renderer linkRenderer = link.GetComponent <Renderer>();

                    if (config.WireframeMaterial != null)
                    {
                        linkRenderer.material = config.WireframeMaterial;
                    }

                    link.SetActive(config.ShowWireFrame);
                    links.Add(new Link(link.transform, axisType));
                }
            }
        }
 protected void UpdateBaseMaterial()
 {
     if (handles != null)
     {
         for (int i = 0; i < handles.Count; ++i)
         {
             if (handles[i] != highlightedHandle)
             {
                 VisualUtils.ApplyMaterialToAllRenderers(handles[i].gameObject, BaseConfig.HandleMaterial);
             }
         }
     }
 }
Exemple #11
0
        protected override void UpdateColliderBounds(Transform handle, Vector3 visualSize)
        {
            float maxDim   = VisualUtils.GetMaxComponent(visualSize);
            float invScale = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;

            GetVisual(handle).transform.localScale = new Vector3(invScale, invScale, invScale);
            BoxCollider collider     = handle.gameObject.GetComponent <BoxCollider>();
            Vector3     colliderSize = visualSize * invScale;

            collider.size   = colliderSize;
            collider.size  += BaseConfig.ColliderPadding;
            collider.center = Vector3.zero;
        }
Exemple #12
0
 internal void Reset(bool visible)
 {
     isVisible = visible;
     // Set box display visibility
     if (boxDisplay != null)
     {
         bool activate = config.BoxMaterial != null && isVisible; // only set active if material is set
         boxDisplay.SetActive(activate);
         if (activate)
         {
             VisualUtils.ApplyMaterialToAllRenderers(boxDisplay, config.BoxMaterial);
         }
     }
 }
Exemple #13
0
        /// <summary>
        /// Creates the corner visual and returns the bounds of the created visual
        /// </summary>
        /// <param name="parent">parent of visual</param>
        /// <param name="isFlattened">instantiate in flattened mode - slate</param>
        /// <returns>bounds of the created visual</returns>
        private Bounds CreateVisual(GameObject parent, bool isFlattened)
        {
            // figure out which prefab to instantiate
            GameObject cornerVisual = null;

            areHandlesFlattened = isFlattened;
            GameObject prefabType = isFlattened ? config.HandleSlatePrefab : config.HandlePrefab;

            if (prefabType == null)
            {
                // instantiate default prefab, a cube with box collider
                cornerVisual = GameObject.CreatePrimitive(PrimitiveType.Cube);
                cornerVisual.transform.parent        = parent.transform;
                cornerVisual.transform.localPosition = Vector3.zero;
                // deactivate collider on visuals and register for deletion - actual collider
                // of handle is attached to the handle gameobject, not the visual
                var collider = cornerVisual.GetComponent <BoxCollider>();
                collider.enabled = false;
                Object.Destroy(collider);
            }
            else
            {
                cornerVisual = GameObject.Instantiate(prefabType, parent.transform);
            }

            if (isFlattened)
            {
                // Rotate 2D slate handle asset for proper orientation
                cornerVisual.transform.Rotate(0, 0, -90);
            }

            cornerVisual.name = visualsName;

            // this is the size of the corner visuals
            var   cornerbounds = VisualUtils.GetMaxBounds(cornerVisual);
            float maxDim       = Mathf.Max(Mathf.Max(cornerbounds.size.x, cornerbounds.size.y), cornerbounds.size.z);

            cornerbounds.size = maxDim * Vector3.one;

            // we need to multiply by this amount to get to desired scale handle size
            var invScale = cornerbounds.size.x == 0.0f ? 0.0f : config.HandleSize / cornerbounds.size.x;

            cornerVisual.transform.localScale = new Vector3(invScale, invScale, invScale);

            VisualUtils.ApplyMaterialToAllRenderers(cornerVisual, config.HandleMaterial);

            return(cornerbounds);
        }
        private void UpdateColliderType()
        {
            foreach (var handle in handles)
            {
                // remove old colliders
                bool shouldCreateNewCollider = false;
                var  oldBoxCollider          = handle.GetComponent <BoxCollider>();

                // Caution, Destroy() will destroy one frame later.
                // Do not check later for presence this frame!
                if (oldBoxCollider != null && config.HandlePrefabColliderType == HandlePrefabCollider.Sphere)
                {
                    shouldCreateNewCollider = true;
                    Object.Destroy(oldBoxCollider);
                }

                var oldSphereCollider = handle.GetComponent <SphereCollider>();
                if (oldSphereCollider != null && config.HandlePrefabColliderType == HandlePrefabCollider.Box)
                {
                    shouldCreateNewCollider = true;
                    Object.Destroy(oldSphereCollider);
                }

                if (shouldCreateNewCollider)
                {
                    // attach new collider
                    var     handleBounds         = VisualUtils.GetMaxBounds(GetVisual(handle).gameObject);
                    float   maxDim               = VisualUtils.GetMaxComponent(handleBounds.size);
                    float   invScale             = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;
                    Vector3 colliderSizeScaled   = handleBounds.size * invScale;
                    Vector3 colliderCenterScaled = handleBounds.center * invScale;
                    if (config.HandlePrefabColliderType == HandlePrefabCollider.Box)
                    {
                        BoxCollider collider = handle.gameObject.AddComponent <BoxCollider>();
                        collider.size   = colliderSizeScaled;
                        collider.center = colliderCenterScaled;
                        collider.size  += config.ColliderPadding;
                    }
                    else
                    {
                        SphereCollider sphere = handle.gameObject.AddComponent <SphereCollider>();
                        sphere.center  = colliderCenterScaled;
                        sphere.radius  = VisualUtils.GetMaxComponent(colliderSizeScaled) * 0.5f;
                        sphere.radius += VisualUtils.GetMaxComponent(config.ColliderPadding);
                    }
                }
            }
        }
 protected void ResetHandles()
 {
     if (handles != null)
     {
         for (int i = 0; i < handles.Count; ++i)
         {
             bool isVisible = IsVisible(handles[i]);
             handles[i].gameObject.SetActive(isVisible);
             if (isVisible)
             {
                 VisualUtils.ApplyMaterialToAllRenderers(handles[i].gameObject, BaseConfig.HandleMaterial);
             }
         }
     }
     highlightedHandle = null;
 }
 internal void Reset(bool areHandlesActive, FlattenModeType flattenAxis)
 {
     IsActive = areHandlesActive;
     ResetHandles();
     if (IsActive && handleAxes.Length == handles.Count)
     {
         List <int> flattenedHandles = VisualUtils.GetFlattenedIndices(flattenAxis, handleAxes);
         if (flattenedHandles != null)
         {
             for (int i = 0; i < flattenedHandles.Count; ++i)
             {
                 handles[flattenedHandles[i]].gameObject.SetActive(false);
             }
         }
     }
 }
        /// <summary>
        /// Creates the corner visual and returns the bounds of the created visual
        /// </summary>
        /// <param name="handleIndex">cornerIndex</param>
        /// <param name="parent">parent of visual</param>
        /// <param name="isFlattened">instantiate in flattened mode - slate</param>
        /// <returns>bounds of the created visual</returns>
        private Bounds CreateVisual(int handleIndex, GameObject parent, bool isFlattened)
        {
            // figure out which prefab to instantiate
            GameObject handleVisual = null;

            areHandlesFlattened = isFlattened;
            GameObject prefabType = isFlattened ? config.HandleSlatePrefab : config.HandlePrefab;

            if (prefabType == null)
            {
                // instantiate default prefab, a cube with box collider
                handleVisual = GameObject.CreatePrimitive(PrimitiveType.Cube);

                // deactivate collider on visuals and register for deletion - actual collider
                // of handle is attached to the handle gameobject, not the visual
                var collider = handleVisual.GetComponent <BoxCollider>();
                collider.enabled = false;
                UnityEngine.Object.Destroy(collider);
            }
            else
            {
                handleVisual = GameObject.Instantiate(prefabType, parent.transform);
            }

            // this is the size of the corner visuals
            var   handleVisualBounds = VisualUtils.GetMaxBounds(handleVisual);
            float maxDim             = VisualUtils.GetMaxComponent(handleVisualBounds.size);
            float invScale           = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;

            handleVisual.name                    = visualsName;
            handleVisual.transform.parent        = parent.transform;
            handleVisual.transform.localScale    = new Vector3(invScale, invScale, invScale);
            handleVisual.transform.localPosition = Vector3.zero;
            handleVisual.transform.localRotation = Quaternion.identity;


            Quaternion realignment = GetRotationRealignment(handleIndex, isFlattened);

            parent.transform.localRotation = realignment;

            if (config.HandleMaterial != null)
            {
                VisualUtils.ApplyMaterialToAllRenderers(handleVisual, config.HandleMaterial);
            }

            return(handleVisualBounds);
        }
        private Bounds CreateVisual(int handleIndex, GameObject parent)
        {
            GameObject handleVisual;
            GameObject prefabType = config.HandlePrefab;

            if (prefabType != null)
            {
                handleVisual = Object.Instantiate(prefabType);
            }
            else
            {
                handleVisual = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                // We only want the Primitive sphere mesh, but CreatePrimitive will
                // give us a sphere collider too. Remove the sphere collider here
                // so we can manually add our own properly configured collider later.
                var collider = handleVisual.GetComponent <SphereCollider>();
                collider.enabled = false;

                // Caution, Destroy() will destroy one frame later.
                // Do not check later for presence this frame!
                Object.Destroy(collider);
            }

            // handleVisualBounds are returned in handleVisual-local space.
            Bounds handleVisualBounds = VisualUtils.GetMaxBounds(handleVisual);
            float  maxDim             = VisualUtils.GetMaxComponent(handleVisualBounds.size);
            float  invScale           = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;

            handleVisual.name                    = visualsName;
            handleVisual.transform.parent        = parent.transform;
            handleVisual.transform.localScale    = new Vector3(invScale, invScale, invScale);
            handleVisual.transform.localPosition = Vector3.zero;
            handleVisual.transform.localRotation = Quaternion.identity;

            Quaternion realignment = GetRotationRealignment(handleIndex);

            parent.transform.localRotation = realignment;

            if (config.HandleMaterial != null)
            {
                VisualUtils.ApplyMaterialToAllRenderers(handleVisual, config.HandleMaterial);
            }

            return(handleVisualBounds);
        }
        private void UpdateColliderType()
        {
            foreach (var handle in handles)
            {
                // remove old colliders
                bool shouldCreateNewCollider = false;
                var  oldBoxCollider          = handle.GetComponent <BoxCollider>();
                if (oldBoxCollider != null && config.HandlePrefabColliderType == HandlePrefabCollider.Sphere)
                {
                    shouldCreateNewCollider = true;
                    Object.Destroy(oldBoxCollider);
                }

                var oldSphereCollider = handle.GetComponent <SphereCollider>();
                if (oldSphereCollider != null && config.HandlePrefabColliderType == HandlePrefabCollider.Box)
                {
                    shouldCreateNewCollider = true;
                    Object.Destroy(oldSphereCollider);
                }

                if (shouldCreateNewCollider)
                {
                    // attach new collider
                    var     handleBounds         = VisualUtils.GetMaxBounds(GetVisual(handle).gameObject);
                    var     invScale             = handleBounds.size.x == 0.0f ? 0.0f : config.HandleSize / handleBounds.size.x;
                    Vector3 colliderSizeScaled   = handleBounds.size * invScale;
                    Vector3 colliderCenterScaled = handleBounds.center * invScale;
                    if (config.HandlePrefabColliderType == HandlePrefabCollider.Box)
                    {
                        BoxCollider collider = handle.gameObject.AddComponent <BoxCollider>();
                        collider.size   = colliderSizeScaled;
                        collider.center = colliderCenterScaled;
                        collider.size  += config.ColliderPadding;
                    }
                    else
                    {
                        SphereCollider sphere = handle.gameObject.AddComponent <SphereCollider>();
                        sphere.center  = colliderCenterScaled;
                        sphere.radius  = colliderSizeScaled.x * 0.5f;
                        sphere.radius += VisualUtils.GetMaxComponent(config.ColliderPadding);
                    }
                }
            }
        }
 internal void SetHighlighted(Transform handleToHighlight, IMixedRealityPointer associatedPointer = null)
 {
     // turn off all handles that aren't the handle we want to highlight
     if (handles != null)
     {
         for (int i = 0; i < handles.Count; ++i)
         {
             if (handles[i] != handleToHighlight)
             {
                 handles[i].gameObject.SetActive(false);
             }
             else
             {
                 VisualUtils.ApplyMaterialToAllRenderers(handles[i].gameObject, BaseConfig.HandleGrabbedMaterial);
                 highlightedHandle = handleToHighlight;
             }
         }
     }
 }
        protected override void UpdateColliderBounds(Transform handle, Vector3 visualSize)
        {
            var invScale = visualSize.x == 0.0f ? 0.0f : config.HandleSize / visualSize.x;

            GetVisual(handle).transform.localScale = new Vector3(invScale, invScale, invScale);
            Vector3 colliderSizeScaled = visualSize * invScale;

            if (config.HandlePrefabColliderType == HandlePrefabCollider.Box)
            {
                BoxCollider collider = handle.gameObject.GetComponent <BoxCollider>();
                collider.size  = colliderSizeScaled;
                collider.size += BaseConfig.ColliderPadding;
            }
            else
            {
                SphereCollider collider = handle.gameObject.GetComponent <SphereCollider>();
                collider.radius  = colliderSizeScaled.x * 0.5f;
                collider.radius += VisualUtils.GetMaxComponent(config.ColliderPadding);
            }
        }
Exemple #22
0
        internal void Reset(bool isVisible, FlattenModeType flattenAxis)
        {
            cachedFlattenAxis = flattenAxis;
            if (links != null)
            {
                for (int i = 0; i < links.Count; ++i)
                {
                    links[i].transform.gameObject.SetActive(isVisible && config.ShowWireFrame);
                }

                List <int> flattenedHandles = VisualUtils.GetFlattenedIndices(cachedFlattenAxis, VisualUtils.EdgeAxisType);
                if (flattenedHandles != null)
                {
                    for (int i = 0; i < flattenedHandles.Count; ++i)
                    {
                        links[flattenedHandles[i]].transform.gameObject.SetActive(false);
                    }
                }
            }
        }
        private Bounds CreateVisual(int handleIndex, GameObject parent)
        {
            GameObject midpointVisual;
            GameObject prefabType = config.HandlePrefab;

            if (prefabType != null)
            {
                midpointVisual = Object.Instantiate(prefabType);
            }
            else
            {
                midpointVisual = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                // deactivate collider on visuals and register for deletion - actual collider
                // of handle is attached to the handle gameobject, not the visual
                var collider = midpointVisual.GetComponent <SphereCollider>();
                collider.enabled = false;
                Object.Destroy(collider);
            }

            Quaternion realignment = GetRotationRealignment(handleIndex);

            midpointVisual.transform.localRotation = realignment * midpointVisual.transform.localRotation;

            Bounds midpointBounds = VisualUtils.GetMaxBounds(midpointVisual);
            float  maxDim         = VisualUtils.GetMaxComponent(midpointBounds.size);
            float  invScale       = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;

            midpointVisual.name                    = visualsName;
            midpointVisual.transform.parent        = parent.transform;
            midpointVisual.transform.localScale    = new Vector3(invScale, invScale, invScale);
            midpointVisual.transform.localPosition = Vector3.zero;

            if (config.HandleMaterial != null)
            {
                VisualUtils.ApplyMaterialToAllRenderers(midpointVisual, config.HandleMaterial);
            }

            return(midpointBounds);
        }
        private void CreateHandles(Transform parent)
        {
            for (int i = 0; i < HandlePositions.Length; ++i)
            {
                GameObject handle = new GameObject();
                handle.name = HandlePositionDescription + "_" + i.ToString();
                handle.transform.position = HandlePositions[i];
                handle.transform.parent   = parent;

                Bounds midpointBounds = CreateVisual(i, handle);
                float  maxDim         = VisualUtils.GetMaxComponent(midpointBounds.size);
                float  invScale       = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;
                VisualUtils.AddComponentsToAffordance(handle, new Bounds(midpointBounds.center * invScale, midpointBounds.size * invScale),
                                                      config.HandlePrefabColliderType, CursorContextInfo.CursorAction.Rotate, config.ColliderPadding, parent, config.DrawTetherWhenManipulating);

                handles.Add(handle.transform);
            }

            VisualUtils.HandleIgnoreCollider(config.HandlesIgnoreCollider, handles);

            objectsChangedEvent.Invoke(this);
        }
        private Bounds CreateVisual(int handleIndex, GameObject parent)
        {
            GameObject midpointVisual;
            GameObject prefabType = config.HandlePrefab;

            if (prefabType != null)
            {
                midpointVisual = Object.Instantiate(prefabType);
            }
            else
            {
                midpointVisual = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                if (config.HandlePrefabColliderType != HandlePrefabCollider.Sphere)
                {
                    Object.Destroy(midpointVisual.GetComponent <SphereCollider>());
                }
            }

            Quaternion realignment = GetRotationRealignment(handleIndex);

            midpointVisual.transform.localRotation = realignment * midpointVisual.transform.localRotation;

            Bounds midpointBounds = VisualUtils.GetMaxBounds(midpointVisual);
            float  maxDim         = VisualUtils.GetMaxComponent(midpointBounds.size);
            float  invScale       = maxDim == 0.0f ? 0.0f : config.HandleSize / maxDim;

            midpointVisual.name                    = visualsName;
            midpointVisual.transform.parent        = parent.transform;
            midpointVisual.transform.localScale    = new Vector3(invScale, invScale, invScale);
            midpointVisual.transform.localPosition = Vector3.zero;

            if (config.HandleMaterial != null)
            {
                VisualUtils.ApplyMaterialToAllRenderers(midpointVisual, config.HandleMaterial);
            }

            return(midpointBounds);
        }
Exemple #26
0
        internal void Create(ref Vector3[] boundsCorners, Transform parent, bool isFlattened)
        {
            CalculateHandlePositions(ref boundsCorners);

            // create corners
            for (int i = 0; i < boundsCorners.Length; ++i)
            {
                GameObject corner = new GameObject
                {
                    name = "corner_" + i.ToString()
                };
                corner.transform.parent        = parent;
                corner.transform.localPosition = HandlePositions[i];

                Bounds visualBounds = CreateVisual(i, corner, isFlattened);
                var    invScale     = visualBounds.size.x == 0.0f ? 0.0f : config.HandleSize / visualBounds.size.x;
                VisualUtils.AddComponentsToAffordance(corner, new Bounds(visualBounds.center * invScale, visualBounds.size * invScale),
                                                      HandlePrefabCollider.Box, CursorContextInfo.CursorAction.Scale, config.ColliderPadding, parent, config.DrawTetherWhenManipulating);
                handles.Add(corner.transform);
            }

            VisualUtils.HandleIgnoreCollider(config.HandlesIgnoreCollider, handles);
            objectsChangedEvent.Invoke(this);
        }
 private void HandlesIgnoreConfigCollider(bool ignore)
 {
     VisualUtils.HandleIgnoreCollider(BaseConfig.HandlesIgnoreCollider, handles, ignore);
 }