static public ChangeFlags Compare(SceneObjectPartPhysicsSummary first, SceneObjectPartPhysicsSummary second)
        {
            ChangeFlags flags = ChangeFlags.NoChange;

            if (first.NeedsPhysicsShape != second.NeedsPhysicsShape)
            {
                flags |= ChangeFlags.NeedsPhysicsShapeChanged;
            }

            if (first.NeedsDynamicActor != second.NeedsDynamicActor)
            {
                flags |= ChangeFlags.NeedsDynamicActorChanged;
            }

            if (first.IsPhantom != second.IsPhantom)
            {
                flags |= ChangeFlags.IsPhantomChanged;
            }

            if (first.IsVolumeDetect != second.IsVolumeDetect)
            {
                flags |= ChangeFlags.IsVolumeDetectChanged;
            }

            if (first.IsFlexi != second.IsFlexi)
            {
                flags |= ChangeFlags.IsFlexiChanged;
            }

            return flags;
        }
        static public ChangeFlags Compare(SceneObjectPartPhysicsSummary first, SceneObjectPartPhysicsSummary second)
        {
            ChangeFlags flags = ChangeFlags.NoChange;

            if (first.NeedsPhysicsShape != second.NeedsPhysicsShape)
            {
                flags |= ChangeFlags.NeedsPhysicsShapeChanged;
            }

            if (first.NeedsDynamicActor != second.NeedsDynamicActor)
            {
                flags |= ChangeFlags.NeedsDynamicActorChanged;
            }

            if (first.IsPhantom != second.IsPhantom)
            {
                flags |= ChangeFlags.IsPhantomChanged;
            }

            if (first.IsVolumeDetect != second.IsVolumeDetect)
            {
                flags |= ChangeFlags.IsVolumeDetectChanged;
            }

            if (first.IsFlexi != second.IsFlexi)
            {
                flags |= ChangeFlags.IsFlexiChanged;
            }

            return(flags);
        }
        static public SceneObjectPartPhysicsSummary SummaryFromParams(bool isFlexi, bool isAttachment,
                                                                      bool isVolumeDetect, bool isPhysical, bool isPhantom)
        {
            SceneObjectPartPhysicsSummary summary = new SceneObjectPartPhysicsSummary();

            summary.IsFlexi = isFlexi;

            if (isAttachment)
            {
                summary.IsVolumeDetect    = false;
                summary.NeedsDynamicActor = false;
                summary.IsPhantom         = true;
                summary.NeedsPhysicsShape = false;
            }
            else if (summary.IsFlexi)
            {
                summary.IsVolumeDetect    = false;
                summary.NeedsDynamicActor = false;
                summary.NeedsPhysicsShape = false;
                summary.IsPhantom         = true;
            }
            else if (isVolumeDetect)
            {
                //if VolumeDetection is set, the phantom flag is locally ignored
                summary.IsPhantom         = false;
                summary.NeedsDynamicActor = false;
                summary.NeedsPhysicsShape = true;
                summary.IsVolumeDetect    = true;
            }
            else
            {
                summary.NeedsDynamicActor = isPhysical;
                summary.IsPhantom         = isPhantom;
                summary.NeedsPhysicsShape = summary.NeedsDynamicActor || (!summary.IsPhantom && !isAttachment);
            }

            return(summary);
        }
        static public SceneObjectPartPhysicsSummary SummaryFromParams(bool isFlexi, bool isAttachment,
            bool isVolumeDetect, bool isPhysical, bool isPhantom)
        {
            SceneObjectPartPhysicsSummary summary = new SceneObjectPartPhysicsSummary();
            summary.IsFlexi = isFlexi;

            if (isAttachment)
            {
                summary.IsVolumeDetect = false;
                summary.NeedsDynamicActor = false;
                summary.IsPhantom = true;
                summary.NeedsPhysicsShape = false;
            }
            else if (summary.IsFlexi)
            {
                summary.IsVolumeDetect = false;
                summary.NeedsDynamicActor = false;
                summary.NeedsPhysicsShape = false;
                summary.IsPhantom = true;
            }
            else if (isVolumeDetect)
            {
                //if VolumeDetection is set, the phantom flag is locally ignored
                summary.IsPhantom = false;
                summary.NeedsDynamicActor = false;
                summary.NeedsPhysicsShape = true;
                summary.IsVolumeDetect = true;
            }
            else
            {
                summary.NeedsDynamicActor = isPhysical;
                summary.IsPhantom = isPhantom;
                summary.NeedsPhysicsShape = summary.NeedsDynamicActor || (!summary.IsPhantom && !isAttachment);
            }

            return summary;
        }