Exemple #1
0
        public                         LVector3 this[int index]
        {
            get
            {
                switch (index)
                {
                case 0: return(x);

                case 1: return(y);

                default: throw new System.IndexOutOfRangeException("vector idx invalid" + index);
                }
            }

            set
            {
                switch (index)
                {
                case 0:
                    x = value;
                    break;

                case 1:
                    y = value;
                    break;

                default: throw new System.IndexOutOfRangeException("vector idx invalid" + index);
                }
            }
        }
Exemple #2
0
        public LVector3 WorldToLocal(LVector3 vec)
        {
            var _x = Dot(x, vec);
            var _y = Dot(y, vec);
            var _z = Dot(z, vec);

            return(new LVector3(_x, _y, _z));
        }
 public LMatrix33(LVector3 column0, LVector3 column1, LVector3 column2)
 {
     this.m00 = column0._x;
     this.m01 = column1._x;
     this.m02 = column2._x;
     this.m10 = column0._y;
     this.m11 = column1._y;
     this.m12 = column2._y;
     this.m20 = column0._z;
     this.m21 = column1._z;
     this.m22 = column2._z;
 }
Exemple #4
0
 public LAxis2D(LVector3 x, LVector3 y)
 {
     this.x = x;
     this.y = y;
 }
 /// <summary>
 ///   <para>Sets a row of the matrix.</para>
 /// </summary>
 /// <param name="index"></param>
 /// <param name="row"></param>
 public void SetRow(int index, LVector3 row)
 {
     this[index, 0] = row.x;
     this[index, 1] = row.y;
     this[index, 2] = row.z;
 }
 /// <summary>
 ///   <para>Sets a column of the matrix.</para>
 /// </summary>
 /// <param name="index"></param>
 /// <param name="column"></param>
 public void SetColumn(int index, LVector3 column)
 {
     this[0, index] = column.x;
     this[1, index] = column.y;
     this[2, index] = column.z;
 }
Exemple #7
0
 public LVector3 LocalToWorld(LVector3 vec)
 {
     return(x * vec.x + y * vec.y + z * vec.z);
 }
Exemple #8
0
 public LAxis3D(LVector3 right, LVector3 up, LVector3 forward)
 {
     this.x = right;
     this.y = up;
     this.z = forward;
 }