using System ;
using System.Collections.Generic ;
using System.Runtime.InteropServices ;
using System.Text ;


namespace DxLibDLL
{


	public static partial class DX
	{


		/// <summary> 単位行列を作成する </summary>
		public static void CreateIdentityMatrix( out MATRIX Out )
		{
			int result = dx_CreateIdentityMatrix( out Out ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateIdentityMatrix( out MATRIX Out ) ;


		/// <summary> ビュー行列を作成する </summary>
		public static void CreateLookAtMatrix( out MATRIX Out , VECTOR Eye , VECTOR At , VECTOR Up )
		{
			int result = dx_CreateLookAtMatrix( out Out , ref Eye , ref At , ref Up ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateLookAtMatrix( out MATRIX Out , [ In ] ref VECTOR Eye , [ In ] ref VECTOR At , [ In ] ref VECTOR Up ) ;


		/// <summary> ビュー行列を作成する </summary>
		public static void CreateLookAtMatrix2( out MATRIX Out , VECTOR Eye , double XZAngle , double Oira )
		{
			int result = dx_CreateLookAtMatrix2( out Out , ref Eye , XZAngle , Oira ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateLookAtMatrix2( out MATRIX Out , [ In ] ref VECTOR Eye , double XZAngle , double Oira ) ;


		/// <summary> ビュー行列を作成する(右手座標系用) </summary>
		public static void CreateLookAtMatrixRH( out MATRIX Out , VECTOR Eye , VECTOR At , VECTOR Up )
		{
			int result = dx_CreateLookAtMatrixRH( out Out , ref Eye , ref At , ref Up ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateLookAtMatrixRH( out MATRIX Out , [ In ] ref VECTOR Eye , [ In ] ref VECTOR At , [ In ] ref VECTOR Up ) ;


		/// <summary> 行列の積を求める </summary>
		public static void CreateMultiplyMatrix( out MATRIX Out , MATRIX In1 , MATRIX In2 )
		{
			int result = dx_CreateMultiplyMatrix( out Out , ref In1 , ref In2 ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateMultiplyMatrix( out MATRIX Out , [ In ] ref MATRIX In1 , [ In ] ref MATRIX In2 ) ;


		/// <summary> 射影行列を作成する </summary>
		public static void CreatePerspectiveFovMatrix( out MATRIX Out , float fov , float zn , float zf )
		{
			CreatePerspectiveFovMatrix( out Out , fov , zn , zf , 1.0f ) ;
		}

		/// <summary> 射影行列を作成する </summary>
		public static void CreatePerspectiveFovMatrix( out MATRIX Out , float fov , float zn , float zf , float aspect )
		{
			int result = dx_CreatePerspectiveFovMatrix( out Out , fov , zn , zf , aspect ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreatePerspectiveFovMatrix( out MATRIX Out , float fov , float zn , float zf , float aspect ) ;


		/// <summary> 射影行列を作成する(右手座標系用) </summary>
		public static void CreatePerspectiveFovMatrixRH( out MATRIX Out , float fov , float zn , float zf )
		{
			CreatePerspectiveFovMatrixRH( out Out , fov , zn , zf , 1.0f ) ;
		}

		/// <summary> 射影行列を作成する(右手座標系用) </summary>
		public static void CreatePerspectiveFovMatrixRH( out MATRIX Out , float fov , float zn , float zf , float aspect )
		{
			int result = dx_CreatePerspectiveFovMatrixRH( out Out , fov , zn , zf , aspect ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreatePerspectiveFovMatrixRH( out MATRIX Out , float fov , float zn , float zf , float aspect ) ;



		/// <summary> 正射影行列を作成する </summary>
		public static void CreateOrthoMatrix( out MATRIX Out , float size , float zn , float zf )
		{
			CreateOrthoMatrix( out Out , size , zn , zf , 1.0f ) ;
		}

		/// <summary> 正射影行列を作成する </summary>
		public static void CreateOrthoMatrix( out MATRIX Out , float size , float zn , float zf , float aspect )
		{
			int result = dx_CreateOrthoMatrix( out Out , size , zn , zf , aspect ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateOrthoMatrix( out MATRIX Out , float size , float zn , float zf , float aspect ) ;


		/// <summary> 正射影行列を作成する(右手座標系用) </summary>
		public static void CreateOrthoMatrixRH( out MATRIX Out , float size , float zn , float zf )
		{
			CreateOrthoMatrixRH( out Out , size , zn , zf , 1.0f ) ;
		}

		/// <summary> 正射影行列を作成する(右手座標系用) </summary>
		public static void CreateOrthoMatrixRH( out MATRIX Out , float size , float zn , float zf , float aspect )
		{
			int result = dx_CreateOrthoMatrixRH( out Out , size , zn , zf , aspect ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateOrthoMatrixRH( out MATRIX Out , float size , float zn , float zf , float aspect ) ;


		/// <summary> スケーリング行列を作成する </summary>
		public static void CreateScalingMatrix( out MATRIX Out , float sx , float sy , float sz )
		{
			int result = dx_CreateScalingMatrix( out Out , sx , sy , sz ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateScalingMatrix( out MATRIX Out , float sx , float sy , float sz ) ;


		/// <summary> Ｘ軸を中心とした回転行列を作成する </summary>
		public static void CreateRotationXMatrix( out MATRIX Out , float Angle )
		{
			int result = dx_CreateRotationXMatrix( out Out , Angle ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationXMatrix( out MATRIX Out , float Angle ) ;


		/// <summary> Ｙ軸を中心とした回転行列を作成する </summary>
		public static void CreateRotationYMatrix( out MATRIX Out , float Angle )
		{
			int result = dx_CreateRotationYMatrix( out Out , Angle ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationYMatrix( out MATRIX Out , float Angle ) ;


		/// <summary> Ｚ軸を中心とした回転行列を作成する </summary>
		public static void CreateRotationZMatrix( out MATRIX Out , float Angle )
		{
			int result = dx_CreateRotationZMatrix( out Out , Angle ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationZMatrix( out MATRIX Out , float Angle ) ;


		/// <summary> 平行移動行列を作成する </summary>
		public static void CreateTranslationMatrix( out MATRIX Out , float x , float y , float z )
		{
			int result = dx_CreateTranslationMatrix( out Out , x , y , z ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateTranslationMatrix( out MATRIX Out , float x , float y , float z ) ;


		/// <summary> 転置行列を作成する </summary>
		public static void CreateTransposeMatrix( out MATRIX Out , MATRIX In )
		{
			int result = dx_CreateTransposeMatrix( out Out , ref In ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateTransposeMatrix( out MATRIX Out , [ In ] ref MATRIX In ) ;


		/// <summary> 逆行列を作成する </summary>
		public static void CreateInverseMatrix( out MATRIX Out , MATRIX In )
		{
			int result = dx_CreateInverseMatrix( out Out , ref In ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateInverseMatrix( out MATRIX Out , [ In ] ref MATRIX In ) ;


		/// <summary> ビューポート行列を作成する </summary>
		public static void CreateViewportMatrix( out MATRIX Out , float CenterX , float CenterY , float Width , float Height )
		{
			int result = dx_CreateViewportMatrix( out Out , CenterX , CenterY , Width , Height ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateViewportMatrix( out MATRIX Out , float CenterX , float CenterY , float Width , float Height ) ;


		/// <summary> Ｘ軸回転→Ｙ軸回転→Ｚ軸回転を合成した行列を作成する </summary>
		public static void CreateRotationXYZMatrix( out MATRIX Out , float XRot , float YRot , float ZRot )
		{
			int result = dx_CreateRotationXYZMatrix( out Out , XRot , YRot , ZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationXYZMatrix( out MATRIX Out , float XRot , float YRot , float ZRot ) ;


		/// <summary> Ｘ軸回転→Ｚ軸回転→Ｙ軸回転を合成した行列を作成する </summary>
		public static void CreateRotationXZYMatrix( out MATRIX Out , float XRot , float YRot , float ZRot )
		{
			int result = dx_CreateRotationXZYMatrix( out Out , XRot , YRot , ZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationXZYMatrix( out MATRIX Out , float XRot , float YRot , float ZRot ) ;


		/// <summary> Ｙ軸回転→Ｘ軸回転→Ｚ軸回転を合成した行列を作成する </summary>
		public static void CreateRotationYXZMatrix( out MATRIX Out , float XRot , float YRot , float ZRot )
		{
			int result = dx_CreateRotationYXZMatrix( out Out , XRot , YRot , ZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationYXZMatrix( out MATRIX Out , float XRot , float YRot , float ZRot ) ;


		/// <summary> Ｙ軸回転→Ｚ軸回転→Ｘ軸回転を合成した行列を作成する </summary>
		public static void CreateRotationYZXMatrix( out MATRIX Out , float XRot , float YRot , float ZRot )
		{
			int result = dx_CreateRotationYZXMatrix( out Out , XRot , YRot , ZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationYZXMatrix( out MATRIX Out , float XRot , float YRot , float ZRot ) ;


		/// <summary> Ｚ軸回転→Ｘ軸回転→Ｙ軸回転を合成した行列を作成する </summary>
		public static void CreateRotationZXYMatrix( out MATRIX Out , float XRot , float YRot , float ZRot )
		{
			int result = dx_CreateRotationZXYMatrix( out Out , XRot , YRot , ZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationZXYMatrix( out MATRIX Out , float XRot , float YRot , float ZRot ) ;


		/// <summary> Ｚ軸回転→Ｙ軸回転→Ｘ軸回転を合成した行列を作成する </summary>
		public static void CreateRotationZYXMatrix( out MATRIX Out , float XRot , float YRot , float ZRot )
		{
			int result = dx_CreateRotationZYXMatrix( out Out , XRot , YRot , ZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRotationZYXMatrix( out MATRIX Out , float XRot , float YRot , float ZRot ) ;


		/// <summary> 行列からＸＹＺ軸回転の値を取得する( 戻り値　-1:ジンバルロック発生  0:成功 ) </summary>
		public static void GetMatrixXYZRotation( MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot )
		{
			int result = dx_GetMatrixXYZRotation( ref In , out OutXRot , out OutYRot , out OutZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMatrixXYZRotation( [ In ] ref MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot ) ;


		/// <summary> 行列からＸＺＹ軸回転の値を取得する( 戻り値　-1:ジンバルロック発生  0:成功 ) </summary>
		public static void GetMatrixXZYRotation( MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot )
		{
			int result = dx_GetMatrixXZYRotation( ref In , out OutXRot , out OutYRot , out OutZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMatrixXZYRotation( [ In ] ref MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot ) ;


		/// <summary> 行列からＹＸＺ軸回転の値を取得する( 戻り値　-1:ジンバルロック発生  0:成功 ) </summary>
		public static void GetMatrixYXZRotation( MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot )
		{
			int result = dx_GetMatrixYXZRotation( ref In , out OutXRot , out OutYRot , out OutZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMatrixYXZRotation( [ In ] ref MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot ) ;


		/// <summary> 行列からＹＺＸ軸回転の値を取得する( 戻り値　-1:ジンバルロック発生  0:成功 ) </summary>
		public static void GetMatrixYZXRotation( MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot )
		{
			int result = dx_GetMatrixYZXRotation( ref In , out OutXRot , out OutYRot , out OutZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMatrixYZXRotation( [ In ] ref MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot ) ;


		/// <summary> 行列からＺＸＹ軸回転の値を取得する( 戻り値　-1:ジンバルロック発生  0:成功 ) </summary>
		public static void GetMatrixZXYRotation( MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot )
		{
			int result = dx_GetMatrixZXYRotation( ref In , out OutXRot , out OutYRot , out OutZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMatrixZXYRotation( [ In ] ref MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot ) ;


		/// <summary> 行列からＺＹＸ軸回転の値を取得する( 戻り値　-1:ジンバルロック発生  0:成功 ) </summary>
		public static void GetMatrixZYXRotation( MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot )
		{
			int result = dx_GetMatrixZYXRotation( ref In , out OutXRot , out OutYRot , out OutZRot ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMatrixZYXRotation( [ In ] ref MATRIX In , out float OutXRot , out float OutYRot , out float OutZRot ) ;


		/// <summary> ベクトルを正規化する </summary>
		public static void VectorNormalize( out VECTOR Out , VECTOR In )
		{
			int result = dx_VectorNormalize( out Out , ref In ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorNormalize( out VECTOR Out , [ In ] ref VECTOR In ) ;


		/// <summary> ベクトルをスカラー倍する </summary>
		public static void VectorScale( out VECTOR Out , VECTOR In , float Scale )
		{
			int result = dx_VectorScale( out Out , ref In , Scale ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorScale( out VECTOR Out , [ In ] ref VECTOR In , float Scale ) ;


		/// <summary> ベクトルの掛け算をする </summary>
		public static void VectorMultiply( out VECTOR Out , VECTOR In1 , VECTOR In2 )
		{
			int result = dx_VectorMultiply( out Out , ref In1 , ref In2 ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorMultiply( out VECTOR Out , [ In ] ref VECTOR In1 , [ In ] ref VECTOR In2 ) ;


		/// <summary> Out = In1 - In2 のベクトル計算をする  </summary>
		public static void VectorSub( out VECTOR Out , VECTOR In1 , VECTOR In2 )
		{
			int result = dx_VectorSub( out Out , ref In1 , ref In2 ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorSub( out VECTOR Out , [ In ] ref VECTOR In1 , [ In ] ref VECTOR In2 ) ;


		/// <summary> Out = In1 + In2 のベクトル計算をする  </summary>
		public static void VectorAdd( out VECTOR Out , VECTOR In1 , VECTOR In2 )
		{
			int result = dx_VectorAdd( out Out , ref In1 , ref In2 ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorAdd( out VECTOR Out , [ In ] ref VECTOR In1 , [ In ] ref VECTOR In2 ) ;


		/// <summary> In1とIn2の外積を計算する </summary>
		public static void VectorOuterProduct( out VECTOR Out , VECTOR In1 , VECTOR In2 )
		{
			int result = dx_VectorOuterProduct( out Out , ref In1 , ref In2 ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorOuterProduct( out VECTOR Out , [ In ] ref VECTOR In1 , [ In ] ref VECTOR In2 ) ;


		/// <summary> In1とIn2の内積を計算する </summary>
		public static float VectorInnerProduct( VECTOR In1 , VECTOR In2 )
		{
			float result = dx_VectorInnerProduct( ref In1 , ref In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_VectorInnerProduct( [ In ] ref VECTOR In1 , [ In ] ref VECTOR In2 ) ;


		/// <summary> ベクトルのＸ軸を軸にした回転を行う </summary>
		public static void VectorRotationX( out VECTOR Out , VECTOR In , double Angle )
		{
			int result = dx_VectorRotationX( out Out , ref In , Angle ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorRotationX( out VECTOR Out , [ In ] ref VECTOR In , double Angle ) ;


		/// <summary> ベクトルのＹ軸を軸にした回転を行う </summary>
		public static void VectorRotationY( out VECTOR Out , VECTOR In , double Angle )
		{
			int result = dx_VectorRotationY( out Out , ref In , Angle ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorRotationY( out VECTOR Out , [ In ] ref VECTOR In , double Angle ) ;


		/// <summary> ベクトルのＺ軸を軸にした回転を行う </summary>
		public static void VectorRotationZ( out VECTOR Out , VECTOR In , double Angle )
		{
			int result = dx_VectorRotationZ( out Out , ref In , Angle ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorRotationZ( out VECTOR Out , [ In ] ref VECTOR In , double Angle ) ;


		/// <summary> ベクトル行列と4x4正方行列を乗算する( w は 1 と仮定 ) </summary>
		public static void VectorTransform( out VECTOR Out , VECTOR InVec , MATRIX InMatrix )
		{
			int result = dx_VectorTransform( out Out , ref InVec , ref InMatrix ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorTransform( out VECTOR Out , [ In ] ref VECTOR InVec , [ In ] ref MATRIX InMatrix ) ;


		/// <summary> ベクトル行列と4x4正方行列を乗算する( w の要素を渡す ) </summary>
		public static void VectorTransform4( out VECTOR Out , out float V4Out , VECTOR InVec , float V4In , MATRIX InMatrix )
		{
			int result = dx_VectorTransform4( out Out , out V4Out , ref InVec , ref V4In , ref InMatrix ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_VectorTransform4( out VECTOR Out , out float V4Out , [ In ] ref VECTOR InVec , [ In ] ref float V4In , [ In ] ref MATRIX InMatrix ) ;


		/// <summary> 指定の座標から三角形の重心を求める </summary>
		public static void TriangleBarycenter( VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 , VECTOR Position , out float U , out float V , out float w )
		{
			dx_TriangleBarycenter( TrianglePos1 , TrianglePos2 , TrianglePos3 , Position , out U , out V , out w ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern void dx_TriangleBarycenter( VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 , VECTOR Position , out float U , out float V , out float w ) ;


		/// <summary> 二つの線分の最近点間の距離を得る </summary>
		public static float Segment_Segment_MinLength( VECTOR SegmentAPos1 , VECTOR SegmentAPos2 , VECTOR SegmentBPos1 , VECTOR SegmentBPos2 )
		{
			float result = dx_Segment_Segment_MinLength( SegmentAPos1 , SegmentAPos2 , SegmentBPos1 , SegmentBPos2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Segment_Segment_MinLength( VECTOR SegmentAPos1 , VECTOR SegmentAPos2 , VECTOR SegmentBPos1 , VECTOR SegmentBPos2 ) ;


		/// <summary> 二つの線分の最近点間の距離の二乗を得る </summary>
		public static float Segment_Segment_MinLength_Square( VECTOR SegmentAPos1 , VECTOR SegmentAPos2 , VECTOR SegmentBPos1 , VECTOR SegmentBPos2 )
		{
			float result = dx_Segment_Segment_MinLength_Square( SegmentAPos1 , SegmentAPos2 , SegmentBPos1 , SegmentBPos2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Segment_Segment_MinLength_Square( VECTOR SegmentAPos1 , VECTOR SegmentAPos2 , VECTOR SegmentBPos1 , VECTOR SegmentBPos2 ) ;


		/// <summary> 線分と三角形の最近点間の距離を得る  </summary>
		public static float Segment_Triangle_MinLength( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 )
		{
			float result = dx_Segment_Triangle_MinLength( SegmentPos1 , SegmentPos2 , TrianglePos1 , TrianglePos2 , TrianglePos3 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Segment_Triangle_MinLength( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 ) ;


		/// <summary> 線分と三角形の最近点間の距離の二乗を得る  </summary>
		public static float Segment_Triangle_MinLength_Square( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 )
		{
			float result = dx_Segment_Triangle_MinLength_Square( SegmentPos1 , SegmentPos2 , TrianglePos1 , TrianglePos2 , TrianglePos3 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Segment_Triangle_MinLength_Square( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 ) ;


		/// <summary> 線分と点の一番近い距離を得る </summary>
		public static float Segment_Point_MinLength( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR PointPos )
		{
			float result = dx_Segment_Point_MinLength( SegmentPos1 , SegmentPos2 , PointPos ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Segment_Point_MinLength( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR PointPos ) ;


		/// <summary> 線分と点の一番近い距離の二乗を得る </summary>
		public static float Segment_Point_MinLength_Square( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR PointPos )
		{
			float result = dx_Segment_Point_MinLength_Square( SegmentPos1 , SegmentPos2 , PointPos ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Segment_Point_MinLength_Square( VECTOR SegmentPos1 , VECTOR SegmentPos2 , VECTOR PointPos ) ;


		/// <summary> 三角形と点の一番近い距離を得る </summary>
		public static float Triangle_Point_MinLength( VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 , VECTOR PointPos )
		{
			float result = dx_Triangle_Point_MinLength( TrianglePos1 , TrianglePos2 , TrianglePos3 , PointPos ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Triangle_Point_MinLength( VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 , VECTOR PointPos ) ;


		/// <summary> 三角形と点の一番近い距離の二乗を得る </summary>
		public static float Triangle_Point_MinLength_Square( VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 , VECTOR PointPos )
		{
			float result = dx_Triangle_Point_MinLength_Square( TrianglePos1 , TrianglePos2 , TrianglePos3 , PointPos ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_Triangle_Point_MinLength_Square( VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 , VECTOR PointPos ) ;


		/// <summary> 三角形と線の当たり判定 </summary>
		public static HITRESULT_LINE HitCheck_Line_Triangle( VECTOR LinePos1 , VECTOR LinePos2 , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 )
		{
			HITRESULT_LINE result = dx_HitCheck_Line_Triangle( LinePos1 , LinePos2 , TrianglePos1 , TrianglePos2 , TrianglePos3 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern HITRESULT_LINE dx_HitCheck_Line_Triangle( VECTOR LinePos1 , VECTOR LinePos2 , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 ) ;


		/// <summary> 三角形と三角形の当たり判定( TRUE:当たっている  FALSE:当たっていない ) </summary>
		public static bool HitCheck_Triangle_Triangle( VECTOR Triangle1Pos1 , VECTOR Triangle1Pos2 , VECTOR Triangle1Pos3 , VECTOR Triangle2Pos1 , VECTOR Triangle2Pos2 , VECTOR Triangle2Pos3 )
		{
			int result = dx_HitCheck_Triangle_Triangle( Triangle1Pos1 , Triangle1Pos2 , Triangle1Pos3 , Triangle2Pos1 , Triangle2Pos2 , Triangle2Pos3 ) ;
			if( result == 0 ) { return false ; }
			else if( result == 1 ) { return true ; }
			else { throw new DX.Exception() ; }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_HitCheck_Triangle_Triangle( VECTOR Triangle1Pos1 , VECTOR Triangle1Pos2 , VECTOR Triangle1Pos3 , VECTOR Triangle2Pos1 , VECTOR Triangle2Pos2 , VECTOR Triangle2Pos3 ) ;


		/// <summary> 線と球の当たり判定( TRUE:当たっている  FALSE:当たっていない ) </summary>
		public static bool HitCheck_Line_Sphere( VECTOR LinePos1 , VECTOR LinePos2 , VECTOR SphereCenterPos , float SphereR )
		{
			int result = dx_HitCheck_Line_Sphere( LinePos1 , LinePos2 , SphereCenterPos , SphereR ) ;
			if( result == 0 ) { return false ; }
			else if( result == 1 ) { return true ; }
			else { throw new DX.Exception() ; }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_HitCheck_Line_Sphere( VECTOR LinePos1 , VECTOR LinePos2 , VECTOR SphereCenterPos , float SphereR ) ;


		/// <summary> 球と球の当たり判定( TRUE:当たっている  FALSE:当たっていない ) </summary>
		public static bool HitCheck_Sphere_Sphere( VECTOR Sphere1CenterPos , float Sphere1R , VECTOR Sphere2CenterPos , float Sphere2R )
		{
			int result = dx_HitCheck_Sphere_Sphere( Sphere1CenterPos , Sphere1R , Sphere2CenterPos , Sphere2R ) ;
			if( result == 0 ) { return false ; }
			else if( result == 1 ) { return true ; }
			else { throw new DX.Exception() ; }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_HitCheck_Sphere_Sphere( VECTOR Sphere1CenterPos , float Sphere1R , VECTOR Sphere2CenterPos , float Sphere2R ) ;


		/// <summary> 球と三角形の当たり判定( TRUE:当たっている  FALSE:当たっていない ) </summary>
		public static bool HitCheck_Sphere_Triangle( VECTOR SphereCenterPos , float SphereR , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 )
		{
			int result = dx_HitCheck_Sphere_Triangle( SphereCenterPos , SphereR , TrianglePos1 , TrianglePos2 , TrianglePos3 ) ;
			if( result == 0 ) { return false ; }
			else if( result == 1 ) { return true ; }
			else { throw new DX.Exception() ; }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_HitCheck_Sphere_Triangle( VECTOR SphereCenterPos , float SphereR , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 ) ;


		/// <summary> カプセル同士の当たり判定( TRUE:当たっている  FALSE:当たっていない ) </summary>
		public static bool HitCheck_Capsule_Capsule( VECTOR Cap1Pos1 , VECTOR Cap1Pos2 , float Cap1R , VECTOR Cap2Pos1 , VECTOR Cap2Pos2 , float Cap2R )
		{
			int result = dx_HitCheck_Capsule_Capsule( Cap1Pos1 , Cap1Pos2 , Cap1R , Cap2Pos1 , Cap2Pos2 , Cap2R ) ;
			if( result == 0 ) { return false ; }
			else if( result == 1 ) { return true ; }
			else { throw new DX.Exception() ; }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_HitCheck_Capsule_Capsule( VECTOR Cap1Pos1 , VECTOR Cap1Pos2 , float Cap1R , VECTOR Cap2Pos1 , VECTOR Cap2Pos2 , float Cap2R ) ;


		/// <summary> カプセルと三角形の当たり判定( TRUE:当たっている  FALSE:当たっていない ) </summary>
		public static bool HitCheck_Capsule_Triangle( VECTOR CapPos1 , VECTOR CapPos2 , float CapR , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 )
		{
			int result = dx_HitCheck_Capsule_Triangle( CapPos1 , CapPos2 , CapR , TrianglePos1 , TrianglePos2 , TrianglePos3 ) ;
			if( result == 0 ) { return false ; }
			else if( result == 1 ) { return true ; }
			else { throw new DX.Exception() ; }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_HitCheck_Capsule_Triangle( VECTOR CapPos1 , VECTOR CapPos2 , float CapR , VECTOR TrianglePos1 , VECTOR TrianglePos2 , VECTOR TrianglePos3 ) ;


		/// <summary> 矩形のクリッピング </summary>
		public static void RectClipping( out RECT MotoRect , RECT ClipRect )
		{
			int result = dx_RectClipping( out MotoRect , ref ClipRect ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_RectClipping( out RECT MotoRect , [ In ] ref RECT ClipRect ) ;


		/// <summary> 矩形の Left が Right より値が大きい場合などの誤りを補正する </summary>
		public static void RectAdjust( ref RECT Rect )
		{
			int result = dx_RectAdjust( ref Rect ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_RectAdjust( [ In , Out ] ref RECT Rect ) ;


		/// <summary> 矩形の幅と高さを求める </summary>
		public static void GetRectSize( RECT Rect , out int Width , out int Height )
		{
			int result = dx_GetRectSize( ref Rect , out Width , out Height ) ;
			if( !( result == 0 ) ) { throw new DX.Exception(); }
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetRectSize( [ In ] ref RECT Rect , out int Width , out int Height ) ;


		/// <summary> 単位行列を得る </summary>
		public static MATRIX MGetIdent()
		{
			MATRIX result = dx_MGetIdent() ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetIdent() ;


		/// <summary> 行列の乗算を行う </summary>
		public static MATRIX MMult( MATRIX In1 , MATRIX In2 )
		{
			MATRIX result = dx_MMult( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MMult( MATRIX In1 , MATRIX In2 ) ;


		/// <summary> 行列のスケーリングを行う </summary>
		public static MATRIX MScale( MATRIX InM , float Scale )
		{
			MATRIX result = dx_MScale( InM , Scale ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MScale( MATRIX InM , float Scale ) ;


		/// <summary> 行列の足し算を行う </summary>
		public static MATRIX MAdd( MATRIX In1 , MATRIX In2 )
		{
			MATRIX result = dx_MAdd( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MAdd( MATRIX In1 , MATRIX In2 ) ;


		/// <summary> 拡大行列を得る </summary>
		public static MATRIX MGetScale( VECTOR Scale )
		{
			MATRIX result = dx_MGetScale( Scale ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetScale( VECTOR Scale ) ;


		/// <summary> Ｘ軸回転行列を得る </summary>
		public static MATRIX MGetRotX( float XAxisRotate )
		{
			MATRIX result = dx_MGetRotX( XAxisRotate ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetRotX( float XAxisRotate ) ;


		/// <summary> Ｙ軸回転行列を得る </summary>
		public static MATRIX MGetRotY( float YAxisRotate )
		{
			MATRIX result = dx_MGetRotY( YAxisRotate ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetRotY( float YAxisRotate ) ;


		/// <summary> Ｚ軸回転行列を得る </summary>
		public static MATRIX MGetRotZ( float ZAxisRotate )
		{
			MATRIX result = dx_MGetRotZ( ZAxisRotate ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetRotZ( float ZAxisRotate ) ;


		/// <summary> 指定軸で指定角度回転する行列を得る </summary>
		public static MATRIX MGetRotAxis( VECTOR RotateAxis , float Rotate )
		{
			MATRIX result = dx_MGetRotAxis( RotateAxis , Rotate ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetRotAxis( VECTOR RotateAxis , float Rotate ) ;


		/// <summary> In1 の向きから In2 の向きへ変換する回転行列を得る( In2 と In1 が真逆のベクトルの場合は回転軸は不定 ) </summary>
		public static MATRIX MGetRotVec2( VECTOR In1 , VECTOR In2 )
		{
			MATRIX result = dx_MGetRotVec2( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetRotVec2( VECTOR In1 , VECTOR In2 ) ;


		/// <summary> 平行移動行列を得る </summary>
		public static MATRIX MGetTranslate( VECTOR Trans )
		{
			MATRIX result = dx_MGetTranslate( Trans ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetTranslate( VECTOR Trans ) ;


		/// <summary> 指定の３軸ローカルのベクトルを基本軸上のベクトルに変換する行列を得る( x' = XAxis.x * x + YAixs.x * y + ZAxis.z * z + Pos.x   y' = XAxis.y * x + YAixs.y * y + ZAxis.y * z + Pos.y	  z' = XAxis.z * x + YAixs.z * y + ZAxis.z * z + Pos.z ) </summary>
		public static MATRIX MGetAxis1( VECTOR XAxis , VECTOR YAxis , VECTOR ZAxis , VECTOR Pos )
		{
			MATRIX result = dx_MGetAxis1( XAxis , YAxis , ZAxis , Pos ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetAxis1( VECTOR XAxis , VECTOR YAxis , VECTOR ZAxis , VECTOR Pos ) ;


		/// <summary> 基本軸上のベクトルを指定の３軸上に投影したベクトルに変換する行列を得る( x' = XAxis.x * ( x - Pos.x ) + XAxis.y * ( x - Pos.x ) + XAxis.z * ( x - Pos.x )	y' = YAxis.x * ( x - Pos.x ) + YAxis.y * ( x - Pos.x ) + YAxis.z * ( x - Pos.x )	z' = ZAxis.x * ( x - Pos.x ) + ZAxis.y * ( x - Pos.x ) + ZAxis.z * ( x - Pos.x ) ) </summary>
		public static MATRIX MGetAxis2( VECTOR XAxis , VECTOR YAxis , VECTOR ZAxis , VECTOR Pos )
		{
			MATRIX result = dx_MGetAxis2( XAxis , YAxis , ZAxis , Pos ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MGetAxis2( VECTOR XAxis , VECTOR YAxis , VECTOR ZAxis , VECTOR Pos ) ;


		/// <summary> 転置行列を得る </summary>
		public static MATRIX MTranspose( MATRIX InM )
		{
			MATRIX result = dx_MTranspose( InM ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MTranspose( MATRIX InM ) ;


		/// <summary> 逆行列を得る </summary>
		public static MATRIX MInverse( MATRIX InM )
		{
			MATRIX result = dx_MInverse( InM ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MATRIX dx_MInverse( MATRIX InM ) ;


		/// <summary> ベクトル値の生成 </summary>
		public static VECTOR VGet( float x , float y , float z )
		{
			VECTOR result = dx_VGet( x , y , z ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VGet( float x , float y , float z ) ;


		/// <summary> ベクトルの加算 </summary>
		public static VECTOR VAdd( VECTOR In1 , VECTOR In2 )
		{
			VECTOR result = dx_VAdd( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VAdd( VECTOR In1 , VECTOR In2 ) ;


		/// <summary> ベクトルの減算 </summary>
		public static VECTOR VSub( VECTOR In1 , VECTOR In2 )
		{
			VECTOR result = dx_VSub( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VSub( VECTOR In1 , VECTOR In2 ) ;


		/// <summary> ベクトルの内積 </summary>
		public static float VDot( VECTOR In1 , VECTOR In2 )
		{
			float result = dx_VDot( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_VDot( VECTOR In1 , VECTOR In2 ) ;


		/// <summary> ベクトルの外積 </summary>
		public static VECTOR VCross( VECTOR In1 , VECTOR In2 )
		{
			VECTOR result = dx_VCross( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VCross( VECTOR In1 , VECTOR In2 ) ;


		/// <summary> ベクトルのスケーリング </summary>
		public static VECTOR VScale( VECTOR In , float Scale )
		{
			VECTOR result = dx_VScale( In , Scale ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VScale( VECTOR In , float Scale ) ;


		/// <summary> ベクトルの正規化 </summary>
		public static VECTOR VNorm( VECTOR In )
		{
			VECTOR result = dx_VNorm( In ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VNorm( VECTOR In ) ;


		/// <summary> ベクトルのサイズ </summary>
		public static float VSize( VECTOR In )
		{
			float result = dx_VSize( In ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_VSize( VECTOR In ) ;


		/// <summary> ベクトルのサイズの２乗 </summary>
		public static float VSquareSize( VECTOR In )
		{
			float result = dx_VSquareSize( In ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_VSquareSize( VECTOR In ) ;


		/// <summary> 行列を使った座標変換 </summary>
		public static VECTOR VTransform( VECTOR InV , MATRIX InM )
		{
			VECTOR result = dx_VTransform( InV , InM ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VTransform( VECTOR InV , MATRIX InM ) ;


		/// <summary> 行列を使った座標変換( スケーリング＋回転成分のみ ) </summary>
		public static VECTOR VTransformSR( VECTOR InV , MATRIX InM )
		{
			VECTOR result = dx_VTransformSR( InV , InM ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern VECTOR dx_VTransformSR( VECTOR InV , MATRIX InM ) ;


		/// <summary> 二つのベクトルが成す角のコサイン値を得る </summary>
		public static float VCos( VECTOR In1 , VECTOR In2 )
		{
			float result = dx_VCos( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_VCos( VECTOR In1 , VECTOR In2 ) ;


		/// <summary> 二つのベクトルが成す角の角度を得る( 単位：ラジアン ) </summary>
		public static float VRad( VECTOR In1 , VECTOR In2 )
		{
			float result = dx_VRad( In1 , In2 ) ;
			return result ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_VRad( VECTOR In1 , VECTOR In2 ) ;
	}
}
