Esempio n. 1
0
        ///<summary>
        /// Blends the bounciness of the two materials together.
        ///</summary>
        ///<param name="materialA">First material of the pair.</param>
        ///<param name="materialB">Second material of the pair.</param>
        /// <param name="blender">Blender to use to blend the material properties.</param>
        ///<param name="blendedCoefficient">Blended bounciness coefficient.</param>
        public static void GetBounciness(Material materialA, Material materialB, PropertyBlender blender, out float blendedCoefficient)
        {
            InteractionProperties properties;

            if (materialA != null && materialB != null &&
                MaterialInteractions.TryGetValue(new MaterialPair(materialA, materialB), out properties))
            {
                blendedCoefficient = properties.Bounciness;
                return;
            }

            blendedCoefficient = blender(materialA.Bounciness, materialB.Bounciness, null);
        }
Esempio n. 2
0
 static WheelSlidingFriction()
 {
     DefaultSlidingFrictionBlender = new PropertyBlender(BlendFriction);
 }
Esempio n. 3
0
 static MaterialManager()
 {
     FrictionBlender = DefaultFrictionBlender;
     BouncinessBlender = DefaultBouncinessBlender;
     MaterialInteractions = new Dictionary<MaterialPair, InteractionProperties>();
 }
Esempio n. 4
0
        ///<summary>
        /// Blends the bounciness of the two materials together.
        ///</summary>
        ///<param name="materialA">First material of the pair.</param>
        ///<param name="materialB">Second material of the pair.</param>
        /// <param name="blender">Blender to use to blend the material properties.</param>
        ///<param name="blendedCoefficient">Blended bounciness coefficient.</param>
        public static void GetBounciness(Material materialA, Material materialB, PropertyBlender blender, out float blendedCoefficient)
        {
            InteractionProperties properties;
            if (materialA != null && materialB != null &&
                MaterialInteractions.TryGetValue(new MaterialPair(materialA, materialB), out properties))
            {
                blendedCoefficient = properties.Bounciness;
                return;
            }

            blendedCoefficient = blender(materialA.Bounciness, materialB.Bounciness, null);

        }
Esempio n. 5
0
 static WheelBrake()
 {
     DefaultRollingFrictionBlender = new PropertyBlender(BlendFriction);
 }
 static WheelSlidingFriction()
 {
     DefaultSlidingFrictionBlender = new PropertyBlender(BlendFriction);
 }
Esempio n. 7
0
 static WheelDrivingMotor()
 {
     DefaultGripFrictionBlender = new PropertyBlender(BlendFriction);
 }
Esempio n. 8
0
 static WheelBrake()
 {
     DefaultRollingFrictionBlender = new PropertyBlender(BlendFriction);
 }
Esempio n. 9
0
 static MaterialManager()
 {
     FrictionBlender      = DefaultFrictionBlender;
     BouncinessBlender    = DefaultBouncinessBlender;
     MaterialInteractions = new Dictionary <MaterialPair, InteractionProperties>();
 }
Esempio n. 10
0
 static WheelDrivingMotor()
 {
     DefaultGripFrictionBlender = new PropertyBlender(BlendFriction);
 }