コード例 #1
0
        /// <summary>
        /// Determines whether the specified <see cref="MaterialPalette"/> is equal to the current <see cref="UFLT.Records.MaterialPalette"/>.
        /// </summary>
        /// <param name='other'>
        /// The <see cref="MaterialPalette"/> to compare with the current <see cref="UFLT.Records.MaterialPalette"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="MaterialPalette"/> is equal to the current
        /// <see cref="UFLT.Records.MaterialPalette"/>; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(MaterialPalette other)
        {
            // Check color fields
            if (!Ambient.Equals(other.Ambient))
            {
                return(false);
            }
            if (!Diffuse.Equals(other.Diffuse))
            {
                return(false);
            }
            if (!Specular.Equals(other.Specular))
            {
                return(false);
            }
            if (!Emissive.Equals(other.Emissive))
            {
                return(false);
            }

            if (Mathf.Approximately(Shininess, other.Shininess))
            {
                return(false);
            }
            if (Mathf.Approximately(Alpha, other.Alpha))
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
 public bool Equals(Material other)
 {
     return(Color.Equals(other.Color) &&
            Ambient.Equals(other.Ambient) &&
            Diffuse.Equals(other.Diffuse) &&
            Specular.Equals(other.Specular) &&
            Shininess.Equals(other.Shininess));
 }
コード例 #3
0
ファイル: Lighting.cs プロジェクト: valu8/Plotly.Blazor
        /// <inheritdoc />
        public bool Equals([AllowNull] Lighting other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     VertexNormalsEpsilon == other.VertexNormalsEpsilon ||
                     VertexNormalsEpsilon != null &&
                     VertexNormalsEpsilon.Equals(other.VertexNormalsEpsilon)
                     ) &&
                 (
                     FaceNormalsEpsilon == other.FaceNormalsEpsilon ||
                     FaceNormalsEpsilon != null &&
                     FaceNormalsEpsilon.Equals(other.FaceNormalsEpsilon)
                 ) &&
                 (
                     Ambient == other.Ambient ||
                     Ambient != null &&
                     Ambient.Equals(other.Ambient)
                 ) &&
                 (
                     Diffuse == other.Diffuse ||
                     Diffuse != null &&
                     Diffuse.Equals(other.Diffuse)
                 ) &&
                 (
                     Specular == other.Specular ||
                     Specular != null &&
                     Specular.Equals(other.Specular)
                 ) &&
                 (
                     Roughness == other.Roughness ||
                     Roughness != null &&
                     Roughness.Equals(other.Roughness)
                 ) &&
                 (
                     Fresnel == other.Fresnel ||
                     Fresnel != null &&
                     Fresnel.Equals(other.Fresnel)
                 ));
        }
コード例 #4
0
        public bool Equals([AllowNull] Lighting other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Ambient == other.Ambient && Ambient != null && other.Ambient != null && Ambient.Equals(other.Ambient)) &&
                   (Diffuse == other.Diffuse && Diffuse != null && other.Diffuse != null && Diffuse.Equals(other.Diffuse)) &&
                   (Specular == other.Specular && Specular != null && other.Specular != null && Specular.Equals(other.Specular)) &&
                   (Roughness == other.Roughness && Roughness != null && other.Roughness != null && Roughness.Equals(other.Roughness)) &&
                   (Fresnel == other.Fresnel && Fresnel != null && other.Fresnel != null && Fresnel.Equals(other.Fresnel)));
        }
コード例 #5
0
ファイル: Material.cs プロジェクト: KallDrexx/ray-tracer
 protected bool Equals(Material other)
 {
     return(Equals(Pattern, other.Pattern) && Ambient.Equals(other.Ambient) && Diffuse.Equals(other.Diffuse) && Specular.Equals(other.Specular) && Shininess == other.Shininess && Reflective.Equals(other.Reflective));
 }