private void UpdateBoundsItem() { if (Children.Count == 2) { var transformAabb = TransformItem.GetAxisAlignedBoundingBox(); var fitAabb = FitBounds.GetAxisAlignedBoundingBox(); var fitSize = fitAabb.Size; if (boundsSize.X != 0 && boundsSize.Y != 0 && boundsSize.Z != 0 && (fitSize != boundsSize || fitAabb.Center != transformAabb.Center)) { FitBounds.Matrix *= Matrix4X4.CreateScale( boundsSize.X / fitSize.X, boundsSize.Y / fitSize.Y, boundsSize.Z / fitSize.Z); FitBounds.Matrix *= Matrix4X4.CreateTranslation( transformAabb.Center - FitBounds.GetAxisAlignedBoundingBox().Center); } } }