Пример #1
0
    public QuadAABB(Vector3d[] AABB, Vector3d[] CullingAABB, Quad Quad, Transform OriginTransform = null)
    {
        this.AABB        = new Vector3d[AABB.Length];
        this.CullingAABB = new Vector3d[CullingAABB.Length];

        var Max = default(Vector3d);
        var Min = default(Vector3d);

        this.Bounds = Quad.GetBoundFromPoints(AABB, out Max, out Min);

        this.Min = Min;
        this.Max = Max;

        Array.Copy(AABB, this.AABB, 8);
        Array.Copy(CullingAABB, this.CullingAABB, 14);

        if (OriginTransform != null)
        {
            AABB.ForEach((point) => OriginTransform.TransformPoint(point));
            CullingAABB.ForEach((point) => OriginTransform.TransformPoint(point));
        }
    }