コード例 #1
0
ファイル: LAxis2D.cs プロジェクト: stzb321/LockStepFrameWork
        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);
                }
            }
        }
コード例 #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));
        }
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: LAxis2D.cs プロジェクト: stzb321/LockStepFrameWork
 public LAxis2D(LVector3 x, LVector3 y)
 {
     this.x = x;
     this.y = y;
 }
コード例 #5
0
 /// <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;
 }
コード例 #6
0
 /// <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;
 }
コード例 #7
0
 public LVector3 LocalToWorld(LVector3 vec)
 {
     return(x * vec.x + y * vec.y + z * vec.z);
 }
コード例 #8
0
 public LAxis3D(LVector3 right, LVector3 up, LVector3 forward)
 {
     this.x = right;
     this.y = up;
     this.z = forward;
 }