コード例 #1
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bool3x4(bool3 c0, bool3 c1, bool3 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = false;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = c2.z;
     this.m23 = false;
 }
コード例 #2
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
        /// <summary>
        /// Tries to convert the string representation of the vector into a vector representation (using a designated separator), returns false if string was invalid.
        /// </summary>
        public static bool TryParse(string s, string sep, out bool3 result)
        {
            result = Zero;
            if (string.IsNullOrEmpty(s))
            {
                return(false);
            }
            var kvp = s.Split(new[] { sep }, StringSplitOptions.None);

            if (kvp.Length != 3)
            {
                return(false);
            }
            bool x = false, y = false, z = false;
            var  ok = ((bool.TryParse(kvp[0].Trim(), out x) && bool.TryParse(kvp[1].Trim(), out y)) && bool.TryParse(kvp[2].Trim(), out z));

            result = ok ? new bool3(x, y, z) : Zero;
            return(ok);
        }
コード例 #3
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bool4x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = false;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = c2.z;
     this.m23 = false;
     this.m30 = c3.x;
     this.m31 = c3.y;
     this.m32 = c3.z;
     this.m33 = true;
 }
コード例 #4
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Not (!v).
 /// </summary>
 public static bool3 Not(bool3 v) => new bool3(!v.x, !v.y, !v.z);
コード例 #5
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bool3 NotEqual(bool lhs, bool3 rhs) => new bool3(lhs != rhs.x, lhs != rhs.y, lhs != rhs.z);
コード例 #6
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Nor (!(lhs || rhs)).
 /// </summary>
 public static bool3 Nor(bool3 lhs, bool rhs) => new bool3(!(lhs.x || rhs), !(lhs.y || rhs), !(lhs.z || rhs));
コード例 #7
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a string representation of this vector using a provided seperator and a format provider for each component.
 /// </summary>
 public static string ToString(bool3 v, string sep, IFormatProvider provider) => v.ToString(sep, provider);
コード例 #8
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Nand (!(lhs &amp;&amp; rhs)).
 /// </summary>
 public static bool3 Nand(bool3 lhs, bool rhs) => new bool3(!(lhs.x && rhs), !(lhs.y && rhs), !(lhs.z && rhs));
コード例 #9
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Or (lhs || rhs).
 /// </summary>
 public static bool3 Or(bool3 lhs, bool rhs) => new bool3(lhs.x || rhs, lhs.y || rhs, lhs.z || rhs);
コード例 #10
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bool3 NotEqual(bool3 lhs, bool3 rhs) => bool3.NotEqual(lhs, rhs);
コード例 #11
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Not (!v).
 /// </summary>
 public static bool3 Not(bool3 v) => bool3.Not(v);
コード例 #12
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode(bool3 v) => v.GetHashCode();
コード例 #13
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bool3 Equal(bool3 lhs, bool3 rhs) => bool3.Equal(lhs, rhs);
コード例 #14
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns true iff this equals rhs type- and component-wise.
 /// </summary>
 public static bool Equals(bool3 v, object obj) => v.Equals(obj);
コード例 #15
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals(bool3 v, bool3 rhs) => v.Equals(rhs);
コード例 #16
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns the number of components (3).
 /// </summary>
 public static int Count(bool3 v) => v.Count;
コード例 #17
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of And (lhs &amp;&amp; rhs).
 /// </summary>
 public static bool3 And(bool3 lhs, bool rhs) => new bool3(lhs.x && rhs, lhs.y && rhs, lhs.z && rhs);
コード例 #18
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public bool Equals(bool3 rhs) => ((x.Equals(rhs.x) && y.Equals(rhs.y)) && z.Equals(rhs.z));
コード例 #19
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of And (lhs &amp;&amp; rhs).
 /// </summary>
 public static bool3 And(bool lhs, bool3 rhs) => new bool3(lhs && rhs.x, lhs && rhs.y, lhs && rhs.z);
コード例 #20
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Tries to convert the string representation of the vector into a vector representation (using ', ' as a separator), returns false if string was invalid.
 /// </summary>
 public static bool TryParse(string s, out bool3 result) => TryParse(s, ", ", out result);
コード例 #21
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Nand (!(lhs &amp;&amp; rhs)).
 /// </summary>
 public static bool3 Nand(bool lhs, bool3 rhs) => new bool3(!(lhs && rhs.x), !(lhs && rhs.y), !(lhs && rhs.z));
コード例 #22
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Xor (lhs != rhs).
 /// </summary>
 public static bool3 Xor(bool3 lhs, bool rhs) => new bool3(lhs.x != rhs, lhs.y != rhs, lhs.z != rhs);
コード例 #23
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Or (lhs || rhs).
 /// </summary>
 public static bool3 Or(bool lhs, bool3 rhs) => new bool3(lhs || rhs.x, lhs || rhs.y, lhs || rhs.z);
コード例 #24
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Xnor (lhs == rhs).
 /// </summary>
 public static bool3 Xnor(bool lhs, bool3 rhs) => new bool3(lhs == rhs.x, lhs == rhs.y, lhs == rhs.z);
コード例 #25
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Nor (!(lhs || rhs)).
 /// </summary>
 public static bool3 Nor(bool lhs, bool3 rhs) => new bool3(!(lhs || rhs.x), !(lhs || rhs.y), !(lhs || rhs.z));
コード例 #26
0
ファイル: bool3.glm.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a string representation of this vector using a provided seperator.
 /// </summary>
 public static string ToString(bool3 v, string sep) => v.ToString(sep);
コード例 #27
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Xnor (lhs == rhs).
 /// </summary>
 public static bool3 Xnor(bool3 lhs, bool rhs) => new bool3(lhs.x == rhs, lhs.y == rhs, lhs.z == rhs);
コード例 #28
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bool3 Equal(bool3 lhs, bool rhs) => new bool3(lhs.x == rhs, lhs.y == rhs, lhs.z == rhs);
コード例 #29
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// from-vector constructor
 /// </summary>
 public bool3(bool3 v)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = v.z;
 }
コード例 #30
0
ファイル: bool3.cs プロジェクト: xposure/Atma.Math
 /// <summary>
 /// Returns a bool3 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bool3 NotEqual(bool3 lhs, bool rhs) => new bool3(lhs.x != rhs, lhs.y != rhs, lhs.z != rhs);