Ejemplo n.º 1
0
        /// <summary>
        ///     Gets the volume.
        /// </summary>
        /// <returns>The volume.</returns>
        /// <param name="mesh">Mesh.</param>
        public static float GetVolume(Mesh mesh)
        {
            float volume = 0.0f;

            ToTriangles(mesh, ref s_VolumeTriangles);

            for (int index = 0; index < s_VolumeTriangles.Length; index++)
            {
                volume += s_VolumeTriangles[index].SignedVolume();
            }

            return(HydraMathUtils.Abs(volume));
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Takes the magnitude of each channel once subtracted.
 /// </summary>
 /// <returns>The difference.</returns>
 /// <param name="baseLayer">Base layer.</param>
 /// <param name="topLayer">Top layer.</param>
 public static Color BlendDifference(Color baseLayer, Color topLayer)
 {
     return(new Color(HydraMathUtils.Abs(baseLayer.r - topLayer.r), HydraMathUtils.Abs(baseLayer.g - topLayer.g),
                      HydraMathUtils.Abs(baseLayer.b - topLayer.b), HydraMathUtils.Abs(baseLayer.a - topLayer.a)));
 }