Example #1
0
        public ContactMaterial RestoreLocalDataFrom(agx.ContactMaterial contactMaterial)
        {
            YoungsModulus    = Convert.ToSingle(contactMaterial.getYoungsModulus());
            SurfaceViscosity = new Vector2(Convert.ToSingle(contactMaterial.getSurfaceViscosity(agx.ContactMaterial.FrictionDirection.PRIMARY_DIRECTION)),
                                           Convert.ToSingle(contactMaterial.getSurfaceViscosity(agx.ContactMaterial.FrictionDirection.SECONDARY_DIRECTION)));
            FrictionCoefficients = new Vector2(Convert.ToSingle(contactMaterial.getFrictionCoefficient(agx.ContactMaterial.FrictionDirection.PRIMARY_DIRECTION)),
                                               Convert.ToSingle(contactMaterial.getFrictionCoefficient(agx.ContactMaterial.FrictionDirection.SECONDARY_DIRECTION)));
            Restitution = Convert.ToSingle(contactMaterial.getRestitution());

            return(this);
        }
Example #2
0
        public ContactMaterial RestoreLocalDataFrom(agx.ContactMaterial contactMaterial)
        {
            YoungsModulus    = Convert.ToSingle(contactMaterial.getYoungsModulus());
            SurfaceViscosity = new Vector2(Convert.ToSingle(contactMaterial.getSurfaceViscosity(agx.ContactMaterial.FrictionDirection.PRIMARY_DIRECTION)),
                                           Convert.ToSingle(contactMaterial.getSurfaceViscosity(agx.ContactMaterial.FrictionDirection.SECONDARY_DIRECTION)));
            FrictionCoefficients = new Vector2(Convert.ToSingle(contactMaterial.getFrictionCoefficient(agx.ContactMaterial.FrictionDirection.PRIMARY_DIRECTION)),
                                               Convert.ToSingle(contactMaterial.getFrictionCoefficient(agx.ContactMaterial.FrictionDirection.SECONDARY_DIRECTION)));
            Restitution          = Convert.ToSingle(contactMaterial.getRestitution());
            Damping              = Convert.ToSingle(contactMaterial.getDamping());
            AdhesiveForce        = Convert.ToSingle(contactMaterial.getAdhesion());
            AdhesiveOverlap      = Convert.ToSingle(contactMaterial.getAdhesiveOverlap());
            UseContactArea       = contactMaterial.getUseContactAreaApproach();
            ContactReductionMode = (ContactReductionType)contactMaterial.getContactReductionMode();
            var binResolution = Convert.ToInt32(contactMaterial.getContactReductionBinResolution());

            ContactReductionLevel = binResolution == 3 ? ContactReductionLevelType.Minimal :
                                    binResolution == 2 ? ContactReductionLevelType.Moderate :
                                    ContactReductionLevelType.Aggressive;

            return(this);
        }