コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CompositeMaterial"/> class.
        /// </summary>
        /// <param name="defaultMaterial">The default material.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="defaultMaterial"/> is <see langword="null"/>.
        /// </exception>
        public CompositeMaterial(UniformMaterial defaultMaterial)
        {
            if (defaultMaterial == null)
            {
                throw new ArgumentNullException("defaultMaterial");
            }

            DefaultMaterial = defaultMaterial;
            Materials       = new List <UniformMaterial>();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UniformMaterial"/> class from a given material.
        /// </summary>
        /// <param name="material">The material from which the properties are copied.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="material"/> is <see langword="null"/>.
        /// </exception>
        public UniformMaterial(UniformMaterial material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            Name                  = material.Name;
            DynamicFriction       = material.DynamicFriction;
            StaticFriction        = material.StaticFriction;
            Restitution           = material.Restitution;
            SupportsSurfaceMotion = material.SupportsSurfaceMotion;
            _surfaceMotion        = material.SurfaceMotion;
        }