示例#1
0
        static public void SplitByZ(this Bounds item, float z, out Bounds near, out Bounds far)
        {
            float split = z.Min(item.max.z);

            near = BoundsExtensions.CreateStrictMinMaxBounds(item.min, item.max.GetWithZ(split));
            far  = BoundsExtensions.CreateStrictMinMaxBounds(item.min.GetWithZ(split), item.max);
        }
示例#2
0
        static public void SplitByY(this Bounds item, float y, out Bounds bottom, out Bounds top)
        {
            float split = y.Min(item.max.y);

            bottom = BoundsExtensions.CreateStrictMinMaxBounds(item.min, item.max.GetWithY(split));
            top    = BoundsExtensions.CreateStrictMinMaxBounds(item.min.GetWithY(split), item.max);
        }
示例#3
0
        static public void SplitByX(this Bounds item, float x, out Bounds left, out Bounds right)
        {
            float split = x.Min(item.max.x);

            left  = BoundsExtensions.CreateStrictMinMaxBounds(item.min, item.max.GetWithX(split));
            right = BoundsExtensions.CreateStrictMinMaxBounds(item.min.GetWithX(split), item.max);
        }
示例#4
0
        static public Bounds GetOverflownAreaGridChunk(this Bounds item, int x, int y, Vector2 cell_size)
        {
            Vector2 point1 = item.min.GetArear() + new Vector2(x, y).GetComponentMultiply(cell_size);
            Vector2 point2 = point1 + cell_size;

            return(BoundsExtensions.CreateMinMaxAreaBounds(point1, point2, item.size.y, item.min.y));
        }
示例#5
0
        protected override void GenerateBoxWadInternal()
        {
            Bounds bounds        = GetMeshCollider().bounds;
            float  strata_height = bounds.size.y / strata_divisions;

            for (float y = bounds.min.y; y < bounds.max.y; y += strata_height)
            {
                Bounds strata = BoundsExtensions.CreateMinMaxBounds(
                    bounds.min.GetWithY(y),
                    bounds.max.GetWithY(y + strata_height)
                    );

                if (Fill(strata, depth) == NonConvexColliderFillResponse.RequestFill)
                {
                    AddWadBox(strata);
                }
            }
        }
示例#6
0
        protected override void GenerateBoxWadInternal()
        {
            Bounds bounds = GetMeshCollider().bounds;

            for (float y = bounds.min.y; y < bounds.max.y; y += size)
            {
                for (float x = bounds.min.x; x < bounds.max.x; x += size)
                {
                    for (float z = bounds.min.z; z < bounds.max.z; z += size)
                    {
                        Bounds b = BoundsExtensions.CreateMinMaxBounds(
                            new Vector3(x, y, z),
                            new Vector3(x + size, y + size, z + size)
                            );

                        if (PhysicsExtensions.OverlapBox(b).Has(GetMeshCollider()))
                        {
                            AddWadBox(b);
                        }
                    }
                }
            }
        }
示例#7
0
 static public Bounds GetBounds(this Face item)
 {
     return(BoundsExtensions.CreateMinMaxBounds(item.v0, item.v1));
 }
示例#8
0
 static public Bounds GetBounds(this Triangle2 item)
 {
     return(BoundsExtensions.CreateWithPoints(item.GetPoints().GetSpacar()));
 }