Ejemplo n.º 1
0
        protected static ColliderSliceResult PrepareSliceCollider(Vector3 locPos, Collider collider, Mesh mesh, Plane plane)
        {
            var result = new ColliderSliceResult();
            IBzSliceAddapter    adapter       = new BzSliceColliderAddapter(mesh.vertices, collider.gameObject);
            BzMeshDataDissector meshDissector = new BzMeshDataDissector(mesh, plane, null, adapter, null);

            result.SliceResult      = SliceResult.Sliced;
            result.OriginalCollider = collider;
            result.meshDissector    = meshDissector;

            return(result);
        }
Ejemplo n.º 2
0
        private ColliderSliceResult TrySliceCollider(Vector3 locPos, Collider collider, Mesh mesh, Plane plane)
        {
            IBzSliceAddapter    adapter       = new BzSliceColliderAddapter(mesh.vertices, collider.gameObject);
            BzMeshDataDissector meshDissector = new BzMeshDataDissector(mesh, plane, null, adapter, null);

            ColliderSliceResult result = new ColliderSliceResult();

            result.OriginalCollider = collider;
            result.MeshDissector    = meshDissector;
            result.SliceResult      = meshDissector.Slice();

            return(result);
        }