diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..82da51f4
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,4 @@
+{
+ "masmtasm.ASM.assembler": "MASM",
+ "masmtasm.ASM.emulator": "msdos player"
+}
\ No newline at end of file
diff --git a/Math/Asm/AsmMath/AsmMath/Sqrt0001.asm b/Math/Asm/AsmMath/AsmMath/Sqrt0001.asm
index 08d001e7..15595d69 100644
--- a/Math/Asm/AsmMath/AsmMath/Sqrt0001.asm
+++ b/Math/Asm/AsmMath/AsmMath/Sqrt0001.asm
@@ -1,15 +1,69 @@
-.386 ; 编译器指令,使用386指令集
-.model flat, stdcall ; model汇编指令,程序的内存模式, flat是windows程序,没有远近指针,stdcall是windows函数用的参数方式,即参数从右向左传递
-option casemap :none ; 标签是否区分大小写
-include \masm32\include\windows.inc ; 包含了Win32 API 的一些常量和函数定义
-include \masm32\include\kernel32.inc ; 包含了后面使用的ExitProcess函数
-include \masm32\include\masm32.inc ; 包含了后面使用的StdOut函数,不是标准的Win32函数,由MASM提供
-includelib \masm32\lib\kernel32.lib ; 库文件
-includelib \masm32\lib\masm32.lib
-.data
- HelloWorld db "Hello World!", 0 ; 定义使用的字符串常量,db代表define byte。最后跟一个NUL,表示ANSI字符集结束符
-.code ; 开始代码区
- start: ; 所有的代码要在start标签后、end start前
- invoke StdOut, addr HelloWorld ; 调用函数StdOut,参数量HelloWorld的地址。注意StdOut是MASM提供的宏。其它编辑器里可以使用WriteConsole之类win32函数代替。
- invoke ExitProcess, 0 ; 调用ExitProcess
-end start
\ No newline at end of file
+; Attributes: bp-based frame fpd=1A0h
+
+; int main(...)
+main proc near
+
+frame= byte ptr -1C0h
+var_1A0= byte ptr -1A0h
+var_19C= dword ptr -19Ch
+var_178= dword ptr -178h
+var_148= qword ptr -148h
+var_120= xmmword ptr -120h
+var_F0= xmmword ptr -0F0h
+var_18= qword ptr -18h
+
+; __unwind { // j___GSHandlerCheck
+push rbp
+push rdi
+sub rsp, 1B8h
+lea rbp, [rsp+20h]
+
+__$EncStackInitStart:
+lea rdi, [rsp+1C0h+var_1A0]
+mov ecx, 36h ; '6'
+mov eax, 0CCCCCCCCh
+rep stosd
+
+__$EncStackInitEnd:
+mov rax, cs:__security_cookie
+xor rax, rbp
+mov [rbp+1A0h+var_18], rax
+lea rcx, __41B3B322_AsmSqrt@c ; JMC_flag
+call j___CheckForDebuggerJustMyCode
+movss xmm0, cs:__real@40800000
+movss [rbp+1A0h+var_19C], xmm0
+lea rax, [rbp+1A0h+var_19C]
+mov [rbp+1A0h+var_148], rax
+mov rax, [rbp+1A0h+var_148]
+movss xmm0, dword ptr [rax]
+xorps xmm1, xmm1
+movss xmm1, xmm0
+movaps xmm0, xmm1
+movaps [rbp+1A0h+var_120], xmm0
+movaps xmm0, [rbp+1A0h+var_120]
+sqrtss xmm0, xmm0
+movaps [rbp+1A0h+var_F0], xmm0
+movaps xmm0, [rbp+1A0h+var_F0]
+movss [rbp+1A0h+var_178], xmm0
+mov eax, 4
+imul rax, 0
+cvtss2sd xmm0, [rbp+rax+1A0h+var_178]
+movaps xmm1, xmm0
+movq rdx, xmm1
+lea rcx, _Format ; "%f"
+call j_printf
+xor eax, eax
+mov edi, eax
+lea rcx, [rbp+1A0h+frame] ; frame
+lea rdx, v ; v
+call j__RTC_CheckStackVars
+mov eax, edi
+mov rcx, [rbp+1A0h+var_18]
+xor rcx, rbp ; StackCookie
+call j___security_check_cookie
+lea rsp, [rbp+198h]
+pop rdi
+pop rbp
+retn
+; } // starts at 140011870
+main endp
\ No newline at end of file
diff --git a/Math/Asm/asmtool/EDIT.COM b/Math/Asm/asmtool/EDIT.COM
new file mode 100644
index 00000000..9ca2a56e
Binary files /dev/null and b/Math/Asm/asmtool/EDIT.COM differ
diff --git a/Math/Asm/asmtool/LINK.EXE b/Math/Asm/asmtool/LINK.EXE
new file mode 100644
index 00000000..2ed1453c
Binary files /dev/null and b/Math/Asm/asmtool/LINK.EXE differ
diff --git a/Math/Asm/asmtool/MASM.EXE b/Math/Asm/asmtool/MASM.EXE
new file mode 100644
index 00000000..eacbb631
Binary files /dev/null and b/Math/Asm/asmtool/MASM.EXE differ
diff --git a/Math/Asm/asmtool/debug.exe b/Math/Asm/asmtool/debug.exe
new file mode 100644
index 00000000..5c598617
Binary files /dev/null and b/Math/Asm/asmtool/debug.exe differ
diff --git a/Math/Asm/asmtool/exe2bin.exe b/Math/Asm/asmtool/exe2bin.exe
new file mode 100644
index 00000000..b6cf5227
Binary files /dev/null and b/Math/Asm/asmtool/exe2bin.exe differ
diff --git a/Math/C/Project1/.vs/Project1/FileContentIndex/38e12e8d-f0e3-427a-82ce-e77fab1fe9c2.vsidx b/Math/C/Project1/.vs/Project1/FileContentIndex/38e12e8d-f0e3-427a-82ce-e77fab1fe9c2.vsidx
new file mode 100644
index 00000000..8df54387
Binary files /dev/null and b/Math/C/Project1/.vs/Project1/FileContentIndex/38e12e8d-f0e3-427a-82ce-e77fab1fe9c2.vsidx differ
diff --git a/Math/C/Project1/.vs/Project1/FileContentIndex/8092451b-d93a-4102-96e5-25ddf68e41b4.vsidx b/Math/C/Project1/.vs/Project1/FileContentIndex/8092451b-d93a-4102-96e5-25ddf68e41b4.vsidx
deleted file mode 100644
index 10bb2105..00000000
Binary files a/Math/C/Project1/.vs/Project1/FileContentIndex/8092451b-d93a-4102-96e5-25ddf68e41b4.vsidx and /dev/null differ
diff --git a/Math/C/Project1/.vs/Project1/FileContentIndex/bc514085-f8aa-4839-8595-26400cca1477.vsidx b/Math/C/Project1/.vs/Project1/FileContentIndex/bc514085-f8aa-4839-8595-26400cca1477.vsidx
new file mode 100644
index 00000000..82f4ae71
Binary files /dev/null and b/Math/C/Project1/.vs/Project1/FileContentIndex/bc514085-f8aa-4839-8595-26400cca1477.vsidx differ
diff --git a/Math/C/Project1/.vs/Project1/FileContentIndex/ce1768b8-2910-4e84-a35c-2ccfbb073f04.vsidx b/Math/C/Project1/.vs/Project1/FileContentIndex/ce1768b8-2910-4e84-a35c-2ccfbb073f04.vsidx
new file mode 100644
index 00000000..bc078f19
Binary files /dev/null and b/Math/C/Project1/.vs/Project1/FileContentIndex/ce1768b8-2910-4e84-a35c-2ccfbb073f04.vsidx differ
diff --git a/Math/C/Project1/.vs/Project1/FileContentIndex/720d7da3-c3ce-4d21-8472-425a7c4a7277.vsidx b/Math/C/Project1/.vs/Project1/FileContentIndex/fa5ba6d0-2a38-4a21-9dbb-aa7c6209c908.vsidx
similarity index 100%
rename from Math/C/Project1/.vs/Project1/FileContentIndex/720d7da3-c3ce-4d21-8472-425a7c4a7277.vsidx
rename to Math/C/Project1/.vs/Project1/FileContentIndex/fa5ba6d0-2a38-4a21-9dbb-aa7c6209c908.vsidx
diff --git a/Math/C/Project1/.vs/Project1/v17/.suo b/Math/C/Project1/.vs/Project1/v17/.suo
index 0d552cb0..789e5173 100644
Binary files a/Math/C/Project1/.vs/Project1/v17/.suo and b/Math/C/Project1/.vs/Project1/v17/.suo differ
diff --git a/Math/C/Project1/.vs/Project1/v17/Browse.VC.db b/Math/C/Project1/.vs/Project1/v17/Browse.VC.db
index ccf440d8..891625d6 100644
Binary files a/Math/C/Project1/.vs/Project1/v17/Browse.VC.db and b/Math/C/Project1/.vs/Project1/v17/Browse.VC.db differ
diff --git a/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/9049990540e7ec66/VCTMP7784_313162.ASMSQRT.00000000.ipch b/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/9049990540e7ec66/VCTMP7784_313162.ASMSQRT.00000000.ipch
new file mode 100644
index 00000000..9c3e5777
Binary files /dev/null and b/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/9049990540e7ec66/VCTMP7784_313162.ASMSQRT.00000000.ipch differ
diff --git a/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/c2fcbbcbab92a216/ASMSQRT.ipch b/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/c2fcbbcbab92a216/ASMSQRT.ipch
index 4156bb07..125761ad 100644
Binary files a/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/c2fcbbcbab92a216/ASMSQRT.ipch and b/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/c2fcbbcbab92a216/ASMSQRT.ipch differ
diff --git a/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/dfebad7e1f0471f4/源.ipch b/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/dfebad7e1f0471f4/源.ipch
new file mode 100644
index 00000000..34a256d2
Binary files /dev/null and b/Math/C/Project1/.vs/Project1/v17/ipch/AutoPCH/dfebad7e1f0471f4/源.ipch differ
diff --git a/Math/C/Project1/Project1.sln b/Math/C/Project1/Project1.sln
index 0833520e..e19ec8fb 100644
--- a/Math/C/Project1/Project1.sln
+++ b/Math/C/Project1/Project1.sln
@@ -5,6 +5,8 @@ VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project1", "Project1\Project1.vcxproj", "{9C0FD617-CD38-48B5-A16C-909FBA56BBF5}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project2", "Project2\Project2.vcxproj", "{3575C925-9280-4453-8D67-2BFD4E76A1D8}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -21,6 +23,14 @@ Global
{9C0FD617-CD38-48B5-A16C-909FBA56BBF5}.Release|x64.Build.0 = Release|x64
{9C0FD617-CD38-48B5-A16C-909FBA56BBF5}.Release|x86.ActiveCfg = Release|Win32
{9C0FD617-CD38-48B5-A16C-909FBA56BBF5}.Release|x86.Build.0 = Release|Win32
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Debug|x64.ActiveCfg = Debug|x64
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Debug|x64.Build.0 = Debug|x64
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Debug|x86.ActiveCfg = Debug|Win32
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Debug|x86.Build.0 = Debug|Win32
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Release|x64.ActiveCfg = Release|x64
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Release|x64.Build.0 = Release|x64
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Release|x86.ActiveCfg = Release|Win32
+ {3575C925-9280-4453-8D67-2BFD4E76A1D8}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Math/C/Project1/Project1/AsmSqrt.c b/Math/C/Project1/Project1/AsmSqrt.c
index 8f737f81..55cb2fab 100644
--- a/Math/C/Project1/Project1/AsmSqrt.c
+++ b/Math/C/Project1/Project1/AsmSqrt.c
@@ -5,27 +5,43 @@
void main()
{
- float a = sseSqrt(4.0f);
- int b = (int)a;
+ /*
+ float z = 4.00f;
+ float* a = &z;
+ float b = sseSqrt(z);
- printf(b);
-}
+ printf("%f", b);
+ /**/
-float sseSqrt(float x)
-{
-
- float* pa = &x;
- float result[4];
+
+ float a = 4.0f;
+ float r[4];
+ float* pa = &a;
__m128 b;
+ __m128 c;
b = _mm_load_ss(pa);
+ c = _mm_sqrt_ss(b);
+ _mm_store_ss(r, c);
+ printf("%f", r[0]);
+ /**/
+}
+
+/*
+float sseSqrt(float x)
+{
+ float* a = &x;
+ float result[4];
+
+ __m128 b = _mm_load_ss(a);
__m128 c = _mm_sqrt_ss(b);
_mm_store_ss(result, c);
- return result[3];
-}
\ No newline at end of file
+ return result[0];
+}
+/**/
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/AsmSqrt.obj b/Math/C/Project1/Project1/x64/Debug/AsmSqrt.obj
index 99b5c595..572ebce2 100644
Binary files a/Math/C/Project1/Project1/x64/Debug/AsmSqrt.obj and b/Math/C/Project1/Project1/x64/Debug/AsmSqrt.obj differ
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.ilk b/Math/C/Project1/Project1/x64/Debug/Project1.ilk
new file mode 100644
index 00000000..e343958e
Binary files /dev/null and b/Math/C/Project1/Project1/x64/Debug/Project1.ilk differ
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.log b/Math/C/Project1/Project1/x64/Debug/Project1.log
index b6fc6aad..f741bc7f 100644
--- a/Math/C/Project1/Project1/x64/Debug/Project1.log
+++ b/Math/C/Project1/Project1/x64/Debug/Project1.log
@@ -1,8 +1,2 @@
AsmSqrt.c
-D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\Project1\AsmSqrt.c(8,12): warning C4013: “sseSqrt”未定义;假设外部返回 int
-D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\Project1\AsmSqrt.c(12,10): warning C4047: “函数”:“const char *const ”与“int”的间接级别不同
-D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\Project1\AsmSqrt.c(12,9): warning C4024: “printf”: 形参和实参 1 的类型不同
-D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\Project1\AsmSqrt.c(8,12): warning C4244: “初始化”: 从“int”转换到“float”,可能丢失数据
-D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\Project1\AsmSqrt.c(17,1): warning C4142: "sseSqrt": 类型的良性重定义
-MSVCRTD.lib(exe_main.obj) : error LNK2019: 无法解析的外部符号 main,函数 "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 中引用了该符号
-D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\x64\Debug\Project1.exe : fatal error LNK1120: 1 个无法解析的外部命令
+ Project1.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\Math\C\Project1\x64\Debug\Project1.exe
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-cvtres.read.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-cvtres.read.1.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-cvtres.read.1.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-cvtres.write.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-cvtres.write.1.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-cvtres.write.1.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-rc.read.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-rc.read.1.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-rc.read.1.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-rc.write.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-rc.write.1.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024-rc.write.1.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.read.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.read.1.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.read.1.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.read.2.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.read.2.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.read.2.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.write.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.write.1.tlog
deleted file mode 100644
index 46b134b1..00000000
--- a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.42024.write.1.tlog
+++ /dev/null
@@ -1 +0,0 @@
-ÿþ
\ No newline at end of file
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog
index 46b134b1..9e6b8ef1 100644
Binary files a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog and b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog differ
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog
index 46b134b1..2fafbec3 100644
Binary files a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog and b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog differ
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog
index 46b134b1..28179e56 100644
Binary files a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog and b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog differ
diff --git a/Math/C/Project1/Project1/x64/Debug/Project1.tlog/unsuccessfulbuild b/Math/C/Project1/Project1/x64/Debug/Project1.tlog/unsuccessfulbuild
deleted file mode 100644
index e69de29b..00000000
diff --git a/Math/C/Project1/Project1/x64/Debug/vc143.idb b/Math/C/Project1/Project1/x64/Debug/vc143.idb
index 61ee05f0..572691b8 100644
Binary files a/Math/C/Project1/Project1/x64/Debug/vc143.idb and b/Math/C/Project1/Project1/x64/Debug/vc143.idb differ
diff --git a/Math/C/Project1/Project1/x64/Debug/vc143.pdb b/Math/C/Project1/Project1/x64/Debug/vc143.pdb
index 2c29b4e9..9fa6ca6c 100644
Binary files a/Math/C/Project1/Project1/x64/Debug/vc143.pdb and b/Math/C/Project1/Project1/x64/Debug/vc143.pdb differ
diff --git a/Math/C/Project1/Project2/Project2.vcxproj b/Math/C/Project1/Project2/Project2.vcxproj
new file mode 100644
index 00000000..07131845
--- /dev/null
+++ b/Math/C/Project1/Project2/Project2.vcxproj
@@ -0,0 +1,135 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 16.0
+ Win32Proj
+ {3575c925-9280-4453-8d67-2bfd4e76a1d8}
+ Project2
+ 10.0
+
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Math/C/Project1/Project2/Project2.vcxproj.filters b/Math/C/Project1/Project2/Project2.vcxproj.filters
new file mode 100644
index 00000000..d0491384
--- /dev/null
+++ b/Math/C/Project1/Project2/Project2.vcxproj.filters
@@ -0,0 +1,22 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ 源文件
+
+
+
\ No newline at end of file
diff --git a/Math/C/Project1/Project2/Project2.vcxproj.user b/Math/C/Project1/Project2/Project2.vcxproj.user
new file mode 100644
index 00000000..88a55094
--- /dev/null
+++ b/Math/C/Project1/Project2/Project2.vcxproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Math/C/Project1/Project2/源.c b/Math/C/Project1/Project2/源.c
new file mode 100644
index 00000000..157fe813
--- /dev/null
+++ b/Math/C/Project1/Project2/源.c
@@ -0,0 +1,16 @@
+#include
+#include
+#include
+#include
+
+void main()
+{
+ float a = 4.00f;
+ float* pa = &a;
+
+ _asm
+ (
+ MOVSS xmm1,%0
+
+ );
+}
\ No newline at end of file
diff --git a/Math/C/Project1/x64/Debug/Project1.exe b/Math/C/Project1/x64/Debug/Project1.exe
new file mode 100644
index 00000000..c86c5dc6
Binary files /dev/null and b/Math/C/Project1/x64/Debug/Project1.exe differ
diff --git a/Math/C/Project1/x64/Debug/Project1.pdb b/Math/C/Project1/x64/Debug/Project1.pdb
index c8f6de98..f90450b3 100644
Binary files a/Math/C/Project1/x64/Debug/Project1.pdb and b/Math/C/Project1/x64/Debug/Project1.pdb differ
diff --git a/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 b/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1
index 43c4772f..f7dcbf68 100644
Binary files a/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 and b/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 differ
diff --git a/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 b/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1
index f80cbbb8..3a54ce4b 100644
Binary files a/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 and b/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 differ
diff --git a/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 b/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2
index ae01dadc..d3408c77 100644
Binary files a/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 and b/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/06ce55c2-751b-4556-8ab0-03c8940bbea4.vsidx b/源代码/.vs/StgSharp/FileContentIndex/06ce55c2-751b-4556-8ab0-03c8940bbea4.vsidx
deleted file mode 100644
index 468dd811..00000000
Binary files a/源代码/.vs/StgSharp/FileContentIndex/06ce55c2-751b-4556-8ab0-03c8940bbea4.vsidx and /dev/null differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/19209862-1823-45e5-b908-3c9c480a8133.vsidx b/源代码/.vs/StgSharp/FileContentIndex/19209862-1823-45e5-b908-3c9c480a8133.vsidx
new file mode 100644
index 00000000..d3df6d03
Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/19209862-1823-45e5-b908-3c9c480a8133.vsidx differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/441da583-65ab-4bde-b46b-bea8aabc8442.vsidx b/源代码/.vs/StgSharp/FileContentIndex/441da583-65ab-4bde-b46b-bea8aabc8442.vsidx
deleted file mode 100644
index 4af97b9c..00000000
Binary files a/源代码/.vs/StgSharp/FileContentIndex/441da583-65ab-4bde-b46b-bea8aabc8442.vsidx and /dev/null differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/5979fcd0-f879-4d89-ba05-673a8b74a6fc.vsidx b/源代码/.vs/StgSharp/FileContentIndex/5979fcd0-f879-4d89-ba05-673a8b74a6fc.vsidx
deleted file mode 100644
index 63b45616..00000000
Binary files a/源代码/.vs/StgSharp/FileContentIndex/5979fcd0-f879-4d89-ba05-673a8b74a6fc.vsidx and /dev/null differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/93357732-0de8-46ca-8526-d5b7ec791a32.vsidx b/源代码/.vs/StgSharp/FileContentIndex/93357732-0de8-46ca-8526-d5b7ec791a32.vsidx
new file mode 100644
index 00000000..4064406b
Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/93357732-0de8-46ca-8526-d5b7ec791a32.vsidx differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/98251e7c-eb4c-473d-a405-f387c6580e0a.vsidx b/源代码/.vs/StgSharp/FileContentIndex/98251e7c-eb4c-473d-a405-f387c6580e0a.vsidx
new file mode 100644
index 00000000..39917c5f
Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/98251e7c-eb4c-473d-a405-f387c6580e0a.vsidx differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/98377eee-a618-4e84-b2f8-b16d3e4138cd.vsidx b/源代码/.vs/StgSharp/FileContentIndex/98377eee-a618-4e84-b2f8-b16d3e4138cd.vsidx
new file mode 100644
index 00000000..7d91519f
Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/98377eee-a618-4e84-b2f8-b16d3e4138cd.vsidx differ
diff --git a/源代码/.vs/StgSharp/FileContentIndex/ea04f6e8-b9d9-49d3-9ff4-7a814260bd50.vsidx b/源代码/.vs/StgSharp/FileContentIndex/ea04f6e8-b9d9-49d3-9ff4-7a814260bd50.vsidx
deleted file mode 100644
index 252b9f8b..00000000
Binary files a/源代码/.vs/StgSharp/FileContentIndex/ea04f6e8-b9d9-49d3-9ff4-7a814260bd50.vsidx and /dev/null differ
diff --git a/源代码/.vs/StgSharp/v17/.futdcache.v2 b/源代码/.vs/StgSharp/v17/.futdcache.v2
index 6cc78525..2c4eb06a 100644
Binary files a/源代码/.vs/StgSharp/v17/.futdcache.v2 and b/源代码/.vs/StgSharp/v17/.futdcache.v2 differ
diff --git a/源代码/.vs/StgSharp/v17/.suo b/源代码/.vs/StgSharp/v17/.suo
index ecbb6122..58503eaf 100644
Binary files a/源代码/.vs/StgSharp/v17/.suo and b/源代码/.vs/StgSharp/v17/.suo differ
diff --git a/源代码/StgSharp/Control/Remove.cs b/源代码/StgSharp/Control/Remove.cs
index 71ea75ff..e67c7bf1 100644
--- a/源代码/StgSharp/Control/Remove.cs
+++ b/源代码/StgSharp/Control/Remove.cs
@@ -14,5 +14,8 @@ namespace StgSharp.Control
_cache.Next = default(StgSharp.ContainerNode);
_cache.Previous = default(StgSharp.ContainerNode);
}
+
+
+
}
}
diff --git a/源代码/StgSharp/Data/Union4.cs b/源代码/StgSharp/Data/Union4.cs
deleted file mode 100644
index 5aa01aeb..00000000
--- a/源代码/StgSharp/Data/Union4.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace StgSharp
-{
-
- //对4字节空间的联合体的C#实现
- [StructLayout(LayoutKind.Explicit, Size = 4)]
- public struct Union4
- {
- [FieldOffset(0)]
- public byte b0;
- [FieldOffset(1)]
- public byte b1;
- [FieldOffset(2)]
- public byte b2;
- [FieldOffset(3)]
- public byte b3;
- //得到对应的int值
- [FieldOffset(0)]
- public uint i;
- //得到对应的float值
- [FieldOffset(0)]
- public float f;
- }
-
-
-
-}
diff --git a/源代码/StgSharp/Data/Union8.cs b/源代码/StgSharp/Data/Union8.cs
deleted file mode 100644
index 1b4d8022..00000000
--- a/源代码/StgSharp/Data/Union8.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace StgSharp
-{
- //对8字节空间的联合体的C#实现
- [StructLayout(LayoutKind.Explicit, Size = 8)]
- public struct Union8
- {
- [FieldOffset(0)]
- public byte b0;
- [FieldOffset(1)]
- public byte b1;
- [FieldOffset(2)]
- public byte b2;
- [FieldOffset(3)]
- public byte b3;
- //得到对应的int值
- [FieldOffset(0)]
- public int i1;
- [FieldOffset(4)]
- public int i2;
- //得到对应的float值
- [FieldOffset(0)]
- public double f;
- }
-}
diff --git a/源代码/StgSharp/Entities/CollisionPartical.cs b/源代码/StgSharp/Entities/CollisionPartical.cs
new file mode 100644
index 00000000..a4a026ff
--- /dev/null
+++ b/源代码/StgSharp/Entities/CollisionPartical.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Entities
+{
+ internal class CollisionPartical
+ {
+ }
+}
diff --git a/源代码/StgSharp/Entities/Enemy.cs b/源代码/StgSharp/Entities/Enemy.cs
new file mode 100644
index 00000000..182cf202
--- /dev/null
+++ b/源代码/StgSharp/Entities/Enemy.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Entities
+{
+ public class Enemy : Entity
+ {
+
+ }
+}
diff --git a/源代码/StgSharp/Entities/Entity.cs b/源代码/StgSharp/Entities/Entity.cs
new file mode 100644
index 00000000..dd304d1e
--- /dev/null
+++ b/源代码/StgSharp/Entities/Entity.cs
@@ -0,0 +1,71 @@
+using StgSharp.Math;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp
+{
+ public class Entity:INode
+ {
+ internal vec2d _pos;
+ internal IGeometry _collisionBox;
+ internal Sensor _collisionSensor;
+ internal ContainerNode _id;
+
+
+ public IGeometry CollisionBox
+ {
+ get { return _collisionBox; }
+ set { _collisionBox = value; }
+ }
+
+
+ ///
+ /// A sensor used for cheking out if a bullet hit a player or something else
+ ///
+ public Sensor CollisionSensor
+ {
+ get { return _collisionSensor; }
+ set { _collisionSensor = value; }
+ }
+
+ public string Texture { get; set; }
+
+ ///
+ /// A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y
+ ///
+ public vec2d Location { get; }
+
+ ///
+ /// X position of an enenmy entity
+ ///
+ public float X { get; set; }
+
+ ///
+ /// Y position of an enemy entity
+ ///
+ public float Y { get; set; }
+
+ ContainerNode INode.ID
+ {
+ get { return _id; }
+ }
+
+ public void SetLocation(Point p)
+ {
+
+ }
+
+ void INode.setID(ContainerNode id)
+ {
+ if (id == null)
+ {
+ _id = id as ContainerNode;
+ }
+ else
+ {
+ throw new ArgumentException("Cannot set id twice!");
+ }
+ }
+ }
+}
diff --git a/源代码/StgSharp/Entities/IEntity.cs b/源代码/StgSharp/Entities/IEntity.cs
deleted file mode 100644
index ebe150f7..00000000
--- a/源代码/StgSharp/Entities/IEntity.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using StgSharp.Math;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace StgSharp
-{
- public interface IEntity:INode
- {
- public IGeometry CollisionBox { get; set; }
-
- public Sensor CollisionSensor { get; set; }
-
- public string Texture { get; set; }
-
- public Vec2D Location { get; }
-
- public void SetLocation(Point p);
- }
-}
diff --git a/源代码/StgSharp/Entities/Partical.cs b/源代码/StgSharp/Entities/Partical.cs
index 16dc2a68..2f13949b 100644
--- a/源代码/StgSharp/Entities/Partical.cs
+++ b/源代码/StgSharp/Entities/Partical.cs
@@ -5,43 +5,8 @@ using System.Text;
namespace StgSharp
{
- public class Partical : IEntity
+ public class Partical : Entity
{
- internal IGeometry _collisionBox;
- internal Sensor _collisionSensor;
- internal string _texture;
- internal Vec2D _position;
- IGeometry IEntity.CollisionBox
- {
- get { return _collisionBox; }
- set { _collisionBox = value; }
- }
- Sensor IEntity.CollisionSensor
- {
- get { return _collisionSensor; }
- set { _collisionSensor = value; }
- }
- string IEntity.Texture
- {
- get { return _texture; }
- set { _texture = value; }
- }
- Vec2D IEntity.Location
- {
- get { return _position; }
- }
-
- ContainerNode INode.ID => throw new NotImplementedException();
-
- void INode.setID(ContainerNode id)
- {
- throw new NotImplementedException();
- }
-
- void IEntity.SetLocation(StgSharp.Point p)
- {
- this._position = p._position;
- }
}
}
diff --git a/源代码/StgSharp/Entities/Player.cs b/源代码/StgSharp/Entities/Player.cs
index a62e0d87..e07b7bb1 100644
--- a/源代码/StgSharp/Entities/Player.cs
+++ b/源代码/StgSharp/Entities/Player.cs
@@ -5,58 +5,8 @@ using System.Text;
namespace StgSharp
{
- public class Player : IEntity
+ public class Player : Entity
{
- internal IGeometry _collisionBox;
- internal Sensor _collisionSensor;
- internal string _texture;
- internal Vec2D _position;
- private ContainerNode _id;
-
- IGeometry IEntity.CollisionBox
- {
- get { return this._collisionBox; }
- set { this._collisionBox = value; }
- }
- Sensor IEntity.CollisionSensor
- {
- get { return this._collisionSensor; }
- set { this._collisionSensor = value; }
- }
- string IEntity.Texture
- {
- get { return this._texture; }
- set { this._texture = value; }
- }
- Vec2D IEntity.Location
- {
- get { return this._position; }
- }
-
- ContainerNode INode.ID
- {
- get { return _id; }
- }
-
- public void SetLocation(Point p)
- {
- throw new NotImplementedException();
- }
-
- void INode.setID(ContainerNode id)
- {
- if (id == null)
- {
- _id = id as ContainerNode;
- }
- else
- {
- throw new ArgumentException("Cannot set id twice!");
- }
- }
-
-
-
}
}
diff --git a/源代码/StgSharp/Geometries/Point.cs b/源代码/StgSharp/Geometries/Point.cs
index 09074cf3..9f48dc34 100644
--- a/源代码/StgSharp/Geometries/Point.cs
+++ b/源代码/StgSharp/Geometries/Point.cs
@@ -10,16 +10,16 @@ using System.Text;
namespace StgSharp
{
- public class Point: INode
+ public class Point: INode
{
- internal StgSharp.ContainerNode _id;
+ internal StgSharp.ContainerNode _id;
- internal Vec2D _position;
+ internal vec2d _position;
internal GetLocationHandler getXHandler;
internal GetLocationHandler getYHandler;
- ContainerNode INode.ID
+ ContainerNode INode.ID
{
get { return this._id; }
}
@@ -34,11 +34,11 @@ namespace StgSharp
get { return this._position.Y; }
}
- void INode.setID(ContainerNode id)
+ void INode.setID(ContainerNode id)
{
if (id == null)
{
- _id = id as ContainerNode;
+ _id = id as ContainerNode;
}
else
{
diff --git a/源代码/StgSharp/Vector/Cordination.cs b/源代码/StgSharp/Linear/Cordination.cs
similarity index 100%
rename from 源代码/StgSharp/Vector/Cordination.cs
rename to 源代码/StgSharp/Linear/Cordination.cs
diff --git a/源代码/StgSharp/Vector/Vector.Det.cs b/源代码/StgSharp/Linear/Vector.Det.cs
similarity index 74%
rename from 源代码/StgSharp/Vector/Vector.Det.cs
rename to 源代码/StgSharp/Linear/Vector.Det.cs
index 5544ba4f..e4fd6185 100644
--- a/源代码/StgSharp/Vector/Vector.Det.cs
+++ b/源代码/StgSharp/Linear/Vector.Det.cs
@@ -7,24 +7,24 @@ namespace StgSharp.Math
public static unsafe partial class Vector
{
- public static float Det(Matrix2x2 array)
+ public static float Det(matrix2x2 array)
{
return Cross(array.row1,array.row2);
}
- public static unsafe float Det(Matrix3x3 array)
+ public static unsafe float Det(matrix3x3 array)
{
float* p = &array.row1.X;
- Matrix2x2 matrix1 = new Matrix2x2(
+ matrix2x2 matrix1 = new matrix2x2(
*(p + 4), *(p + 5),
*(p + 7), *(p + 8)
);
- Matrix2x2 matrix2 = new Matrix2x2(
+ matrix2x2 matrix2 = new matrix2x2(
*(p + 3), *(p + 5),
*(p + 6), *(p + 8)
);
- Matrix2x2 matrix3 = new Matrix2x2(
+ matrix2x2 matrix3 = new matrix2x2(
*(p + 3), *(p + 4),
*(p + 6), *(p + 7)
);
diff --git a/源代码/StgSharp/Vector/Vector.GetAngle.cs b/源代码/StgSharp/Linear/Vector.GetAngle.cs
similarity index 79%
rename from 源代码/StgSharp/Vector/Vector.GetAngle.cs
rename to 源代码/StgSharp/Linear/Vector.GetAngle.cs
index 9ede311c..0064aa29 100644
--- a/源代码/StgSharp/Vector/Vector.GetAngle.cs
+++ b/源代码/StgSharp/Linear/Vector.GetAngle.cs
@@ -6,7 +6,7 @@ namespace StgSharp.Math
{
public static unsafe partial class Vector
{
- public static float GetAngle(Vec2D vec1, Vec2D vec2)
+ public static float GetAngle(vec2d vec1, vec2d vec2)
{
return Calc.ACos(
vec1 .multiple(vec2)
@@ -14,7 +14,7 @@ namespace StgSharp.Math
);
}
- public static float GetAngle(Vec3D vec1, Vec3D vec2)
+ public static float GetAngle(vec3d vec1, vec3d vec2)
{
return Calc.ACos(
vec1 * vec2
diff --git a/源代码/StgSharp/Vector/Vector.GetLength.cs b/源代码/StgSharp/Linear/Vector.GetLength.cs
similarity index 80%
rename from 源代码/StgSharp/Vector/Vector.GetLength.cs
rename to 源代码/StgSharp/Linear/Vector.GetLength.cs
index 94984734..e827b891 100644
--- a/源代码/StgSharp/Vector/Vector.GetLength.cs
+++ b/源代码/StgSharp/Linear/Vector.GetLength.cs
@@ -6,7 +6,7 @@ namespace StgSharp.Math
{
public static unsafe partial class Vector
{
- public static float GetLength(this Vec3D vec)
+ public static float GetLength(this vec3d vec)
{
return Calc.Sqrt(
vec.X * vec.X +
@@ -15,7 +15,7 @@ namespace StgSharp.Math
);
}
- public static float GetLength(this Vec2D vec)
+ public static float GetLength(this vec2d vec)
{
return Calc.Sqrt(
vec.X * vec.X +
diff --git a/源代码/StgSharp/Vector/Vector.GetVector.cs b/源代码/StgSharp/Linear/Vector.GetVector.cs
similarity index 81%
rename from 源代码/StgSharp/Vector/Vector.GetVector.cs
rename to 源代码/StgSharp/Linear/Vector.GetVector.cs
index e4c1879f..3b96d179 100644
--- a/源代码/StgSharp/Vector/Vector.GetVector.cs
+++ b/源代码/StgSharp/Linear/Vector.GetVector.cs
@@ -7,7 +7,7 @@ namespace StgSharp.Math
public static unsafe partial class Vector
{
/*
- public static Vec2D GetVector(Vec4D pointPair)
+ public static vec2d GetVector( vec4d pointPair)
{
return pointPair.Point2-pointPair.Point1;
}
diff --git a/源代码/StgSharp/Vector/Vector.Multiple.cs b/源代码/StgSharp/Linear/Vector.Multiple.cs
similarity index 62%
rename from 源代码/StgSharp/Vector/Vector.Multiple.cs
rename to 源代码/StgSharp/Linear/Vector.Multiple.cs
index 9e7cfbf6..1f4670d9 100644
--- a/源代码/StgSharp/Vector/Vector.Multiple.cs
+++ b/源代码/StgSharp/Linear/Vector.Multiple.cs
@@ -13,9 +13,9 @@ namespace StgSharp.Math
///
///
///
- public static Matrix2x2 multiple(this Colum2D colum, Vec2D vec)
+ public static matrix2x2 multiple(this colum2 colum, vec2d vec)
{
- return new Matrix2x2(
+ return new matrix2x2(
colum.X * vec.X, colum.X * vec.Y,
colum.Y * vec.X, colum.Y * vec.Y
);
@@ -27,7 +27,7 @@ namespace StgSharp.Math
///
///
///
- public static float multiple(this Vec2D vec1, Vec2D vec2)
+ public static float multiple(this vec2d vec1, vec2d vec2)
{
return vec1.X * vec2.X + vec1.Y * vec2.Y;
}
@@ -38,7 +38,7 @@ namespace StgSharp.Math
///
///
///
- public static float multiple(this Vec2D vec, Colum2D colum)
+ public static float multiple(this vec2d vec, colum2 colum)
{
return vec.X * colum.X + vec.Y * colum.Y;
}
@@ -49,15 +49,15 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Vec2D multiple(this Vec2D vec, Matrix2x2 matrix)
+ public static unsafe vec2d multiple(this vec2d vec, matrix2x2 matrix)
{
- return new Vec2D(
+ return new vec2d(
vec.X * matrix.row1.X + vec.Y * matrix.row2.X,
vec.X * matrix.row1.Y + vec.Y * matrix.row2.Y
);
}
- public static float multiple(this Vec3D vec, Colum3D colum)
+ public static float multiple(this vec3d vec, colum3 colum)
{
return vec.X * colum.X + vec.Y * colum.Y + vec.Z * colum.Z;
}
@@ -68,11 +68,11 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Vec3D multiple(this Vec2D vec, Matrix2x3 matrix)
+ public static unsafe vec3d multiple(this vec2d vec, matrix2x3 matrix)
{
float* p = &matrix.row1.X;
- return new Vec3D(
+ return new vec3d(
vec.X * *(p + 0) + vec.Y * *(p + 3),
vec.X * *(p + 1) + vec.Y * *(p + 4),
vec.X * *(p + 2) + vec.Y * *(p + 5)
@@ -85,11 +85,11 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Vec4D multiple(this Vec2D vec, Matrix2x4 matrix)
+ public static unsafe vec4d multiple(this vec2d vec, matrix2x4 matrix)
{
float* p = &matrix.row1.X;
- return new Vec4D(
+ return new vec4d(
vec.X * *(p + 0) + vec.Y * *(p + 4),
vec.X * *(p + 1) + vec.Y * *(p + 5),
vec.X * *(p + 2) + vec.Y * *(p + 6),
@@ -97,7 +97,7 @@ namespace StgSharp.Math
);
}
- public static unsafe float multiple(this Vec4D vec, Colum4D colum)
+ public static unsafe float multiple(this vec4d vec, colum4 colum)
{
return vec.X * colum.X + vec.Y * colum.Y + vec.Z * colum.W + vec.W * colum.W;
}
@@ -108,12 +108,12 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Colum2D multiple(this Matrix2x2 matrix, Colum2D colum)
+ public static unsafe colum2 multiple(this matrix2x2 matrix, colum2 colum)
{
float* p1 = &matrix.row1.X;
float* p2 = &colum.X;
- return new Colum2D(
+ return new colum2(
*(p1 + 0) * *(p2 + 0) + *(p1 + 1) * *(p2 + 1),
*(p1 + 2) * *(p2 + 0) + *(p1 + 3) * *(p2 + 1)
);
@@ -125,7 +125,7 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x2 multiple(this Matrix2x2 matrix1, Matrix2x2 matrix2)
+ public static unsafe matrix2x2 multiple(this matrix2x2 matrix1, matrix2x2 matrix2)
{
float* a11 = &matrix1.row1.X;
float* a12 = &matrix1.row1.Y;
@@ -163,7 +163,7 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix2x2(u1, u5, u6, u7);
+ return new matrix2x2(u1, u5, u6, u7);
}
@@ -173,7 +173,7 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x3 multiple(this Matrix2x2 matrix1, Matrix2x3 matrix2)
+ public static unsafe matrix2x3 multiple(this matrix2x2 matrix1, matrix2x3 matrix2)
{
float* p1 = &matrix1.row1.X;
@@ -184,10 +184,10 @@ namespace StgSharp.Math
float a21 = *(p1 + 2);
float a22 = *(p1 + 3);
- Vec2D b11 = new Vec2D(*(p2 + 0), *(p2 + 1));
- Vec2D b12 = new Vec2D(*(p2 + 2), 0);
- Vec2D b21 = new Vec2D(*(p2 + 3), *(p2 + 4));
- Vec2D b22 = new Vec2D(*(p2 + 5), 0);
+ vec2d b11 = new vec2d(*(p2 + 0), *(p2 + 1));
+ vec2d b12 = new vec2d(*(p2 + 2), 0);
+ vec2d b21 = new vec2d(*(p2 + 3), *(p2 + 4));
+ vec2d b22 = new vec2d(*(p2 + 5), 0);
var s1 = a21 + a22;
var s2 = s1 - a11;
@@ -215,7 +215,7 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix2x3(
+ return new matrix2x3(
u1.X, u1.Y, u5.X,
u6.X, u6.Y, u7.X
);
@@ -228,7 +228,7 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x4 multiple(this Matrix2x2 matrix1, Matrix2x4 matrix2)
+ public static unsafe matrix2x4 multiple(this matrix2x2 matrix1, matrix2x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
@@ -238,10 +238,10 @@ namespace StgSharp.Math
float a21 = *(p1 + 2);
float a22 = *(p1 + 3);
- Vec2D b11 = new Vec2D(*(p2 + 0), *(p2 + 1));
- Vec2D b12 = new Vec2D(*(p2 + 2), *(p2 + 3));
- Vec2D b21 = new Vec2D(*(p2 + 4), *(p2 + 5));
- Vec2D b22 = new Vec2D(*(p2 + 6), *(p2 + 7));
+ vec2d b11 = new vec2d(*(p2 + 0), *(p2 + 1));
+ vec2d b12 = new vec2d(*(p2 + 2), *(p2 + 3));
+ vec2d b21 = new vec2d(*(p2 + 4), *(p2 + 5));
+ vec2d b22 = new vec2d(*(p2 + 6), *(p2 + 7));
var s1 = a21 + a22;
var s2 = s1 - a11;
@@ -269,7 +269,7 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix2x4(
+ return new matrix2x4(
u1.X, u1.Y, u5.X, u5.Y,
u6.X, u6.Y, u7.X, u7.Y
);
@@ -281,9 +281,9 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Colum2D multiple(this Matrix2x3 matrix, Colum3D vec)
+ public static unsafe colum2 multiple(this matrix2x3 matrix, colum3 vec)
{
- return new Colum2D(
+ return new colum2(
matrix.row1.X * vec.X + matrix.row1.Y * vec.Y + matrix.row1.Z * vec.Z,
matrix.row2.X * vec.X + matrix.row2.Y * vec.Y + matrix.row2.Z * vec.Z
);
@@ -295,16 +295,16 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x2 multiple(this Matrix2x3 matrix1, Matrix3x2 matrix2)
+ public static unsafe matrix2x2 multiple(this matrix2x3 matrix1, matrix3x2 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Matrix2x2 a1 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- Colum2D a2 = new Colum2D(*(p1 + 2), *(p1 + 5));
+ matrix2x2 a1 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ colum2 a2 = new colum2(*(p1 + 2), *(p1 + 5));
- Matrix2x2 b1 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 2), *(p2 + 3));
- Vec2D b2 = new Vec2D(*(p2 + 4), *(p2 + 5));
+ matrix2x2 b1 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 2), *(p2 + 3));
+ vec2d b2 = new vec2d(*(p2 + 4), *(p2 + 5));
return a1.multiple(b1) + a2.multiple(b2);
}
@@ -315,23 +315,23 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x3 multiple(this Matrix2x3 matrix1, Matrix3x3 matrix2)
+ public static unsafe matrix2x3 multiple(this matrix2x3 matrix1, matrix3x3 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a1 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a2 = new Colum2D(*(p1 + 2), *(p1 + 5));
+ var a1 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a2 = new colum2(*(p1 + 2), *(p1 + 5));
- var b11 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
- var b12 = new Colum2D(*(p2 + 2), *(p2 + 5));
- var b21 = new Vec2D(*(p2 + 6), *(p2 + 7));
+ var b11 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
+ var b12 = new colum2(*(p2 + 2), *(p2 + 5));
+ var b21 = new vec2d(*(p2 + 6), *(p2 + 7));
var b22 = *(p2 + 8);
var c1 = a1.multiple(b11) + a2.multiple(b21);
var c2 = a1.multiple(b12) + a2 * b22;
- return new Matrix2x3(
+ return new matrix2x3(
c1.row1.X, c1.row1.Y, c2.X,
c1.row2.X, c1.row2.Y, c2.Y
);
@@ -343,31 +343,31 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x4 multiple(this Matrix2x3 matrix1, Matrix3x4 matrix2)
+ public static unsafe matrix2x4 multiple(this matrix2x3 matrix1, matrix3x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a1 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a2 = new Colum2D(*(p1 + 2), *(p1 + 5));
+ var a1 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a2 = new colum2(*(p1 + 2), *(p1 + 5));
- var b11 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 4), *(p2 + 5));
- var b12 = new Matrix2x2(*(p2 + 2), *(p2 + 3), *(p2 + 6), *(p2 + 7));
- var b21 = new Vec2D(*(p2 + 8), *(p2 + 9));
- var b22 = new Vec2D(*(p2 + 10), *(p2 + 11));
+ var b11 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 4), *(p2 + 5));
+ var b12 = new matrix2x2(*(p2 + 2), *(p2 + 3), *(p2 + 6), *(p2 + 7));
+ var b21 = new vec2d(*(p2 + 8), *(p2 + 9));
+ var b22 = new vec2d(*(p2 + 10), *(p2 + 11));
var c1 = a1.multiple(b11) + a2.multiple(b21);
var c2 = a1.multiple(b12) + a2.multiple(b22);
- return new Matrix2x4(
- new Vec4D(c1.row1,c2.row1),
- new Vec4D(c1.row2,c2.row2)
+ return new matrix2x4(
+ new vec4d(c1.row1,c2.row1),
+ new vec4d(c1.row2,c2.row2)
);
}
- public static unsafe Colum2D multiple(this Matrix2x4 matrix, Colum4D colum)
+ public static unsafe colum2 multiple(this matrix2x4 matrix, colum4 colum)
{
- return new Colum2D(
+ return new colum2(
matrix.row1.multiple(colum),
matrix.row2.multiple(colum)
);
@@ -379,20 +379,20 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x2 multiple(this Matrix2x4 matrix1, Matrix4x2 matrix2)
+ public static unsafe matrix2x2 multiple(this matrix2x4 matrix1, matrix4x2 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Vec2D a11 = new Vec2D(*(p1 + 0), *(p1 + 1));
- Vec2D a12 = new Vec2D(*(p1 + 2), *(p1 + 3));
- Vec2D a21 = new Vec2D(*(p1 + 4), *(p1 + 5));
- Vec2D a22 = new Vec2D(*(p1 + 6), *(p1 + 7));
+ vec2d a11 = new vec2d(*(p1 + 0), *(p1 + 1));
+ vec2d a12 = new vec2d(*(p1 + 2), *(p1 + 3));
+ vec2d a21 = new vec2d(*(p1 + 4), *(p1 + 5));
+ vec2d a22 = new vec2d(*(p1 + 6), *(p1 + 7));
- Colum2D b11 = new Colum2D(*(p2 + 0), *(p2 + 2));
- Colum2D b12 = new Colum2D(*(p2 + 1), *(p2 + 3));
- Colum2D b21 = new Colum2D(*(p2 + 4), *(p2 + 6));
- Colum2D b22 = new Colum2D(*(p2 + 5), *(p2 + 7));
+ colum2 b11 = new colum2(*(p2 + 0), *(p2 + 2));
+ colum2 b12 = new colum2(*(p2 + 1), *(p2 + 3));
+ colum2 b21 = new colum2(*(p2 + 4), *(p2 + 6));
+ colum2 b22 = new colum2(*(p2 + 5), *(p2 + 7));
var s1 = a21 + a22;
var s2 = s1 - a11;
@@ -420,7 +420,7 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix2x2(u1, u5, u6, u7);
+ return new matrix2x2(u1, u5, u6, u7);
}
///
@@ -429,12 +429,12 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x3 multiple(this Matrix2x4 matrix1, Matrix4x3 matrix2)
+ public static unsafe matrix2x3 multiple(this matrix2x4 matrix1, matrix4x3 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- return new Matrix2x3(
+ return new matrix2x3(
getMatrixMember(p1,p2), getMatrixMember(p1, p2+1), getMatrixMember(p1, p2+2),
getMatrixMember(p1+4, p2), getMatrixMember(p1+4, p2+1), getMatrixMember(p1+4, p2 + 2)
);
@@ -459,29 +459,29 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix2x4 multiple(this Matrix2x4 matrix1, Matrix4x4 matrix2)
+ public static unsafe matrix2x4 multiple(this matrix2x4 matrix1, matrix4x4 matrix2)
{
- Matrix2x2 a1 = new Matrix2x2(matrix1.row1.Point1,matrix1.row2.Point1);
- Matrix2x2 a2 = new Matrix2x2(matrix1.row1.Point2, matrix1.row2.Point2);
+ matrix2x2 a1 = new matrix2x2(matrix1.row1.Point1,matrix1.row2.Point1);
+ matrix2x2 a2 = new matrix2x2(matrix1.row1.Point2, matrix1.row2.Point2);
- Matrix2x2 b11 = new Matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
- Matrix2x2 b12 = new Matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
- Matrix2x2 b21 = new Matrix2x2(matrix2.row3.Point1, matrix2.row4.Point1);
- Matrix2x2 b22 = new Matrix2x2(matrix2.row3.Point2, matrix2.row4.Point2);
+ matrix2x2 b11 = new matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
+ matrix2x2 b12 = new matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
+ matrix2x2 b21 = new matrix2x2(matrix2.row3.Point1, matrix2.row4.Point1);
+ matrix2x2 b22 = new matrix2x2(matrix2.row3.Point2, matrix2.row4.Point2);
var c1 = a1.multiple(b11) + a2.multiple(b21);
var c2 = a1.multiple(b12) + a2.multiple(b22);
- return new Matrix2x4(
- new Vec4D(c1.row1, c2.row1),
- new Vec4D(c1.row2, c2.row2));
+ return new matrix2x4(
+ new vec4d(c1.row1, c2.row1),
+ new vec4d(c1.row2, c2.row2));
}
- public static unsafe Colum3D multiple(this Matrix3x2 matrix, Colum2D colum)
+ public static unsafe colum3 multiple(this matrix3x2 matrix, colum2 colum)
{
- return new Colum3D(
+ return new colum3(
matrix.row1.multiple(colum),
matrix.row1.multiple(colum),
matrix.row1.multiple(colum)
@@ -494,14 +494,14 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x2 multiple(this Matrix3x2 matrix1, Matrix2x2 matrix2)
+ public static unsafe matrix3x2 multiple(this matrix3x2 matrix1, matrix2x2 matrix2)
{
- var a1 = new Matrix2x2(matrix1.row1, matrix1.row2);
+ var a1 = new matrix2x2(matrix1.row1, matrix1.row2);
var a2 = matrix1.row3;
var c1 = a1.multiple(matrix2);
- return new Matrix3x2(
+ return new matrix3x2(
c1.row1, c1.row2, a2.multiple(matrix2)
);
}
@@ -512,16 +512,16 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x3 multiple(this Matrix3x2 matrix1, Matrix2x3 matrix2)
+ public static unsafe matrix3x3 multiple(this matrix3x2 matrix1, matrix2x3 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Matrix2x2 a1 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 2), *(p1 + 3));
- Vec2D a2 = new Vec2D(*(p1 + 4), *(p1 + 5));
+ matrix2x2 a1 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 2), *(p1 + 3));
+ vec2d a2 = new vec2d(*(p1 + 4), *(p1 + 5));
- Matrix2x2 b1 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
- Colum2D b2 = new Colum2D(*(p2 + 2), *(p2 + 5));
+ matrix2x2 b1 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
+ colum2 b2 = new colum2(*(p2 + 2), *(p2 + 5));
var m11 = a1.multiple(b1);
var m12 = a1.multiple(b2);
@@ -530,7 +530,7 @@ namespace StgSharp.Math
float* p3 = &m11.row1.X;
- return new Matrix3x3(
+ return new matrix3x3(
*(p3 + 0), *(p3 + 1),m12.X,
*(p3 + 2), *(p3 + 3),m12.Y,
m21.X, m21.Y, m22
@@ -543,29 +543,29 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x4 multiple(this Matrix3x2 matrix1, Matrix2x4 matrix2)
+ public static unsafe matrix3x4 multiple(this matrix3x2 matrix1, matrix2x4 matrix2)
{
- var a1 = new Matrix2x2(matrix1.row1,matrix1.row2);
+ var a1 = new matrix2x2(matrix1.row1,matrix1.row2);
var a2 = matrix1.row3;
- var b1 = new Matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
- var b2 = new Matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
+ var b1 = new matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
+ var b2 = new matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
var c11 = a1.multiple(b1);
var c12 = a1.multiple(b2);
var c21 = a2.multiple(b1);
var c22 = a2.multiple(b2);
- return new Matrix3x4(
- new Vec4D(c11.row1, c12.row1),
- new Vec4D(c11.row2, c12.row2),
- new Vec4D(c21, c22)
+ return new matrix3x4(
+ new vec4d(c11.row1, c12.row1),
+ new vec4d(c11.row2, c12.row2),
+ new vec4d(c21, c22)
);
}
- public static unsafe Colum3D multiple(this Matrix3x3 matrix, Colum3D colum)
+ public static unsafe colum3 multiple(this matrix3x3 matrix, colum3 colum)
{
- return new Colum3D(
+ return new colum3(
matrix.row1.multiple(colum),
matrix.row2.multiple(colum),
matrix.row3.multiple(colum)
@@ -578,22 +578,22 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x2 multiple(this Matrix3x3 matrix1, Matrix3x2 matrix2)
+ public static unsafe matrix3x2 multiple(this matrix3x3 matrix1, matrix3x2 matrix2)
{
float* p1 = &matrix1.row1.X;
- var a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a12 = new Colum2D(*(p1 + 2), *(p1 + 5));
- var a21 = new Vec2D(*(p1 + 6), *(p1 + 7));
+ var a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a12 = new colum2(*(p1 + 2), *(p1 + 5));
+ var a21 = new vec2d(*(p1 + 6), *(p1 + 7));
var a22 = *(p1 + 8);
- var b1 = new Matrix2x2(matrix2.row1,matrix2.row2);
+ var b1 = new matrix2x2(matrix2.row1,matrix2.row2);
var b2 = matrix2.row3;
var c1 = a11.multiple(b1) + a12.multiple(b2);
var c2 = a21.multiple(b1) + b2 * a22;
- return new Matrix3x2(c1.row1,c1.row2,c2);
+ return new matrix3x2(c1.row1,c1.row2,c2);
}
///
@@ -602,19 +602,19 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x3 multiple(this Matrix3x3 matrix1, Matrix3x3 matrix2)
+ public static unsafe matrix3x3 multiple(this matrix3x3 matrix1, matrix3x3 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Matrix2x2 a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- Colum2D a12 = new Colum2D(*(p1 + 2), *(p1 + 5));
- Vec2D a21 = new Vec2D(*(p1 + 6), *(p1 + 7));
+ matrix2x2 a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ colum2 a12 = new colum2(*(p1 + 2), *(p1 + 5));
+ vec2d a21 = new vec2d(*(p1 + 6), *(p1 + 7));
float a22 = *(p1 + 8);
- Matrix2x2 b11 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
- Colum2D b12 = new Colum2D(*(p2 + 2), *(p2 + 5));
- Vec2D b21 = new Vec2D(*(p2 + 6), *(p2 + 7));
+ matrix2x2 b11 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
+ colum2 b12 = new colum2(*(p2 + 2), *(p2 + 5));
+ vec2d b21 = new vec2d(*(p2 + 6), *(p2 + 7));
float b22 = *(p2 + 8);
var c11 = a11.multiple(b11) + a12.multiple(b21);
@@ -624,25 +624,25 @@ namespace StgSharp.Math
float* p = &(c11.row1.X);
- return new Matrix3x3(
+ return new matrix3x3(
*(p + 0), *(p + 1), c12.X,
*(p + 2), *(p + 3), c12.Y,
c21.X, c21.Y, c22
);
}
- public static unsafe Matrix3x4 multiple(this Matrix3x3 matrix1, Matrix3x4 matrix2)
+ public static unsafe matrix3x4 multiple(this matrix3x3 matrix1, matrix3x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a12 = new Colum2D(*(p1 + 2), *(p1 + 5));
- var a21 = new Vec2D(*(p1 + 6), *(p1 + 7));
+ var a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a12 = new colum2(*(p1 + 2), *(p1 + 5));
+ var a21 = new vec2d(*(p1 + 6), *(p1 + 7));
var a22 = *(p1 + 8);
- var b11 = new Matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
- var b12 = new Matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
+ var b11 = new matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
+ var b12 = new matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
var b21 = matrix2.row3.Point1;
var b22 = matrix2.row3.Point2;
@@ -652,17 +652,17 @@ namespace StgSharp.Math
var c22 = a21.multiple(b12) + b22 * a22;
- return new Matrix3x4(
- new Vec4D(c11.row1,c12.row1),
- new Vec4D(c11.row2,c12.row2),
- new Vec4D(c21,c22)
+ return new matrix3x4(
+ new vec4d(c11.row1,c12.row1),
+ new vec4d(c11.row2,c12.row2),
+ new vec4d(c21,c22)
);
}
- public static unsafe Colum3D multiple(this Matrix3x4 matrix, Colum4D colum)
+ public static unsafe colum3 multiple(this matrix3x4 matrix, colum4 colum)
{
- return new Colum3D(
+ return new colum3(
matrix.row1.multiple(colum),
matrix.row2.multiple(colum),
matrix.row3.multiple(colum)
@@ -675,23 +675,23 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x2 multiple(this Matrix3x4 matrix1, Matrix4x2 matrix2)
+ public static unsafe matrix3x2 multiple(this matrix3x4 matrix1, matrix4x2 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Matrix2x2 a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 4), *(p1 + 5));
- Matrix2x2 a12 = new Matrix2x2(*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7));
- Vec2D a21 = new Vec2D(*(p1 + 8), *(p1 + 9));
- Vec2D a22 = new Vec2D(*(p1 + 10), *(p1 + 11));
+ matrix2x2 a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 4), *(p1 + 5));
+ matrix2x2 a12 = new matrix2x2(*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7));
+ vec2d a21 = new vec2d(*(p1 + 8), *(p1 + 9));
+ vec2d a22 = new vec2d(*(p1 + 10), *(p1 + 11));
- Matrix2x2 b1 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 2), *(p2 + 3));
- Matrix2x2 b2 = new Matrix2x2(*(p2 + 4), *(p2 + 5), *(p2 + 6), *(p2 + 7));
+ matrix2x2 b1 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 2), *(p2 + 3));
+ matrix2x2 b2 = new matrix2x2(*(p2 + 4), *(p2 + 5), *(p2 + 6), *(p2 + 7));
var c1 = a11.multiple(b1) + a12.multiple(b2);
var c2 = a21.multiple(b1) + a22.multiple(b2);
- return new Matrix3x2(c1.row1,c1.row2,c2);
+ return new matrix3x2(c1.row1,c1.row2,c2);
}
///
@@ -700,28 +700,28 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x3 multiple(this Matrix3x4 matrix1, Matrix4x3 matrix2)
+ public static unsafe matrix3x3 multiple(this matrix3x4 matrix1, matrix4x3 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Matrix2x2 a11 = new Matrix2x2(
+ matrix2x2 a11 = new matrix2x2(
*(p1 + 0), *(p1 + 1), *(p1 + 4), *(p1 + 5)
);
- Matrix2x2 a12 = new Matrix2x2(
+ matrix2x2 a12 = new matrix2x2(
*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7)
);
- Vec2D a21 = new Vec2D(*(p1 + 8), *(p1 + 9));
- Vec2D a22 = new Vec2D(*(p1 + 10), *(p1 + 11));
+ vec2d a21 = new vec2d(*(p1 + 8), *(p1 + 9));
+ vec2d a22 = new vec2d(*(p1 + 10), *(p1 + 11));
- Matrix2x2 b11 = new Matrix2x2(
+ matrix2x2 b11 = new matrix2x2(
*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4)
);
- Colum2D b12 = new Colum2D(*(p2 + 2), *(p2 + 5));
- Matrix2x2 b21 = new Matrix2x2(
+ colum2 b12 = new colum2(*(p2 + 2), *(p2 + 5));
+ matrix2x2 b21 = new matrix2x2(
*(p2 + 6), *(p2 + 7), *(p2 + 9), *(p2 + 10)
);
- Colum2D b22 = new Colum2D(*(p2 + 8), *(p2 + 11));
+ colum2 b22 = new colum2(*(p2 + 8), *(p2 + 11));
var c11 = a11.multiple(b11) + a12.multiple(b21);
var c12 = a11.multiple(b12) + a12.multiple(b22);
@@ -730,7 +730,7 @@ namespace StgSharp.Math
float* pc1 = &c11.row1.X;
- return new Matrix3x3(
+ return new matrix3x3(
*(pc1 + 0), *(pc1 + 1), c12.X,
*(pc1 + 2), *(pc1 + 3), c12.Y,
c21.X, c21.Y, c22
@@ -743,41 +743,41 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix3x4 multiple(this Matrix3x4 matrix1, Matrix4x4 matrix2)
+ public static unsafe matrix3x4 multiple(this matrix3x4 matrix1, matrix4x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a11 = new Matrix2x2(matrix1.row1.Point1,matrix1.row2.Point1);
- var a12 = new Matrix2x2(matrix1.row1.Point2,matrix1.row2.Point2);
+ var a11 = new matrix2x2(matrix1.row1.Point1,matrix1.row2.Point1);
+ var a12 = new matrix2x2(matrix1.row1.Point2,matrix1.row2.Point2);
var a21 = matrix1.row3.Point1;
var a22 = matrix1.row3.Point2;
- var b11 = new Matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
- var b12 = new Matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
- var b21 = new Matrix2x2(matrix2.row3.Point1, matrix2.row4.Point1);
- var b22 = new Matrix2x2(matrix2.row3.Point2, matrix2.row4.Point2);
+ var b11 = new matrix2x2(matrix2.row1.Point1, matrix2.row2.Point1);
+ var b12 = new matrix2x2(matrix2.row1.Point2, matrix2.row2.Point2);
+ var b21 = new matrix2x2(matrix2.row3.Point1, matrix2.row4.Point1);
+ var b22 = new matrix2x2(matrix2.row3.Point2, matrix2.row4.Point2);
var c1 = a11.multiple(b11) + a12.multiple(b21);
var c2 = a11.multiple(b12) + a12.multiple(b22);
var c3 = a21.multiple(b11) + a22.multiple(b21);
var c4 = a21.multiple(b12) + a22.multiple(b22);
- return new Matrix3x4(
- new Vec4D(c1.row1,c2.row1),
- new Vec4D(c1.row2,c2.row2),
- new Vec4D(c3,c4)
+ return new matrix3x4(
+ new vec4d(c1.row1,c2.row1),
+ new vec4d(c1.row2,c2.row2),
+ new vec4d(c3,c4)
) ;
}
- public static unsafe Matrix4x2 multiple(this Matrix4x2 matrix1, Matrix2x2 matrix2)
+ public static unsafe matrix4x2 multiple(this matrix4x2 matrix1, matrix2x2 matrix2)
{
float* p = &matrix1.row1.X;
- var a11 = new Colum2D(*(p + 0), *(p + 2));
- var a12 = new Colum2D(*(p + 1), *(p + 3));
- var a21 = new Colum2D(*(p + 4), *(p + 6));
- var a22 = new Colum2D(*(p + 5), *(p + 7));
+ var a11 = new colum2(*(p + 0), *(p + 2));
+ var a12 = new colum2(*(p + 1), *(p + 3));
+ var a21 = new colum2(*(p + 4), *(p + 6));
+ var a22 = new colum2(*(p + 5), *(p + 7));
var b11 = matrix2.row1.X;
var b12 = matrix2.row1.Y;
@@ -810,23 +810,23 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix4x2(
- new Vec2D(u1.X,u5.X),
- new Vec2D(u1.Y,u5.Y),
- new Vec2D(u6.X,u7.X),
- new Vec2D(u6.Y,u7.Y)
+ return new matrix4x2(
+ new vec2d(u1.X,u5.X),
+ new vec2d(u1.Y,u5.Y),
+ new vec2d(u6.X,u7.X),
+ new vec2d(u6.Y,u7.Y)
);
}
- public static unsafe Matrix4x3 multiple(this Matrix4x2 matrix1, Matrix2x3 matrix2)
+ public static unsafe matrix4x3 multiple(this matrix4x2 matrix1, matrix2x3 matrix2)
{
float* p = &matrix2.row1.X;
- var a1 = new Matrix2x2(matrix1.row1, matrix1.row2);
- var a2 = new Matrix2x2(matrix1.row3, matrix1.row4);
+ var a1 = new matrix2x2(matrix1.row1, matrix1.row2);
+ var a2 = new matrix2x2(matrix1.row3, matrix1.row4);
- var b1 = new Matrix2x2(*(p + 0), *(p + 1), *(p + 3), *(p + 4));
- var b2 = new Colum2D(*(p + 2), *(p + 5));
+ var b1 = new matrix2x2(*(p + 0), *(p + 1), *(p + 3), *(p + 4));
+ var b2 = new colum2(*(p + 2), *(p + 5));
var c11 = a1.multiple(b1);
var c12 = a1.multiple(b2);
@@ -836,7 +836,7 @@ namespace StgSharp.Math
float* pc1 = &c11.row1.X;
float* pc2 = &c21.row1.X;
- return new Matrix4x3(
+ return new matrix4x3(
*(pc1 + 0), *(pc1 + 1),c12.X,
*(pc1 + 2), *(pc1 + 3),c12.Y,
*(pc2 + 0), *(pc2 + 1),c22.X,
@@ -850,20 +850,20 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix4x4 multiple(this Matrix4x2 matrix1, Matrix2x4 matrix2)
+ public static unsafe matrix4x4 multiple(this matrix4x2 matrix1, matrix2x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Colum2D a11 = new Colum2D(*(p1 + 0), *(p1 + 2));
- Colum2D a12 = new Colum2D(*(p1 + 1), *(p1 + 3));
- Colum2D a21 = new Colum2D(*(p1 + 4), *(p1 + 6));
- Colum2D a22 = new Colum2D(*(p1 + 5), *(p1 + 7));
+ colum2 a11 = new colum2(*(p1 + 0), *(p1 + 2));
+ colum2 a12 = new colum2(*(p1 + 1), *(p1 + 3));
+ colum2 a21 = new colum2(*(p1 + 4), *(p1 + 6));
+ colum2 a22 = new colum2(*(p1 + 5), *(p1 + 7));
- Vec2D b11 = new Vec2D(*(p2 + 0), *(p2 + 1));
- Vec2D b12 = new Vec2D(*(p2 + 2), *(p2 + 3));
- Vec2D b21 = new Vec2D(*(p2 + 4), *(p2 + 5));
- Vec2D b22 = new Vec2D(*(p2 + 6), *(p2 + 7));
+ vec2d b11 = new vec2d(*(p2 + 0), *(p2 + 1));
+ vec2d b12 = new vec2d(*(p2 + 2), *(p2 + 3));
+ vec2d b21 = new vec2d(*(p2 + 4), *(p2 + 5));
+ vec2d b22 = new vec2d(*(p2 + 6), *(p2 + 7));
var s1 = a21 + a22;
var s2 = s1 - a11;
@@ -891,47 +891,47 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix4x4(
- new Vec4D(u1.row1.X, u1.row1.Y, u5.row1.X, u5.row1.Y),
- new Vec4D(u1.row2.X, u1.row2.Y, u5.row2.X, u5.row2.Y),
- new Vec4D(u6.row1.X, u6.row1.Y, u7.row1.X, u7.row1.Y),
- new Vec4D(u6.row2.X, u6.row2.Y, u7.row2.X, u7.row2.Y)
+ return new matrix4x4(
+ new vec4d(u1.row1.X, u1.row1.Y, u5.row1.X, u5.row1.Y),
+ new vec4d(u1.row2.X, u1.row2.Y, u5.row2.X, u5.row2.Y),
+ new vec4d(u6.row1.X, u6.row1.Y, u7.row1.X, u7.row1.Y),
+ new vec4d(u6.row2.X, u6.row2.Y, u7.row2.X, u7.row2.Y)
);
}
- public static unsafe Matrix4x2 multiple(this Matrix4x3 matrix1, Matrix3x2 matrix2)
+ public static unsafe matrix4x2 multiple(this matrix4x3 matrix1, matrix3x2 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a12 = new Colum2D(*(p1 + 2), *(p1 + 5));
- var a21 = new Matrix2x2(*(p1 + 6), *(p1 + 7), *(p1 + 9), *(p1 + 10));
- var a22 = new Colum2D(*(p1 + 8), *(p1 + 11));
+ var a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a12 = new colum2(*(p1 + 2), *(p1 + 5));
+ var a21 = new matrix2x2(*(p1 + 6), *(p1 + 7), *(p1 + 9), *(p1 + 10));
+ var a22 = new colum2(*(p1 + 8), *(p1 + 11));
- var b1 = new Matrix2x2(*(p2 + 0), *(p2 + 0), *(p2 + 0), *(p2 + 0));
+ var b1 = new matrix2x2(*(p2 + 0), *(p2 + 0), *(p2 + 0), *(p2 + 0));
var b2 = matrix2.row3;
var c1 = a11.multiple(b1) + a12.multiple(b2);
var c2 = a21.multiple(b1) + a22.multiple(b2);
- return new Matrix4x2(c1.row1,c1.row2,c2.row1,c2.row2);
+ return new matrix4x2(c1.row1,c1.row2,c2.row1,c2.row2);
}
- public static unsafe Matrix4x3 multiple(this Matrix4x3 matrix1, Matrix3x3 matrix2)
+ public static unsafe matrix4x3 multiple(this matrix4x3 matrix1, matrix3x3 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a12 = new Colum2D(*(p1 + 2), *(p1 + 5));
- var a21 = new Matrix2x2(*(p1 + 6), *(p1 + 7), *(p1 + 9), *(p1 + 10));
- var a22 = new Colum2D(*(p1 + 8), *(p1 + 11));
+ var a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a12 = new colum2(*(p1 + 2), *(p1 + 5));
+ var a21 = new matrix2x2(*(p1 + 6), *(p1 + 7), *(p1 + 9), *(p1 + 10));
+ var a22 = new colum2(*(p1 + 8), *(p1 + 11));
- var b11 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
- var b12 = new Colum2D(*(p2 + 2), *(p2 + 5));
- var b21 = new Vec2D(*(p2 + 9), *(p2 + 10));
+ var b11 = new matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 3), *(p2 + 4));
+ var b12 = new colum2(*(p2 + 2), *(p2 + 5));
+ var b21 = new vec2d(*(p2 + 9), *(p2 + 10));
var b22 = matrix2.row3.Z;
var c11 = a11.multiple(b11) + a12.multiple(b21);
@@ -942,7 +942,7 @@ namespace StgSharp.Math
float* p3 = &c11.row1.X;
float* p4 = &c21.row1.X;
- return new Matrix4x3(
+ return new matrix4x3(
*(p3 + 0), *(p3 + 1),c12.X,
*(p3 + 2), *(p3 + 3),c12.Y,
*(p4 + 0), *(p4 + 1),c22.X,
@@ -950,18 +950,18 @@ namespace StgSharp.Math
);
}
- public static unsafe Matrix4x4 multiple(this Matrix4x3 matrix1, Matrix3x4 matrix2)
+ public static unsafe matrix4x4 multiple(this matrix4x3 matrix1, matrix3x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- var a11 = new Matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
- var a12 = new Colum2D(*(p1 + 2), *(p1 + 5));
- var a21 = new Matrix2x2(*(p1 + 6), *(p1 + 7), *(p1 + 9), *(p1 + 10));
- var a22 = new Colum2D(*(p1 + 8), *(p1 + 11));
+ var a11 = new matrix2x2(*(p1 + 0), *(p1 + 1), *(p1 + 3), *(p1 + 4));
+ var a12 = new colum2(*(p1 + 2), *(p1 + 5));
+ var a21 = new matrix2x2(*(p1 + 6), *(p1 + 7), *(p1 + 9), *(p1 + 10));
+ var a22 = new colum2(*(p1 + 8), *(p1 + 11));
- var b11 = new Matrix2x2(*(p2 + 0), *(p2 + 1), *(p2 + 4), *(p2 + 5));
- var b12 = new Matrix2x2(*(p2 + 2), *(p2 + 3), *(p2 + 6), *(p2 + 7));
+ var b11 = new matrix2x2 (*(p2 + 0), *(p2 + 1), *(p2 + 4), *(p2 + 5));
+ var b12 = new matrix2x2(*(p2 + 2), *(p2 + 3), *(p2 + 6), *(p2 + 7));
var b21 = matrix2.row3.Point1;
var b22 = matrix2.row3.Point2;
@@ -970,11 +970,11 @@ namespace StgSharp.Math
var c21 = a21.multiple(b11) + a22.multiple(b21);
var c22 = a21.multiple(b12) + a22.multiple(b22);
- return new Matrix4x4(
- new Vec4D(c11.row1, c12.row1),
- new Vec4D(c11.row2, c12.row2),
- new Vec4D(c21.row1, c22.row1),
- new Vec4D(c21.row2, c22.row2)
+ return new matrix4x4(
+ new vec4d(c11.row1, c12.row1),
+ new vec4d(c11.row2, c12.row2),
+ new vec4d(c21.row1, c22.row1),
+ new vec4d(c21.row2, c22.row2)
);
}
@@ -984,20 +984,20 @@ namespace StgSharp.Math
///
///
///
- public static unsafe Matrix4x4 multiple(this Matrix4x4 matrix1, Matrix4x4 matrix2)
+ public static unsafe matrix4x4 multiple(this matrix4x4 matrix1, matrix4x4 matrix2)
{
float* p1 = &matrix1.row1.X;
float* p2 = &matrix2.row1.X;
- Matrix2x2 a11 = new Matrix2x2(*p1, *(p1 + 1), *(p1 + 4), *(p1 + 5));
- Matrix2x2 a12 = new Matrix2x2(*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7));
- Matrix2x2 a21 = new Matrix2x2(*(p1 + 8), *(p1 + 9), *(p1 + 12), *(p1 + 13));
- Matrix2x2 a22 = new Matrix2x2(*(p1 + 10), *(p1 + 11), *(p1 + 14), *(p1 + 15));
+ matrix2x2 a11 = new matrix2x2(*p1, *(p1 + 1), *(p1 + 4), *(p1 + 5));
+ matrix2x2 a12 = new matrix2x2(*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7));
+ matrix2x2 a21 = new matrix2x2(*(p1 + 8), *(p1 + 9), *(p1 + 12), *(p1 + 13));
+ matrix2x2 a22 = new matrix2x2(*(p1 + 10), *(p1 + 11), *(p1 + 14), *(p1 + 15));
- Matrix2x2 b11 = new Matrix2x2(*p1, *(p1 + 1), *(p1 + 4), *(p1 + 5));
- Matrix2x2 b12 = new Matrix2x2(*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7));
- Matrix2x2 b21 = new Matrix2x2(*(p1 + 8), *(p1 + 9), *(p1 + 12), *(p1 + 13));
- Matrix2x2 b22 = new Matrix2x2(*(p1 + 10), *(p1 + 11), *(p1 + 14), *(p1 + 15));
+ matrix2x2 b11 = new matrix2x2(*p1, *(p1 + 1), *(p1 + 4), *(p1 + 5));
+ matrix2x2 b12 = new matrix2x2(*(p1 + 2), *(p1 + 3), *(p1 + 6), *(p1 + 7));
+ matrix2x2 b21 = new matrix2x2(*(p1 + 8), *(p1 + 9), *(p1 + 12), *(p1 + 13));
+ matrix2x2 b22 = new matrix2x2(*(p1 + 10), *(p1 + 11), *(p1 + 14), *(p1 + 15));
var s1 = a21 + a22;
var s2 = s1 - a11;
@@ -1025,11 +1025,11 @@ namespace StgSharp.Math
var u6 = u3 - m4;
var u7 = u3 + m5;
- return new Matrix4x4(
- new Vec4D(u1.row1.X, u1.row1.Y, u5.row1.X, u5.row1.Y),
- new Vec4D(u1.row2.X, u1.row2.Y, u5.row2.X, u5.row2.Y),
- new Vec4D(u6.row1.X, u6.row1.Y, u7.row1.X, u7.row1.Y),
- new Vec4D(u6.row2.X, u6.row2.Y, u7.row2.X, u7.row2.Y)
+ return new matrix4x4(
+ new vec4d(u1.row1.X, u1.row1.Y, u5.row1.X, u5.row1.Y),
+ new vec4d(u1.row2.X, u1.row2.Y, u5.row2.X, u5.row2.Y),
+ new vec4d(u6.row1.X, u6.row1.Y, u7.row1.X, u7.row1.Y),
+ new vec4d(u6.row2.X, u6.row2.Y, u7.row2.X, u7.row2.Y)
);
}
diff --git a/源代码/StgSharp/Vector/Vector.VectorTransform.cs b/源代码/StgSharp/Linear/Vector.VectorTransform.cs
similarity index 51%
rename from 源代码/StgSharp/Vector/Vector.VectorTransform.cs
rename to 源代码/StgSharp/Linear/Vector.VectorTransform.cs
index 9e070bea..444431cf 100644
--- a/源代码/StgSharp/Vector/Vector.VectorTransform.cs
+++ b/源代码/StgSharp/Linear/Vector.VectorTransform.cs
@@ -7,36 +7,36 @@ namespace StgSharp.Math
{
public static unsafe partial class Vector
{
- public static Vec3D To3D(this Vec2D vec)
+ public static vec3d To3D(this vec2d vec)
{
- return new Vec3D(vec.X, vec.Y, 0.0f);
+ return new vec3d(vec.X, vec.Y, 0.0f);
}
- public static Vec4D To4D(this Vec2D Vec)
+ public static vec4d To4D(this vec2d Vec)
{
- return new Vec4D(Vec.X, Vec.Y, 0, 0);
+ return new vec4d(Vec.X, Vec.Y, 0, 0);
}
- public static Vec4D To4D(this Vec3D vec)
+ public static vec4d To4D(this vec3d vec)
{
- return new Vec4D(vec.X, vec.Y, vec.Z, 0);
+ return new vec4d(vec.X, vec.Y, vec.Z, 0);
}
- public static Vec2D To2D(Vec3D vec, CordinatePlain plain)
+ public static vec2d To2D(vec3d vec, CordinatePlain plain)
{
switch (plain)
{
case CordinatePlain.XY:
- return new Vec2D(vec.X, vec.Y);
+ return new vec2d(vec.X, vec.Y);
break;
case CordinatePlain.YZ:
- return new Vec2D(vec.Y, vec.Z);
+ return new vec2d(vec.Y, vec.Z);
break;
case CordinatePlain.XZ:
- return new Vec2D(vec.X, vec.Z);
+ return new vec2d(vec.X, vec.Z);
break;
default:
- return default(Vec2D);
+ return default(vec2d);
break;
}
}
diff --git a/源代码/StgSharp/Vector/Verctor.Cross.cs b/源代码/StgSharp/Linear/Verctor.Cross.cs
similarity index 74%
rename from 源代码/StgSharp/Vector/Verctor.Cross.cs
rename to 源代码/StgSharp/Linear/Verctor.Cross.cs
index 836fecf1..d2dbe18c 100644
--- a/源代码/StgSharp/Vector/Verctor.Cross.cs
+++ b/源代码/StgSharp/Linear/Verctor.Cross.cs
@@ -7,14 +7,14 @@ namespace StgSharp.Math
public static unsafe partial class Vector
{
- public static float Cross(Vec2D vec1, Vec2D vec2)
+ public static float Cross(vec2d vec1, vec2d vec2)
{
return vec1.X * vec2.Y - vec1.Y * vec2.X;
}
- public static Vec3D Cross(Vec3D vec1, Vec3D vec2)
+ public static vec3d Cross(vec3d vec1, vec3d vec2)
{
- return new Vec3D(
+ return new vec3d(
vec1.Y * vec2.Z - vec1.Z * vec2.Y,
vec1.X * vec2.Z - vec1.Z * vec2.X,
vec1.X * vec2.Y - vec1.Y * vec2.X
diff --git a/源代码/StgSharp/Vector/Colum2D.cs b/源代码/StgSharp/Linear/colum2.cs
similarity index 65%
rename from 源代码/StgSharp/Vector/Colum2D.cs
rename to 源代码/StgSharp/Linear/colum2.cs
index 2357b0ca..0b684709 100644
--- a/源代码/StgSharp/Vector/Colum2D.cs
+++ b/源代码/StgSharp/Linear/colum2.cs
@@ -6,14 +6,14 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Colum2D:IEquatable
+ public struct colum2:IEquatable
{
[FieldOffset(0)]
public float X;
[FieldOffset(4)]
public float Y;
- public Colum2D(float x,float y)
+ public colum2(float x,float y)
{
X= x;
Y= y;
@@ -25,17 +25,17 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Colum2D))
+ else if (obj.GetType() != typeof(colum2))
{
return false;
}
else
{
- return this.Equals((Colum2D)obj);
+ return this.Equals((colum2)obj);
}
}
- bool IEquatable.Equals(Colum2D other)
+ bool IEquatable.Equals(colum2 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -57,30 +57,30 @@ namespace StgSharp.Math
return $"{X}\n{Y}";
}
- public static Colum2D operator +(Colum2D c1,Colum2D c2)
+ public static colum2 operator +(colum2 c1,colum2 c2)
{
- return new Colum2D(
+ return new colum2(
c1.X + c2.X,
c1.Y + c2.Y
);
}
- public static Colum2D operator -(Colum2D c1, Colum2D c2)
+ public static colum2 operator -(colum2 c1, colum2 c2)
{
- return new Colum2D(
+ return new colum2(
c1.X - c2.X,
c1.Y - c2.Y
);
}
- public static Colum2D operator *(Colum2D colum, float x)
+ public static colum2 operator *(colum2 colum, float x)
{
- return new Colum2D(colum.X * x,colum.Y * x);
+ return new colum2(colum.X * x,colum.Y * x);
}
- public static Colum2D operator /(Colum2D colum, float x)
+ public static colum2 operator /(colum2 colum, float x)
{
- return new Colum2D(colum.X / x, colum.Y / x);
+ return new colum2(colum.X / x, colum.Y / x);
}
}
}
diff --git a/源代码/StgSharp/Vector/Colum3D.cs b/源代码/StgSharp/Linear/colum3.cs
similarity index 71%
rename from 源代码/StgSharp/Vector/Colum3D.cs
rename to 源代码/StgSharp/Linear/colum3.cs
index 3a0c7acb..4ce9fffb 100644
--- a/源代码/StgSharp/Vector/Colum3D.cs
+++ b/源代码/StgSharp/Linear/colum3.cs
@@ -6,7 +6,7 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Colum3D : IEquatable
+ public struct colum3 : IEquatable
{
[FieldOffset(0)]
public float X;
@@ -15,14 +15,14 @@ namespace StgSharp.Math
[FieldOffset(8)]
public float Z;
- public Colum3D(float x, float y, float z)
+ public colum3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
}
- bool IEquatable.Equals(Colum3D other)
+ bool IEquatable.Equals(colum3 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -42,13 +42,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Colum3D))
+ else if (obj.GetType() != typeof(colum3))
{
return false;
}
else
{
- return this.Equals((Colum3D)obj);
+ return this.Equals((colum3)obj);
}
}
@@ -62,39 +62,39 @@ namespace StgSharp.Math
return $"{X}\t{Y}\t{Z}";
}
- public static bool operator ==(Colum3D vec1, Colum3D vec2)
+ public static bool operator ==(colum3 vec1, colum3 vec2)
{
return vec1.X == vec2.X
&& vec1.Y == vec2.Y
&& vec1.Z == vec2.Z;
}
- public static bool operator !=(Colum3D vec1, Colum3D vec2)
+ public static bool operator !=(colum3 vec1, colum3 vec2)
{
return !(vec1.X == vec2.X
&& vec1.Y == vec2.Y
&& vec1.Z == vec2.Z);
}
- public static Colum3D operator +(Colum3D vec1, Colum3D vec2)
+ public static colum3 operator +(colum3 vec1, colum3 vec2)
{
- return new Colum3D(
+ return new colum3(
vec1.X + vec2.X,
vec1.Y + vec2.Y,
vec1.Z + vec2.Z
);
}
- public static Colum3D operator -(Colum3D vec1, Colum3D vec2)
+ public static colum3 operator -(colum3 vec1, colum3 vec2)
{
- return new Colum3D(
+ return new colum3(
vec1.X - vec2.X,
vec1.Y - vec2.Y,
vec1.Z - vec2.Z
);
}
- public static float operator *(Colum3D vec1, Colum3D vec2)
+ public static float operator *(colum3 vec1, colum3 vec2)
{
return
vec1.X * vec2.X
@@ -102,18 +102,18 @@ namespace StgSharp.Math
+ vec1.Z + vec2.Z;
}
- public static Colum3D operator *(Colum3D vec, float x)
+ public static colum3 operator *(colum3 vec, float x)
{
- return new Colum3D(
+ return new colum3(
vec.X * x,
vec.Y * x,
vec.Z * x
);
}
- public static Colum3D operator /(Colum3D vec, float x)
+ public static colum3 operator /(colum3 vec, float x)
{
- return new Colum3D(
+ return new colum3(
vec.X / x,
vec.Y / x,
vec.Z / x
diff --git a/源代码/StgSharp/Vector/Colum4D.cs b/源代码/StgSharp/Linear/colum4.cs
similarity index 85%
rename from 源代码/StgSharp/Vector/Colum4D.cs
rename to 源代码/StgSharp/Linear/colum4.cs
index abe006a2..fe36594f 100644
--- a/源代码/StgSharp/Vector/Colum4D.cs
+++ b/源代码/StgSharp/Linear/colum4.cs
@@ -7,7 +7,7 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Colum4D:IEquatable
+ public struct colum4:IEquatable
{
[FieldOffset(0)]
public float X;
@@ -18,7 +18,7 @@ namespace StgSharp.Math
[FieldOffset(12)]
public float W;
- public Colum4D(float x, float y, float z, float w)
+ public colum4(float x, float y, float z, float w)
{
X = x;
Y = y;
@@ -26,7 +26,7 @@ namespace StgSharp.Math
W = w;
}
- public bool Equals(Colum4D other)
+ public bool Equals(colum4 other)
{
throw new NotImplementedException();
}
diff --git a/源代码/StgSharp/Vector/Matrix2x2.cs b/源代码/StgSharp/Linear/matrix2x2.cs
similarity index 71%
rename from 源代码/StgSharp/Vector/Matrix2x2.cs
rename to 源代码/StgSharp/Linear/matrix2x2.cs
index e42d605c..89af84c4 100644
--- a/源代码/StgSharp/Vector/Matrix2x2.cs
+++ b/源代码/StgSharp/Linear/matrix2x2.cs
@@ -7,32 +7,32 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix2x2:IEquatable
+ public struct matrix2x2:IEquatable
{
[FieldOffset(0)]
- public Vec2D row1;
+ public vec2d row1;
[FieldOffset(8)]
- public Vec2D row2;
+ public vec2d row2;
- public Matrix2x2(Vec2D c0, Vec2D c1)
+ public matrix2x2(vec2d c0, vec2d c1)
{
row1 = c0;
row2 = c1;
}
- public Matrix2x2(
+ public matrix2x2(
float a11,
float a12,
float a21,
float a22
)
{
- row1 = new Vec2D(a11, a12);
- row2 = new Vec2D(a21, a22);
+ row1 = new vec2d(a11, a12);
+ row2 = new vec2d(a21, a22);
}
- bool IEquatable.Equals(Matrix2x2 other)
+ bool IEquatable.Equals(matrix2x2 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -52,13 +52,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix2x2))
+ else if (obj.GetType() != typeof(matrix2x2))
{
return false;
}
else
{
- return this.Equals((Vec3D)obj);
+ return this.Equals((vec3d)obj);
}
}
@@ -72,17 +72,17 @@ namespace StgSharp.Math
return $"{row1}\n{row2}";
}
- public static Matrix2x2 operator +(Matrix2x2 matrix1 , Matrix2x2 matrix2)
+ public static matrix2x2 operator +(matrix2x2 matrix1 , matrix2x2 matrix2)
{
- return new Matrix2x2(
+ return new matrix2x2(
matrix1.row1 + matrix2.row1,
matrix1.row2 + matrix2.row2
);
}
- public static Matrix2x2 operator -(Matrix2x2 matrix1, Matrix2x2 matrix2)
+ public static matrix2x2 operator -(matrix2x2 matrix1, matrix2x2 matrix2)
{
- return new Matrix2x2(
+ return new matrix2x2(
matrix1.row1 - matrix2.row1,
matrix1.row2 - matrix2.row2
);
diff --git a/源代码/StgSharp/Vector/Matrix2x3.cs b/源代码/StgSharp/Linear/matrix2x3.cs
similarity index 68%
rename from 源代码/StgSharp/Vector/Matrix2x3.cs
rename to 源代码/StgSharp/Linear/matrix2x3.cs
index fcc91355..b60bc038 100644
--- a/源代码/StgSharp/Vector/Matrix2x3.cs
+++ b/源代码/StgSharp/Linear/matrix2x3.cs
@@ -7,26 +7,26 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix2x3:IEquatable
+ public struct matrix2x3:IEquatable
{
[FieldOffset(0)]
- public Vec3D row1;
+ public vec3d row1;
[FieldOffset(12)]
- public Vec3D row2;
+ public vec3d row2;
- public Matrix2x3(Vec3D r1, Vec3D r2)
+ public matrix2x3(vec3d r1, vec3d r2)
{
row1 = r1;
row2 = r2;
}
- public Matrix2x3(
+ public matrix2x3(
float r11, float r12, float r13,
float r21, float r22, float r23
)
{
- row1 = new Vec3D(r11, r12, r13);
- row2 = new Vec3D(r21, r22, r23);
+ row1 = new vec3d(r11, r12, r13);
+ row2 = new vec3d(r21, r22, r23);
}
public override bool Equals(object obj)
@@ -35,13 +35,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix2x3))
+ else if (obj.GetType() != typeof(matrix2x3))
{
return false;
}
else
{
- return this.Equals((Vec3D)obj);
+ return this.Equals((vec3d)obj);
}
}
@@ -55,7 +55,7 @@ namespace StgSharp.Math
return $"{row1}\n{row2}";
}
- bool IEquatable.Equals(Matrix2x3 other)
+ bool IEquatable.Equals(matrix2x3 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -69,33 +69,33 @@ namespace StgSharp.Math
}
}
- public static Matrix2x3 operator +(Matrix2x3 matrix1, Matrix2x3 matrix2)
+ public static matrix2x3 operator +(matrix2x3 matrix1, matrix2x3 matrix2)
{
- return new Matrix2x3(
+ return new matrix2x3(
matrix1.row1 + matrix2.row1,
matrix1.row2 + matrix2.row2
);
}
- public static Matrix2x3 operator -(Matrix2x3 matrix1, Matrix2x3 matrix2)
+ public static matrix2x3 operator -(matrix2x3 matrix1, matrix2x3 matrix2)
{
- return new Matrix2x3(
+ return new matrix2x3(
matrix1.row1 - matrix2.row1,
matrix1.row2 - matrix2.row2
);
}
- public static Matrix2x3 operator *(Matrix2x3 array, float x)
+ public static matrix2x3 operator *(matrix2x3 array, float x)
{
- return new Matrix2x3(
+ return new matrix2x3(
array.row1 * x,
array.row2 * x
) ;
}
- public static Matrix2x3 operator /(Matrix2x3 array, float x)
+ public static matrix2x3 operator /(matrix2x3 array, float x)
{
- return new Matrix2x3(
+ return new matrix2x3(
array.row1 / x,
array.row2 / x
);
diff --git a/源代码/StgSharp/Vector/Matrix2x4.cs b/源代码/StgSharp/Linear/matrix2x4.cs
similarity index 68%
rename from 源代码/StgSharp/Vector/Matrix2x4.cs
rename to 源代码/StgSharp/Linear/matrix2x4.cs
index 020d6188..840cf16c 100644
--- a/源代码/StgSharp/Vector/Matrix2x4.cs
+++ b/源代码/StgSharp/Linear/matrix2x4.cs
@@ -7,29 +7,29 @@ namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix2x4 : IEquatable
+ public struct matrix2x4 : IEquatable
{
[FieldOffset(0)]
- public Vec4D row1;
+ public vec4d row1;
[FieldOffset(16)]
- public Vec4D row2;
+ public vec4d row2;
- public Matrix2x4(Vec4D r1,Vec4D r2)
+ public matrix2x4( vec4d r1, vec4d r2)
{
row1 = r1;
row2 = r2;
}
- public Matrix2x4(
+ public matrix2x4(
float a11, float a12, float a13, float a14,
float a21, float a22, float a23, float a24
)
{
- row1 = new Vec4D(a11,a12,a13,a14);
- row2 = new Vec4D(a21,a22,a23,a24);
+ row1 = new vec4d(a11,a12,a13,a14);
+ row2 = new vec4d(a21,a22,a23,a24);
}
- public bool Equals(Matrix2x4 other)
+ public bool Equals(matrix2x4 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -48,13 +48,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix2x4))
+ else if (obj.GetType() != typeof(matrix2x4))
{
return false;
}
else
{
- return this.Equals((Matrix2x4)obj);
+ return this.Equals((matrix2x4)obj);
}
}
@@ -68,33 +68,33 @@ namespace StgSharp.Math
return $"{this.row1}\n{this.row2}";
}
- public static Matrix2x4 operator +(Matrix2x4 matrix1 ,Matrix2x4 matrix2)
+ public static matrix2x4 operator +(matrix2x4 matrix1 ,matrix2x4 matrix2)
{
- return new Matrix2x4(
+ return new matrix2x4(
matrix1.row1 + matrix2.row1,
matrix1.row2 + matrix2.row2
) ;
}
- public static Matrix2x4 operator -(Matrix2x4 matrix1, Matrix2x4 matrix2)
+ public static matrix2x4 operator -(matrix2x4 matrix1, matrix2x4 matrix2)
{
- return new Matrix2x4(
+ return new matrix2x4(
matrix1.row1 - matrix2.row1,
matrix1.row2 - matrix2.row2
);
}
- public static Matrix2x4 operator *(Matrix2x4 array, float x)
+ public static matrix2x4 operator *(matrix2x4 array, float x)
{
- return new Matrix2x4(
+ return new matrix2x4(
array.row1 * x,
array.row2 * x
);
}
- public static Matrix2x4 operator /(Matrix2x4 array, float x)
+ public static matrix2x4 operator /(matrix2x4 array, float x)
{
- return new Matrix2x4(
+ return new matrix2x4(
array.row1 / x,
array.row2 / x
);
diff --git a/源代码/StgSharp/Vector/Matrix3x2.cs b/源代码/StgSharp/Linear/matrix3x2.cs
similarity index 71%
rename from 源代码/StgSharp/Vector/Matrix3x2.cs
rename to 源代码/StgSharp/Linear/matrix3x2.cs
index 990e994b..b067883d 100644
--- a/源代码/StgSharp/Vector/Matrix3x2.cs
+++ b/源代码/StgSharp/Linear/matrix3x2.cs
@@ -6,34 +6,34 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix3x2:IEquatable
+ public struct matrix3x2:IEquatable
{
[FieldOffset(0)]
- public Vec2D row1;
+ public vec2d row1;
[FieldOffset(8)]
- public Vec2D row2;
+ public vec2d row2;
[FieldOffset(16)]
- public Vec2D row3;
+ public vec2d row3;
- public Matrix3x2(Vec2D r1,Vec2D r2,Vec2D r3)
+ public matrix3x2(vec2d r1,vec2d r2,vec2d r3)
{
row1= r1;
row2= r2;
row3= r3;
}
- public Matrix3x2(
+ public matrix3x2(
float a11, float a12,
float a21, float a22,
float a31, float a32
)
{
- row1 = new Vec2D(a11, a12);
- row2 = new Vec2D(a21, a22);
- row3 = new Vec2D(a31, a32);
+ row1 = new vec2d(a11, a12);
+ row2 = new vec2d(a21, a22);
+ row3 = new vec2d(a31, a32);
}
- bool IEquatable.Equals(Matrix3x2 other)
+ bool IEquatable.Equals(matrix3x2 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -55,13 +55,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix3x2))
+ else if (obj.GetType() != typeof(matrix3x2))
{
return false;
}
else
{
- return this.Equals((Matrix3x2)obj);
+ return this.Equals((matrix3x2)obj);
}
}
@@ -75,18 +75,18 @@ namespace StgSharp.Math
return $"{row1}\n{row2}\n{row3}";
}
- public static Matrix3x2 operator +(Matrix3x2 matrix1, Matrix3x2 matrix2)
+ public static matrix3x2 operator +(matrix3x2 matrix1, matrix3x2 matrix2)
{
- return new Matrix3x2(
+ return new matrix3x2(
matrix1.row1 + matrix2.row1,
matrix1.row2 + matrix2.row2,
matrix1.row3 + matrix2.row3
);
}
- public static Matrix3x2 operator -(Matrix3x2 matrix1, Matrix3x2 matrix2)
+ public static matrix3x2 operator -(matrix3x2 matrix1, matrix3x2 matrix2)
{
- return new Matrix3x2(
+ return new matrix3x2(
matrix1.row1 - matrix2.row1,
matrix1.row2 - matrix2.row2,
matrix1.row3 - matrix2.row3
diff --git a/源代码/StgSharp/Vector/Matrix3x3.cs b/源代码/StgSharp/Linear/matrix3x3.cs
similarity index 73%
rename from 源代码/StgSharp/Vector/Matrix3x3.cs
rename to 源代码/StgSharp/Linear/matrix3x3.cs
index 130c8e5e..d5f27caa 100644
--- a/源代码/StgSharp/Vector/Matrix3x3.cs
+++ b/源代码/StgSharp/Linear/matrix3x3.cs
@@ -7,31 +7,31 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix3x3:IEquatable
+ public struct matrix3x3:IEquatable
{
[FieldOffset(0)]
- public Vec3D row1;
+ public vec3d row1;
[FieldOffset(12)]
- public Vec3D row2;
+ public vec3d row2;
[FieldOffset(24)]
- public Vec3D row3;
+ public vec3d row3;
- public Matrix3x3(Vec3D r0,Vec3D r1,Vec3D r2)
+ public matrix3x3(vec3d r0,vec3d r1,vec3d r2)
{
row1 = r0;
row2 = r1;
row3 = r2;
}
- public Matrix3x3(
+ public matrix3x3(
float a11,float a12,float a13,
float a21,float a22,float a23,
float a31,float a32,float a33
)
{
- row1 = new Vec3D(a11, a12, a13);
- row2 = new Vec3D(a21, a22, a23);
- row3 = new Vec3D(a31, a32, a33);
+ row1 = new vec3d(a11, a12, a13);
+ row2 = new vec3d(a21, a22, a23);
+ row3 = new vec3d(a31, a32, a33);
}
public override int GetHashCode()
@@ -39,7 +39,7 @@ namespace StgSharp.Math
return HashCode.Combine(row1,row2,row3);
}
- bool IEquatable.Equals(Matrix3x3 other)
+ bool IEquatable.Equals(matrix3x3 other)
{
if (this.GetHashCode()!=other.GetHashCode())
{
@@ -60,13 +60,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix3x3))
+ else if (obj.GetType() != typeof(matrix3x3))
{
return false;
}
else
{
- return this.Equals((Matrix3x3)obj);
+ return this.Equals((matrix3x3)obj);
}
}
@@ -77,19 +77,19 @@ namespace StgSharp.Math
- public static bool operator ==(Matrix3x3 matrix1, Matrix3x3 matrix2)
+ public static bool operator ==(matrix3x3 matrix1, matrix3x3 matrix2)
{
return matrix1.Equals(matrix2);
}
- public static bool operator !=(Matrix3x3 matrix1, Matrix3x3 matrix2)
+ public static bool operator !=(matrix3x3 matrix1, matrix3x3 matrix2)
{
return !matrix1.Equals(matrix2);
}
- public static Matrix3x3 operator +(Matrix3x3 matrix1, Matrix3x3 matrix2)
+ public static matrix3x3 operator +(matrix3x3 matrix1, matrix3x3 matrix2)
{
- return new Matrix3x3(
+ return new matrix3x3(
matrix1.row1.X + matrix2.row1.X,
matrix1.row1.Y + matrix2.row1.Y,
matrix1.row1.Z + matrix2.row1.Z,
@@ -104,9 +104,9 @@ namespace StgSharp.Math
);
}
- public static Matrix3x3 operator -(Matrix3x3 matrix1, Matrix3x3 matrix2)
+ public static matrix3x3 operator -(matrix3x3 matrix1, matrix3x3 matrix2)
{
- return new Matrix3x3(
+ return new matrix3x3(
matrix1.row1.X - matrix2.row1.X,
matrix1.row1.Y - matrix2.row1.Y,
matrix1.row1.Z - matrix2.row1.Z,
@@ -123,18 +123,18 @@ namespace StgSharp.Math
- public static Matrix3x3 operator *(Matrix3x3 array, float x)
+ public static matrix3x3 operator *(matrix3x3 array, float x)
{
- return new Matrix3x3(
+ return new matrix3x3(
array.row1 * x,
array.row2 * x,
array.row3 * x
);
}
- public static Matrix3x3 operator /(Matrix3x3 array, float x)
+ public static matrix3x3 operator /(matrix3x3 array, float x)
{
- return new Matrix3x3(
+ return new matrix3x3(
array.row1/x,
array.row2/x,
array.row3/x
diff --git a/源代码/StgSharp/Vector/Matrix3x4.cs b/源代码/StgSharp/Linear/matrix3x4.cs
similarity index 73%
rename from 源代码/StgSharp/Vector/Matrix3x4.cs
rename to 源代码/StgSharp/Linear/matrix3x4.cs
index 55ce3676..f9708f30 100644
--- a/源代码/StgSharp/Vector/Matrix3x4.cs
+++ b/源代码/StgSharp/Linear/matrix3x4.cs
@@ -8,17 +8,17 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix3x4:IEquatable
+ public struct matrix3x4:IEquatable
{
[FieldOffset(0)]
- public Vec4D row1;
+ public vec4d row1;
[FieldOffset(16)]
- public Vec4D row2;
+ public vec4d row2;
[FieldOffset(32)]
- public Vec4D row3;
+ public vec4d row3;
- public Matrix3x4(
- Vec4D r1, Vec4D r2, Vec4D r3
+ public matrix3x4(
+ vec4d r1,vec4d r2,vec4d r3
)
{
this.row1 = r1;
@@ -26,15 +26,15 @@ namespace StgSharp.Math
this.row3 = r3;
}
- public Matrix3x4(
+ public matrix3x4(
float a11, float a12, float a13, float a14,
float a21, float a22, float a23, float a24,
float a31, float a32, float a33, float a34
)
{
- row1 = new Vec4D(a11,a12,a13,a14);
- row2 = new Vec4D(a21,a22,a23,a24);
- row3 = new Vec4D(a31,a32,a33,a34);
+ row1 = new vec4d(a11,a12,a13,a14);
+ row2 = new vec4d(a21,a22,a23,a24);
+ row3 = new vec4d(a31,a32,a33,a34);
}
public override bool Equals(object obj)
@@ -43,17 +43,17 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix3x4))
+ else if (obj.GetType() != typeof(matrix3x4))
{
return false;
}
else
{
- return this.Equals((Matrix3x4)obj);
+ return this.Equals((matrix3x4)obj);
}
}
- bool IEquatable.Equals(Matrix3x4 other)
+ bool IEquatable.Equals(matrix3x4 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
diff --git a/源代码/StgSharp/Vector/Matrix4x2.cs b/源代码/StgSharp/Linear/matrix4x2.cs
similarity index 71%
rename from 源代码/StgSharp/Vector/Matrix4x2.cs
rename to 源代码/StgSharp/Linear/matrix4x2.cs
index b8751e96..8894958b 100644
--- a/源代码/StgSharp/Vector/Matrix4x2.cs
+++ b/源代码/StgSharp/Linear/matrix4x2.cs
@@ -6,18 +6,18 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix4x2:IEquatable
+ public struct matrix4x2:IEquatable
{
[FieldOffset(0)]
- public Vec2D row1;
+ public vec2d row1;
[FieldOffset(8)]
- public Vec2D row2;
+ public vec2d row2;
[FieldOffset(16)]
- public Vec2D row3;
+ public vec2d row3;
[FieldOffset(24)]
- public Vec2D row4;
+ public vec2d row4;
- public Matrix4x2(Vec2D r1, Vec2D r2, Vec2D r3, Vec2D r4)
+ public matrix4x2(vec2d r1, vec2d r2, vec2d r3, vec2d r4)
{
row1 = r1;
row2 = r2;
@@ -25,17 +25,17 @@ namespace StgSharp.Math
row4 = r4;
}
- public Matrix4x2(
+ public matrix4x2(
float a11, float a12,
float a21, float a22,
float a31, float a32,
float a41, float a42
)
{
- row1 = new Vec2D(a11, a12);
- row2 = new Vec2D(a21, a22);
- row3 = new Vec2D(a31, a32);
- row4 = new Vec2D(a41, a42);
+ row1 = new vec2d(a11, a12);
+ row2 = new vec2d(a21, a22);
+ row3 = new vec2d(a31, a32);
+ row4 = new vec2d(a41, a42);
}
public override bool Equals(object obj)
@@ -44,13 +44,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() == typeof(Matrix4x2))
+ else if (obj.GetType() == typeof(matrix4x2))
{
return false;
}
else
{
- return this.Equals((Matrix4x2)obj);
+ return this.Equals((matrix4x2)obj);
}
}
@@ -64,7 +64,7 @@ namespace StgSharp.Math
return $"{row1}\n{row2}\n{row3}\n{row4}";
}
- bool IEquatable.Equals(Matrix4x2 other)
+ bool IEquatable.Equals(matrix4x2 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
diff --git a/源代码/StgSharp/Vector/Matrix4x3.cs b/源代码/StgSharp/Linear/matrix4x3.cs
similarity index 71%
rename from 源代码/StgSharp/Vector/Matrix4x3.cs
rename to 源代码/StgSharp/Linear/matrix4x3.cs
index 095a6232..9ee3e3cd 100644
--- a/源代码/StgSharp/Vector/Matrix4x3.cs
+++ b/源代码/StgSharp/Linear/matrix4x3.cs
@@ -7,28 +7,28 @@ namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix4x3:IEquatable
+ public struct matrix4x3:IEquatable
{
[FieldOffset(0)]
- public Vec3D row1;
+ public vec3d row1;
[FieldOffset(12)]
- public Vec3D row2;
+ public vec3d row2;
[FieldOffset(24)]
- public Vec3D row3;
+ public vec3d row3;
[FieldOffset(36)]
- public Vec3D row4;
+ public vec3d row4;
- public Matrix4x3(
+ public matrix4x3(
float a11, float a12, float a13,
float a21, float a22, float a23,
float a31, float a32, float a33,
float a41, float a42, float a43
)
{
- row1 = new Vec3D(a11, a12, a13);
- row2 = new Vec3D(a21, a22, a23);
- row3 = new Vec3D(a31, a32, a33);
- row4 = new Vec3D(a41, a42, a43);
+ row1 = new vec3d(a11, a12, a13);
+ row2 = new vec3d(a21, a22, a23);
+ row3 = new vec3d(a31, a32, a33);
+ row4 = new vec3d(a41, a42, a43);
}
public override bool Equals(object obj)
@@ -37,17 +37,17 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Matrix4x3))
+ else if (obj.GetType() != typeof(matrix4x3))
{
return false;
}
else
{
- return this.Equals((Matrix4x3)obj);
+ return this.Equals((matrix4x3)obj);
}
}
- bool IEquatable.Equals(Matrix4x3 other)
+ bool IEquatable.Equals(matrix4x3 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
diff --git a/源代码/StgSharp/Vector/Matrix4x4.cs b/源代码/StgSharp/Linear/matrix4x4.cs
similarity index 72%
rename from 源代码/StgSharp/Vector/Matrix4x4.cs
rename to 源代码/StgSharp/Linear/matrix4x4.cs
index 5f9f634c..ba2a1b3d 100644
--- a/源代码/StgSharp/Vector/Matrix4x4.cs
+++ b/源代码/StgSharp/Linear/matrix4x4.cs
@@ -6,18 +6,18 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Matrix4x4:IEquatable
+ public struct matrix4x4:IEquatable
{
[FieldOffset(0)]
- public Vec4D row1;
+ public vec4d row1;
[FieldOffset(16)]
- public Vec4D row2;
+ public vec4d row2;
[FieldOffset(32)]
- public Vec4D row3;
+ public vec4d row3;
[FieldOffset(48)]
- public Vec4D row4;
+ public vec4d row4;
- public Matrix4x4(Vec4D r1, Vec4D r2, Vec4D r3, Vec4D r4)
+ public matrix4x4( vec4d r1,vec4d r2,vec4d r3,vec4d r4)
{
row1 = r1;
row2 = r2;
@@ -25,17 +25,17 @@ namespace StgSharp.Math
row4 = r4;
}
- public Matrix4x4(
+ public matrix4x4(
float a11, float a12, float a13, float a14,
float a21, float a22, float a23, float a24,
float a31, float a32, float a33, float a34,
float a41, float a42, float a43, float a44
)
{
- row1 = new Vec4D(a11, a12, a13, a14);
- row2 = new Vec4D(a21, a22, a23, a24);
- row3 = new Vec4D(a31, a32, a33, a34);
- row4 = new Vec4D(a41, a42, a43, a44);
+ row1 = new vec4d(a11, a12, a13, a14);
+ row2 = new vec4d(a21, a22, a23, a24);
+ row3 = new vec4d(a31, a32, a33, a34);
+ row4 = new vec4d(a41, a42, a43, a44);
}
public override bool Equals(object obj)
@@ -43,7 +43,7 @@ namespace StgSharp.Math
return base.Equals(obj);
}
- bool IEquatable.Equals(Matrix4x4 other)
+ bool IEquatable.Equals(matrix4x4 other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -68,9 +68,9 @@ namespace StgSharp.Math
return $"{this.row1}\n{this.row2}\n{this.row3}\n{this.row4}";
}
- public static Matrix4x4 operator +(Matrix4x4 matrix1, Matrix4x4 matrix2)
+ public static matrix4x4 operator +(matrix4x4 matrix1, matrix4x4 matrix2)
{
- return new Matrix4x4(
+ return new matrix4x4(
matrix1.row1 + matrix2.row1,
matrix1.row2 + matrix2.row2,
matrix1.row3 + matrix2.row3,
@@ -78,9 +78,9 @@ namespace StgSharp.Math
);
}
- public static Matrix4x4 operator -(Matrix4x4 matrix1, Matrix4x4 matrix2)
+ public static matrix4x4 operator -(matrix4x4 matrix1, matrix4x4 matrix2)
{
- return new Matrix4x4(
+ return new matrix4x4(
matrix1.row1 - matrix2.row1,
matrix1.row2 - matrix2.row2,
matrix1.row3 - matrix2.row3,
@@ -88,9 +88,9 @@ namespace StgSharp.Math
);
}
- public static Matrix4x4 operator *(Matrix4x4 array, float x)
+ public static matrix4x4 operator *(matrix4x4 array, float x)
{
- return new Matrix4x4(
+ return new matrix4x4(
array.row1 * x,
array.row2 * x,
array.row3 * x,
diff --git a/源代码/StgSharp/Vector/Vec2D.cs b/源代码/StgSharp/Linear/vec2d.cs
similarity index 62%
rename from 源代码/StgSharp/Vector/Vec2D.cs
rename to 源代码/StgSharp/Linear/vec2d.cs
index 64dc12d9..eb778ed2 100644
--- a/源代码/StgSharp/Vector/Vec2D.cs
+++ b/源代码/StgSharp/Linear/vec2d.cs
@@ -9,20 +9,20 @@ namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Vec2D:IEquatable
+ public struct vec2d:IEquatable
{
[FieldOffset(0)]
public float X;
[FieldOffset(sizeof(float))]
public float Y;
- public Vec2D(float x,float y)
+ public vec2d(float x,float y)
{
X = x;
Y = y;
}
- public bool Equals(Vec2D other)
+ public bool Equals(vec2d other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -40,13 +40,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Vec2D))
+ else if (obj.GetType() != typeof(vec2d))
{
return false;
}
else
{
- return this.Equals((Vec2D)obj);
+ return this.Equals((vec2d)obj);
}
}
@@ -60,34 +60,34 @@ namespace StgSharp.Math
return $"{this.X}\t{this.Y}";
}
- public static bool operator ==(Vec2D vec1, Vec2D vec2)
+ public static bool operator ==(vec2d vec1, vec2d vec2)
{
return vec1.X==vec2.X && vec1.Y==vec2.Y;
}
- public static bool operator !=(Vec2D vec1, Vec2D vec2)
+ public static bool operator !=(vec2d vec1, vec2d vec2)
{
return !(vec1.X == vec2.X && vec1.Y == vec2.Y);
}
- public static Vec2D operator +(Vec2D vec1, Vec2D vec2)
+ public static vec2d operator +(vec2d vec1, vec2d vec2)
{
- return new Vec2D(vec1.X + vec2.X, vec1.Y + vec2.Y);
+ return new vec2d(vec1.X + vec2.X, vec1.Y + vec2.Y);
}
- public static Vec2D operator -(Vec2D vec1, Vec2D vec2)
+ public static vec2d operator -(vec2d vec1, vec2d vec2)
{
- return new Vec2D(vec1.X - vec2.X, vec1.Y - vec2.Y);
+ return new vec2d(vec1.X - vec2.X, vec1.Y - vec2.Y);
}
- public static Vec2D operator *(Vec2D vec, float x)
+ public static vec2d operator *(vec2d vec, float x)
{
- return new Vec2D(vec.X * x, vec.Y * x);
+ return new vec2d(vec.X * x, vec.Y * x);
}
- public static Vec2D operator /(Vec2D vec, float x)
+ public static vec2d operator /(vec2d vec, float x)
{
- return new Vec2D(vec.X/x, vec.Y/x);
+ return new vec2d(vec.X/x, vec.Y/x);
}
diff --git a/源代码/StgSharp/Vector/Vec3D.cs b/源代码/StgSharp/Linear/vec3d.cs
similarity index 72%
rename from 源代码/StgSharp/Vector/Vec3D.cs
rename to 源代码/StgSharp/Linear/vec3d.cs
index 9bfb5f9b..eb037e93 100644
--- a/源代码/StgSharp/Vector/Vec3D.cs
+++ b/源代码/StgSharp/Linear/vec3d.cs
@@ -7,7 +7,7 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Vec3D : IEquatable
+ public struct vec3d : IEquatable
{
[FieldOffset(0)]
public float X;
@@ -16,14 +16,14 @@ namespace StgSharp.Math
[FieldOffset(8)]
public float Z;
- public Vec3D(float x, float y, float z)
+ public vec3d(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
}
- bool IEquatable.Equals(Vec3D other)
+ bool IEquatable.Equals(vec3d other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -43,13 +43,13 @@ namespace StgSharp.Math
{
return false;
}
- else if (obj.GetType() != typeof(Vec3D))
+ else if (obj.GetType() != typeof(vec3d))
{
return false;
}
else
{
- return this.Equals((Vec3D)obj);
+ return this.Equals((vec3d)obj);
}
}
@@ -63,39 +63,39 @@ namespace StgSharp.Math
return $"{X}\t{Y}\t{Z}";
}
- public static bool operator ==(Vec3D vec1,Vec3D vec2)
+ public static bool operator ==(vec3d vec1,vec3d vec2)
{
return vec1.X == vec2.X
&& vec1.Y == vec2.Y
&& vec1.Z == vec2.Z;
}
- public static bool operator !=(Vec3D vec1, Vec3D vec2)
+ public static bool operator !=(vec3d vec1, vec3d vec2)
{
return !(vec1.X == vec2.X
&& vec1.Y == vec2.Y
&& vec1.Z == vec2.Z);
}
- public static Vec3D operator +(Vec3D vec1, Vec3D vec2)
+ public static vec3d operator +(vec3d vec1, vec3d vec2)
{
- return new Vec3D(
+ return new vec3d(
vec1.X + vec2.X,
vec1.Y + vec2.Y,
vec1.Z + vec2.Z
);
}
- public static Vec3D operator -(Vec3D vec1, Vec3D vec2)
+ public static vec3d operator -(vec3d vec1, vec3d vec2)
{
- return new Vec3D(
+ return new vec3d(
vec1.X - vec2.X,
vec1.Y - vec2.Y,
vec1.Z - vec2.Z
);
}
- public static float operator *(Vec3D vec1, Vec3D vec2)
+ public static float operator *(vec3d vec1, vec3d vec2)
{
return
vec1.X * vec2.X
@@ -103,18 +103,18 @@ namespace StgSharp.Math
+ vec1.Z + vec2.Z;
}
- public static Vec3D operator *(Vec3D vec, float x)
+ public static vec3d operator *(vec3d vec, float x)
{
- return new Vec3D(
+ return new vec3d(
vec.X * x,
vec.Y * x,
vec.Z * x
);
}
- public static Vec3D operator /(Vec3D vec, float x)
+ public static vec3d operator /(vec3d vec, float x)
{
- return new Vec3D(
+ return new vec3d(
vec.X / x,
vec.Y / x,
vec.Z / x
diff --git a/源代码/StgSharp/Vector/Vec4D.cs b/源代码/StgSharp/Linear/vec4d.cs
similarity index 68%
rename from 源代码/StgSharp/Vector/Vec4D.cs
rename to 源代码/StgSharp/Linear/vec4d.cs
index 35457706..4be4b2ae 100644
--- a/源代码/StgSharp/Vector/Vec4D.cs
+++ b/源代码/StgSharp/Linear/vec4d.cs
@@ -9,7 +9,7 @@ using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
- public struct Vec4D:IEquatable
+ public struct vec4d:IEquatable< vec4d>
{
[FieldOffset(0)]
public float X;
@@ -22,14 +22,14 @@ namespace StgSharp.Math
[FieldOffset(0)]
- public Vec2D Point1;
+ public vec2d Point1;
[FieldOffset(8)]
- public Vec2D Point2;
+ public vec2d Point2;
- public Vec4D(float a1,float a2,float a3,float a4)
+ public vec4d(float a1,float a2,float a3,float a4)
{
- Point1= default(Vec2D);
- Point2= default(Vec2D);
+ Point1= default(vec2d);
+ Point2= default(vec2d);
X = a1;
Y = a2;
@@ -37,7 +37,7 @@ namespace StgSharp.Math
W = a4;
}
- public Vec4D(Vec2D p1,Vec2D p2)
+ public vec4d(vec2d p1,vec2d p2)
{
X= 0;
Y= 0;
@@ -54,17 +54,17 @@ namespace StgSharp.Math
{
return false;
}
- else if(obj.GetType() != typeof(Vec4D))
+ else if(obj.GetType() != typeof( vec4d))
{
return false;
}
else
{
- return this == (Vec4D)obj;
+ return this == ( vec4d)obj;
}
}
- bool IEquatable.Equals(Vec4D other)
+ bool IEquatable< vec4d>.Equals( vec4d other)
{
if (this.GetHashCode() != other.GetHashCode())
{
@@ -89,19 +89,19 @@ namespace StgSharp.Math
return $"{X}\t{Y}\t{Z}\t{W}";
}
- public static bool operator ==(Vec4D vec1, Vec4D vec2)
+ public static bool operator ==( vec4d vec1, vec4d vec2)
{
return vec1.Equals(vec2);
}
- public static bool operator !=(Vec4D vec1, Vec4D vec2)
+ public static bool operator !=( vec4d vec1, vec4d vec2)
{
return !vec1.Equals(vec2);
}
- public static Vec4D operator +(Vec4D vec1, Vec4D vec2)
+ public static vec4d operator +( vec4d vec1, vec4d vec2)
{
- return new Vec4D(
+ return new vec4d(
vec1.X + vec2.X,
vec1.Y + vec2.Y,
vec1.Z + vec2.Z,
@@ -109,9 +109,9 @@ namespace StgSharp.Math
);
}
- public static Vec4D operator -(Vec4D vec1, Vec4D vec2)
+ public static vec4d operator -( vec4d vec1, vec4d vec2)
{
- return new Vec4D(
+ return new vec4d(
vec1.X - vec2.X,
vec1.Y - vec2.Y,
vec1.Z - vec2.Z,
@@ -119,7 +119,7 @@ namespace StgSharp.Math
);
}
- public static float operator *(Vec4D vec1, Vec4D vec2)
+ public static float operator *( vec4d vec1, vec4d vec2)
{
return
vec1.X * vec2.X
@@ -128,14 +128,14 @@ namespace StgSharp.Math
+ vec1.W * vec2.W;
}
- public static Vec4D operator *(Vec4D vec, float x)
+ public static vec4d operator *( vec4d vec, float x)
{
- return new Vec4D(vec.X * x, vec.Y * x, vec.Z * x, vec.W * x ) ;
+ return new vec4d(vec.X * x, vec.Y * x, vec.Z * x, vec.W * x ) ;
}
- public static Vec4D operator /(Vec4D vec, float x)
+ public static vec4d operator /( vec4d vec, float x)
{
- return new Vec4D(vec.X / x, vec.Y / x, vec.Z / x, vec.W / x);
+ return new vec4d(vec.X / x, vec.Y / x, vec.Z / x, vec.W / x);
}
diff --git a/源代码/StgSharp/Logic/ContainerNode.cs b/源代码/StgSharp/Logic/ContainerNode.cs
index fb90fb82..ce034f2d 100644
--- a/源代码/StgSharp/Logic/ContainerNode.cs
+++ b/源代码/StgSharp/Logic/ContainerNode.cs
@@ -1,17 +1,30 @@
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
- public class ContainerNode where T : INode
+ public interface INode where T : INode
{
- internal readonly T _this;
+ internal ContainerNode ID { get; }
+
+ internal void setID(ContainerNode id) where T : INode;
+ }
+
+
+ public class ContainerNode where T : INode
+ {
+ internal readonly T _value;
internal ContainerNode _previous;
internal ContainerNode _next;
internal ContainerNode _side;
-
+ public ContainerNode(T t)
+ {
+ _value = t;
+ t.setID(this);
+ }
public virtual ContainerNode Previous
{
@@ -33,13 +46,8 @@ namespace StgSharp
public T Value
{
- get { return _this; }
+ get { return _value; }
}
- public ContainerNode(T t)
- {
- _this = t;
- t.setID(this);
- }
}
}
diff --git a/源代码/StgSharp/Logic/INode.cs b/源代码/StgSharp/Logic/INode.cs
deleted file mode 100644
index 0894e992..00000000
--- a/源代码/StgSharp/Logic/INode.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace StgSharp
-{
- public interface INode
- {
- internal ContainerNode ID { get; }
-
- internal void setID(ContainerNode id) where T:INode;
- }
-}
diff --git a/源代码/StgSharp/Logic/LinkedList.cs b/源代码/StgSharp/Logic/LinkedList.cs
index 671e858d..6fddc3b5 100644
--- a/源代码/StgSharp/Logic/LinkedList.cs
+++ b/源代码/StgSharp/Logic/LinkedList.cs
@@ -1,25 +1,37 @@
-using System;
+using StgSharp.Logic;
+using System;
+using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
- public class LinkedList where T: INode
+ public class LinkedList:IEnumerable where T: INode
{
+ internal readonly ContainerNode _heading;
internal ContainerNode _first;
internal ContainerNode _tail;
private ContainerNode _cache;
+ public LinkedList()
+ {
+ _heading = new ContainerNode(default(T));
+ }
+
public T First
{
- get { return _first._this; }
- set { _first = new ContainerNode(value); }
+ get { return _first._value; }
+ set
+ {
+ _first = new ContainerNode(value);
+ _heading._next = _first;
+ }
}
public T Tail
{
- get { return _tail._this; }
+ get { return _tail._value; }
set { _tail = new ContainerNode(value); }
}
@@ -53,8 +65,9 @@ namespace StgSharp
}
}
-
-
-
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return new LinkedListEnumrator(this);
+ }
}
}
diff --git a/源代码/StgSharp/Logic/LinkedListEnumrator.cs b/源代码/StgSharp/Logic/LinkedListEnumrator.cs
new file mode 100644
index 00000000..dd125f28
--- /dev/null
+++ b/源代码/StgSharp/Logic/LinkedListEnumrator.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Logic
+{
+ internal class LinkedListEnumrator : IEnumerator where T : INode
+ {
+ private LinkedList _target;
+ ContainerNode enumrator;
+
+ public LinkedListEnumrator(LinkedList target)
+ {
+ _target = target;
+ enumrator = target._heading;
+ }
+
+ object IEnumerator.Current
+ {
+ get { return enumrator._value; }
+ }
+
+ bool IEnumerator.MoveNext()
+ {
+ enumrator = enumrator._next;
+ return enumrator == default(ContainerNode);
+ }
+
+ void IEnumerator.Reset()
+ {
+ enumrator = _target._heading;
+ }
+ }
+}
diff --git a/源代码/StgSharp/Logic/Pool.cs b/源代码/StgSharp/Logic/Pool.cs
index c97a8af1..64fa7ab6 100644
--- a/源代码/StgSharp/Logic/Pool.cs
+++ b/源代码/StgSharp/Logic/Pool.cs
@@ -10,18 +10,19 @@ namespace StgSharp
{
public LinkedList pointContainer;
public LinkedList geometryContainer;
- public LinkedList sensorContainer;
+ public LinkedList> sensorContainer;
public Line leftBoader;
public Line rightBoader;
public Line topBoader;
public Line bottomBoader;
+ public Pool()
+ {
+ }
public void OnRender()
{
-
-
}
diff --git a/源代码/StgSharp/Logic/Sensor.cs b/源代码/StgSharp/Logic/Sensor.cs
index f6ead664..1c54437c 100644
--- a/源代码/StgSharp/Logic/Sensor.cs
+++ b/源代码/StgSharp/Logic/Sensor.cs
@@ -1,28 +1,48 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
using System.Text;
namespace StgSharp
{
- public class Sensor : INode
- {
- private ContainerNode _id;
- ContainerNode INode.ID
+ public delegate bool SensorRuleHandler(IGeometry target, IGeometry boarder);
+
+ public class Sensor
+ {
+ internal IGeometry _boarder;
+ internal IGeometry _target;
+ internal SensorRuleHandler _rule;
+
+
+ public IGeometry boarder
{
- get { return _id; }
+ get { return _boarder; }
}
- void INode.setID(ContainerNode id)
+ public IGeometry target
{
- if (id == null)
- {
- _id = id as ContainerNode;
- }
- else
- {
- throw new ArgumentNullException("Cannot set id teice!");
- }
+ get { return _target; }
+ set { _target = value; }
+ }
+
+ public SensorRuleHandler Rule
+ {
+ get { return _rule; }
+ set { _rule = value; }
+ }
+
+ public static Sensor operator +(Sensor sensor, SensorRuleHandler rule)
+ {
+ sensor._rule += rule;
+ return sensor;
+ }
+
+ public static Sensor operator -(Sensor sensor, SensorRuleHandler rule)
+ {
+ sensor._rule -= rule;
+ return sensor;
}
}
}
diff --git a/源代码/StgSharp/Math/Function.cs b/源代码/StgSharp/Math/Function.cs
new file mode 100644
index 00000000..ffe94fce
--- /dev/null
+++ b/源代码/StgSharp/Math/Function.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public class Function
+ {
+
+
+ }
+}
diff --git a/源代码/StgSharp/Optimization/SSE.cs b/源代码/StgSharp/Optimization/SSE.cs
new file mode 100644
index 00000000..bdd1b877
--- /dev/null
+++ b/源代码/StgSharp/Optimization/SSE.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Optimization
+{
+ public unsafe class SSE
+ {
+
+
+ }
+}
diff --git a/源代码/StgSharp/Optimization/x86.cs b/源代码/StgSharp/Optimization/x86.cs
new file mode 100644
index 00000000..a15f4384
--- /dev/null
+++ b/源代码/StgSharp/Optimization/x86.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Optimization
+{
+ public static unsafe class x86
+ {
+
+ }
+}
diff --git a/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache b/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache
index fb023d4d..0b6c7b30 100644
--- a/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache
+++ b/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-3a9e429a025cbd1bcea4abf9fbdb2cf05dc117a7
+3e1ad1a00461e4ab0c00b4070b9447d36b0fd3cb
diff --git a/源代码/StgSharpDebug/CpuID.cs b/源代码/StgSharpDebug/CpuID.cs
new file mode 100644
index 00000000..1f67d744
--- /dev/null
+++ b/源代码/StgSharpDebug/CpuID.cs
@@ -0,0 +1,193 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+namespace ssd
+{
+ public class CpuID : IDisposable
+ {
+ [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+ public delegate void CpuIDDelegate(int level, byte[] buffer);
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ private static extern IntPtr VirtualAlloc(
+ IntPtr lpAddress,
+ UIntPtr dwSize,
+ AllocationType flAllocationType,
+ MemoryProtection flProtect
+ );
+
+ [DllImport("kernel32")]
+ private static extern bool VirtualFree(
+ IntPtr lpAddress,
+ UInt32 dwSize,
+ UInt32 dwFreeType
+ );
+
+ [Flags()]
+ public enum AllocationType : uint
+ {
+ COMMIT = 0x1000,
+ RESERVE = 0x2000,
+ RESET = 0x80000,
+ LARGE_PAGES = 0x20000000,
+ PHYSICAL = 0x400000,
+ TOP_DOWN = 0x100000,
+ WRITE_WATCH = 0x200000
+ }
+
+ [Flags()]
+ public enum MemoryProtection : uint
+ {
+ EXECUTE = 0x10,
+ EXECUTE_READ = 0x20,
+ EXECUTE_READWRITE = 0x40,
+ EXECUTE_WRITECOPY = 0x80,
+ NOACCESS = 0x01,
+ READONLY = 0x02,
+ READWRITE = 0x04,
+ WRITECOPY = 0x08,
+ GUARD_Modifierflag = 0x100,
+ NOCACHE_Modifierflag = 0x200,
+ WRITECOMBINE_Modifierflag = 0x400
+ }
+
+ private CpuIDDelegate cpuIdDelg;
+
+ private IntPtr codePointer;
+
+ // void x86CpuId(int level, byte* buffer)
+ // {
+ // eax = level
+ // cpuid
+ // buffer[0] = eax
+ // buffer[4] = ebx
+ // buffer[8] = ecx
+ // buffer[12] = edx
+ // }
+ private byte[] x86CodeBytes =
+ {
+ 0x55, // push ebp
+ 0x8B, 0xEC, // mov ebp,esp
+ 0x53, // push ebx
+ 0x57, // push edi
+
+ 0x8B, 0x45, 0x08, // mov eax, dword ptr [ebp+8] (move level into eax)
+ 0x0F, 0xA2, // cpuid
+
+ 0x8B, 0x7D, 0x0C, // mov edi, dword ptr [ebp+12] (move address of buffer into edi)
+ 0x89, 0x07, // mov dword ptr [edi+0], eax (write eax, ... to buffer)
+ 0x89, 0x5F, 0x04, // mov dword ptr [edi+4], ebx
+ 0x89, 0x4F, 0x08, // mov dword ptr [edi+8], ecx
+ 0x89, 0x57, 0x0C, // mov dword ptr [edi+12],edx
+
+ 0x5F, // pop edi
+ 0x5B, // pop ebx
+ 0x8B, 0xE5, // mov esp,ebp
+ 0x5D, // pop ebp
+ 0xc3 // ret
+ };
+
+ private byte[] x64CodeBytes =
+ {
+ 0x53, // push rbx this gets clobbered by cpuid
+
+ // rcx is level
+ // rdx is buffer.
+ // Need to save buffer elsewhere, cpuid overwrites rdx
+ // Put buffer in r8, use r8 to reference buffer later.
+
+ // Save rdx (buffer addy) to r8
+ 0x49, 0x89, 0xd0, // mov r8, rdx
+
+ // Move ecx (level) to eax to call cpuid, call cpuid
+ 0x89, 0xc8, // mov eax, ecx
+ 0x0F, 0xA2, // cpuid
+
+ // Write eax et al to buffer
+ 0x41, 0x89, 0x40, 0x00, // mov dword ptr [r8+0], eax
+ 0x41, 0x89, 0x58, 0x04, // mov dword ptr [r8+4], ebx
+ 0x41, 0x89, 0x48, 0x08, // mov dword ptr [r8+8], ecx
+ 0x41, 0x89, 0x50, 0x0c, // mov dword ptr [r8+12], edx
+
+ 0x5b, // pop rbx
+ 0xc3 // ret
+ };
+
+ public CpuID()
+ {
+ Compile();
+ }
+
+ ~CpuID()
+ {
+ Dispose(false);
+ }
+
+ private void Compile()
+ {
+ byte[] codeBytes;
+
+ if (IntPtr.Size == 4)
+ {
+ codeBytes = x86CodeBytes;
+ }
+ else
+ {
+ codeBytes = x64CodeBytes;
+ }
+
+ this.codePointer = VirtualAlloc(
+ IntPtr.Zero,
+ new UIntPtr((uint)codeBytes.Length),
+ AllocationType.COMMIT | AllocationType.RESERVE,
+ MemoryProtection.EXECUTE_READWRITE
+ );
+
+ Marshal.Copy(codeBytes, 0, this.codePointer, codeBytes.Length);
+
+ this.cpuIdDelg = (CpuIDDelegate)Marshal.GetDelegateForFunctionPointer(this.codePointer, typeof(CpuIDDelegate));
+ }
+
+ public void Invoke(int level, byte[] buffer)
+ {
+ GCHandle handle = default(GCHandle);
+ if (buffer.Length < 16)
+ {
+ throw new ArgumentException("buffer must be at least 16 bytes long");
+ }
+
+ try
+ {
+ handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
+
+ this.cpuIdDelg(level, buffer);
+ }
+ finally
+ {
+ if (handle != default(GCHandle))
+ {
+ handle.Free();
+ }
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+
+ public void Dispose(bool disposing)
+ {
+ if (this.codePointer != IntPtr.Zero)
+ {
+ VirtualFree(this.codePointer, 0, 0x8000);
+ this.codePointer = IntPtr.Zero;
+ }
+ }
+
+ }
+}
diff --git a/源代码/StgSharpDebug/Program.cs b/源代码/StgSharpDebug/Program.cs
index 00d22aca..c42139e2 100644
--- a/源代码/StgSharpDebug/Program.cs
+++ b/源代码/StgSharpDebug/Program.cs
@@ -8,10 +8,7 @@ internal class Program
private unsafe static void Main(string[] args)
{
- float a = MathF.Sqrt(10.00f) ;
- Console.WriteLine(a);
-
-
+ Sensor s = new Sensor();
/*
double time;
diff --git a/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache b/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache
index ddabfce5..c1998c7a 100644
--- a/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache
+++ b/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-70ee143f101c68f31939cbfec5000b9894b6dc91
+60e70d5da595ae3db786c2b5843f9284d9a246e2