diff --git a/build/vs2015/bounce.sln b/build/vs2015/bounce.sln
deleted file mode 100644
index 4f3d5a8..0000000
--- a/build/vs2015/bounce.sln
+++ /dev/null
@@ -1,66 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2015
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bounce", "bounce.vcxproj", "{C13B93F4-ADDD-BDCA-9698-D11E82D9441B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glad", "glad.vcxproj", "{DD62977C-C999-980D-7286-7E105E9C140F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glfw", "glfw.vcxproj", "{9563977C-819A-980D-2A87-7E10169D140F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imgui", "imgui.vcxproj", "{0098A80F-6CAC-D0C0-352E-7420A101CDF1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testbed", "testbed.vcxproj", "{90781ED9-FC57-9D74-0570-284B71CE03D6}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- debug|Win32 = debug|Win32
- debug|x64 = debug|x64
- release|Win32 = release|Win32
- release|x64 = release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.debug|Win32.ActiveCfg = debug|Win32
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.debug|Win32.Build.0 = debug|Win32
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.debug|x64.ActiveCfg = debug|x64
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.debug|x64.Build.0 = debug|x64
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.release|Win32.ActiveCfg = release|Win32
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.release|Win32.Build.0 = release|Win32
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.release|x64.ActiveCfg = release|x64
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}.release|x64.Build.0 = release|x64
- {DD62977C-C999-980D-7286-7E105E9C140F}.debug|Win32.ActiveCfg = debug|Win32
- {DD62977C-C999-980D-7286-7E105E9C140F}.debug|Win32.Build.0 = debug|Win32
- {DD62977C-C999-980D-7286-7E105E9C140F}.debug|x64.ActiveCfg = debug|x64
- {DD62977C-C999-980D-7286-7E105E9C140F}.debug|x64.Build.0 = debug|x64
- {DD62977C-C999-980D-7286-7E105E9C140F}.release|Win32.ActiveCfg = release|Win32
- {DD62977C-C999-980D-7286-7E105E9C140F}.release|Win32.Build.0 = release|Win32
- {DD62977C-C999-980D-7286-7E105E9C140F}.release|x64.ActiveCfg = release|x64
- {DD62977C-C999-980D-7286-7E105E9C140F}.release|x64.Build.0 = release|x64
- {9563977C-819A-980D-2A87-7E10169D140F}.debug|Win32.ActiveCfg = debug|Win32
- {9563977C-819A-980D-2A87-7E10169D140F}.debug|Win32.Build.0 = debug|Win32
- {9563977C-819A-980D-2A87-7E10169D140F}.debug|x64.ActiveCfg = debug|x64
- {9563977C-819A-980D-2A87-7E10169D140F}.debug|x64.Build.0 = debug|x64
- {9563977C-819A-980D-2A87-7E10169D140F}.release|Win32.ActiveCfg = release|Win32
- {9563977C-819A-980D-2A87-7E10169D140F}.release|Win32.Build.0 = release|Win32
- {9563977C-819A-980D-2A87-7E10169D140F}.release|x64.ActiveCfg = release|x64
- {9563977C-819A-980D-2A87-7E10169D140F}.release|x64.Build.0 = release|x64
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.debug|Win32.ActiveCfg = debug|Win32
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.debug|Win32.Build.0 = debug|Win32
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.debug|x64.ActiveCfg = debug|x64
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.debug|x64.Build.0 = debug|x64
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.release|Win32.ActiveCfg = release|Win32
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.release|Win32.Build.0 = release|Win32
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.release|x64.ActiveCfg = release|x64
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}.release|x64.Build.0 = release|x64
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.debug|Win32.ActiveCfg = debug|Win32
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.debug|Win32.Build.0 = debug|Win32
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.debug|x64.ActiveCfg = debug|x64
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.debug|x64.Build.0 = debug|x64
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.release|Win32.ActiveCfg = release|Win32
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.release|Win32.Build.0 = release|Win32
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.release|x64.ActiveCfg = release|x64
- {90781ED9-FC57-9D74-0570-284B71CE03D6}.release|x64.Build.0 = release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/build/vs2015/bounce.vcxproj b/build/vs2015/bounce.vcxproj
deleted file mode 100644
index a0e890c..0000000
--- a/build/vs2015/bounce.vcxproj
+++ /dev/null
@@ -1,291 +0,0 @@
-
-
-
-
- debug
- Win32
-
-
- debug
- x64
-
-
- release
- Win32
-
-
- release
- x64
-
-
-
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}
- true
- Win32Proj
- bounce
-
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bin\x32\debug\bounce\
- obj\x32\debug\bounce\
- bounce
- .lib
-
-
- bin\x64\debug\bounce\
- obj\x64\debug\bounce\
- bounce
- .lib
-
-
- bin\x32\release\bounce\
- obj\x32\release\bounce\
- bounce
- .lib
-
-
- bin\x64\release\bounce\
- obj\x64\release\bounce\
- bounce
- .lib
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\include;%(AdditionalIncludeDirectories)
- EditAndContinue
- Disabled
- false
- Fast
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\include;%(AdditionalIncludeDirectories)
- ProgramDatabase
- Disabled
- false
- Fast
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\include;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
-
-
- Windows
- false
- true
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\include;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
-
-
- Windows
- false
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/bounce.vcxproj.filters b/build/vs2015/bounce.vcxproj.filters
deleted file mode 100644
index bca65bb..0000000
--- a/build/vs2015/bounce.vcxproj.filters
+++ /dev/null
@@ -1,458 +0,0 @@
-
-
-
-
- {89AF369E-F58E-B539-FEA6-40106A051C9B}
-
-
- {D419DC43-C0E7-CF49-A97B-407095E8ABAE}
-
-
- {0FC81CFD-FBEC-6B7D-2438-510D10BC6A9B}
-
-
- {9AC16B4F-867C-5BFB-2F34-D4451BCEA58B}
-
-
- {86F36B4F-72AE-5BFB-1B66-D4450700A68B}
-
-
- {02B88A21-6E9B-9961-779E-C79DE30060B2}
-
-
- {A12552DA-8D4B-1C41-7691-A10C6256410D}
-
-
- {AC64A0F9-18D1-5BF4-E1C4-F3514DF07D5C}
-
-
- {252146D6-1131-F2A6-7AEA-56C56619E13F}
-
-
- {B4B69780-A071-872C-4929-007735C3D1BC}
-
-
- {577D3B7B-43A3-05E2-2CE9-8AAD18AE2AAE}
-
-
- {DB55CFD2-478D-176A-5097-7B8DBC4D3E63}
-
-
- {09FBB88C-F54B-A4CE-1EB0-92900A603738}
-
-
- {14818B0F-00FE-7E52-297B-7F6615571BE6}
-
-
- {A1E236CD-8D08-0134-764E-86FF62132600}
-
-
- {4E48B2E1-3A6E-7C48-23B4-01140F79A114}
-
-
- {F52AA7E9-E14F-F669-0A9B-DBF9F61EF587}
-
-
- {2DAB880B-99B4-887C-2230-9F7C8E38947C}
-
-
- {F814F251-E4CC-339F-4DD4-0CFB39ABCE8F}
-
-
- {33003210-1F8F-BBD9-C8AD-CFD4B41BCC7F}
-
-
- {BE6BE8DC-AA90-375D-D3DB-1CEDBF5F367B}
-
-
- {AA9DE8DC-96C2-375D-BF0D-1DEDAB91367B}
-
-
- {A6DFD2EA-12ED-00D1-9BD3-FCBB07E0CC87}
-
-
- {C5E8A1B9-B1F8-4D8A-1AB2-B2A806E13C23}
-
-
- {50EF0F83-BC05-0E19-057D-993A71D2DEA0}
-
-
- {49F28903-35EC-B255-1E59-49660AF218C2}
-
-
- {D860140E-C485-638E-EDD0-481ED95462AC}
-
-
- {7F194C76-EB7A-2984-74E8-6F36E0486043}
-
-
- {2D17067F-19D2-F52A-C289-6E75AE2340BB}
-
-
- {3881B4FC-2468-76F4-CDB8-DC11B97EEF5A}
-
-
- {C5A586AC-B1B5-327D-1A6F-979B069E2116}
-
-
- {720B02C1-5E1B-AE91-C7D4-12B0B3039D2A}
-
-
- {1963BCFC-05F2-45C6-AE10-5AC19A7E566C}
-
-
-
-
- include\bounce
-
-
- include\bounce\collision
-
-
- include\bounce\collision
-
-
- include\bounce\collision\gjk
-
-
- include\bounce\collision\gjk
-
-
- include\bounce\collision\gjk
-
-
- include\bounce\collision\sat
-
-
- include\bounce\collision\sat
-
-
- include\bounce\collision\sat
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\collision\trees
-
-
- include\bounce\collision\trees
-
-
- include\bounce\common
-
-
- include\bounce\common
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\math
-
-
- include\bounce\common\memory
-
-
- include\bounce\common\memory
-
-
- include\bounce\common
-
-
- include\bounce\common\template
-
-
- include\bounce\common\template
-
-
- include\bounce\common\template
-
-
- include\bounce\common\template
-
-
- include\bounce\common
-
-
- include\bounce\dynamics
-
-
- include\bounce\dynamics
-
-
- include\bounce\dynamics\contacts\collide
-
-
- include\bounce\dynamics\contacts\collide
-
-
- include\bounce\dynamics\contacts
-
-
- include\bounce\dynamics\contacts
-
-
- include\bounce\dynamics\contacts
-
-
- include\bounce\dynamics\contacts
-
-
- include\bounce\dynamics\contacts
-
-
- include\bounce\dynamics\contacts
-
-
- include\bounce\dynamics
-
-
- include\bounce\dynamics
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\joints
-
-
- include\bounce\dynamics\shapes
-
-
- include\bounce\dynamics\shapes
-
-
- include\bounce\dynamics\shapes
-
-
- include\bounce\dynamics\shapes
-
-
- include\bounce\dynamics\shapes
-
-
- include\bounce\dynamics
-
-
- include\bounce\dynamics
-
-
- include\bounce\dynamics
-
-
- include\bounce\quickhull
-
-
-
-
- src\bounce\collision
-
-
- src\bounce\collision
-
-
- src\bounce\collision\gjk
-
-
- src\bounce\collision\gjk
-
-
- src\bounce\collision\gjk
-
-
- src\bounce\collision\sat
-
-
- src\bounce\collision\sat
-
-
- src\bounce\collision\sat
-
-
- src\bounce\collision\shapes
-
-
- src\bounce\collision\trees
-
-
- src\bounce\collision\trees
-
-
- src\bounce\common\math
-
-
- src\bounce\common\memory
-
-
- src\bounce\common\memory
-
-
- src\bounce\common
-
-
- src\bounce\common
-
-
- src\bounce\dynamics
-
-
- src\bounce\dynamics
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts\collide
-
-
- src\bounce\dynamics\contacts
-
-
- src\bounce\dynamics\contacts
-
-
- src\bounce\dynamics\contacts
-
-
- src\bounce\dynamics\contacts
-
-
- src\bounce\dynamics\contacts
-
-
- src\bounce\dynamics\contacts
-
-
- src\bounce\dynamics
-
-
- src\bounce\dynamics
-
-
- src\bounce\dynamics
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\joints
-
-
- src\bounce\dynamics\shapes
-
-
- src\bounce\dynamics\shapes
-
-
- src\bounce\dynamics\shapes
-
-
- src\bounce\dynamics\shapes
-
-
- src\bounce\dynamics\shapes
-
-
- src\bounce\dynamics
-
-
- src\bounce\quickhull
-
-
-
-
- include\bounce\collision\shapes
-
-
- include\bounce\quickhull
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/glad.vcxproj b/build/vs2015/glad.vcxproj
deleted file mode 100644
index fc2d28f..0000000
--- a/build/vs2015/glad.vcxproj
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
-
-
- debug
- Win32
-
-
- debug
- x64
-
-
- release
- Win32
-
-
- release
- x64
-
-
-
- {DD62977C-C999-980D-7286-7E105E9C140F}
- true
- Win32Proj
- glad
-
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bin\x32\debug\glad\
- obj\x32\debug\glad\
- glad
- .lib
-
-
- bin\x64\debug\glad\
- obj\x64\debug\glad\
- glad
- .lib
-
-
- bin\x32\release\glad\
- obj\x32\release\glad\
- glad
- .lib
-
-
- bin\x64\release\glad\
- obj\x64\release\glad\
- glad
- .lib
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- EditAndContinue
- Disabled
- false
- Fast
- CompileAsC
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- ProgramDatabase
- Disabled
- false
- Fast
- CompileAsC
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
- CompileAsC
-
-
- Windows
- false
- true
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
- CompileAsC
-
-
- Windows
- false
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/glad.vcxproj.filters b/build/vs2015/glad.vcxproj.filters
deleted file mode 100644
index 3f4c0a6..0000000
--- a/build/vs2015/glad.vcxproj.filters
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- {C196CD9C-2D76-4C38-368E-D70EA2ECB299}
-
-
- {89565304-F535-D29F-FE4D-5D766AAC3801}
-
-
-
-
- Headers
-
-
- Headers
-
-
-
-
- Sources
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/glfw.vcxproj b/build/vs2015/glfw.vcxproj
deleted file mode 100644
index 2b629be..0000000
--- a/build/vs2015/glfw.vcxproj
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
- debug
- Win32
-
-
- debug
- x64
-
-
- release
- Win32
-
-
- release
- x64
-
-
-
- {9563977C-819A-980D-2A87-7E10169D140F}
- true
- Win32Proj
- glfw
-
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bin\x32\debug\glfw\
- obj\x32\debug\glfw\
- glfw
- .lib
-
-
- bin\x64\debug\glfw\
- obj\x64\debug\glfw\
- glfw
- .lib
-
-
- bin\x32\release\glfw\
- obj\x32\release\glfw\
- glfw
- .lib
-
-
- bin\x64\release\glfw\
- obj\x64\release\glfw\
- glfw
- .lib
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;_GLFW_USE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external\glfw;%(AdditionalIncludeDirectories)
- EditAndContinue
- Disabled
- false
- Fast
- CompileAsC
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;_GLFW_USE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external\glfw;%(AdditionalIncludeDirectories)
- ProgramDatabase
- Disabled
- false
- Fast
- CompileAsC
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;_GLFW_USE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external\glfw;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
- CompileAsC
-
-
- Windows
- false
- true
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;_GLFW_USE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external\glfw;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
- CompileAsC
-
-
- Windows
- false
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/glfw.vcxproj.filters b/build/vs2015/glfw.vcxproj.filters
deleted file mode 100644
index 0f71ea6..0000000
--- a/build/vs2015/glfw.vcxproj.filters
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
- {C196CD9C-2D76-4C38-368E-D70EA2ECB299}
-
-
- {89565304-F535-D29F-FE4D-5D766AAC3801}
-
-
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/imgui.vcxproj b/build/vs2015/imgui.vcxproj
deleted file mode 100644
index 7b1660c..0000000
--- a/build/vs2015/imgui.vcxproj
+++ /dev/null
@@ -1,183 +0,0 @@
-
-
-
-
- debug
- Win32
-
-
- debug
- x64
-
-
- release
- Win32
-
-
- release
- x64
-
-
-
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}
- true
- Win32Proj
- imgui
-
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- true
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
- StaticLibrary
- false
- Unicode
- v140
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bin\x32\debug\imgui\
- obj\x32\debug\imgui\
- imgui
- .lib
-
-
- bin\x64\debug\imgui\
- obj\x64\debug\imgui\
- imgui
- .lib
-
-
- bin\x32\release\imgui\
- obj\x32\release\imgui\
- imgui
- .lib
-
-
- bin\x64\release\imgui\
- obj\x64\release\imgui\
- imgui
- .lib
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- EditAndContinue
- Disabled
- false
- Fast
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- ProgramDatabase
- Disabled
- false
- Fast
-
-
- Windows
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
-
-
- Windows
- false
- true
- true
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- ..\..\external;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
-
-
- Windows
- false
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/imgui.vcxproj.filters b/build/vs2015/imgui.vcxproj.filters
deleted file mode 100644
index d8aa08e..0000000
--- a/build/vs2015/imgui.vcxproj.filters
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- {C196CD9C-2D76-4C38-368E-D70EA2ECB299}
-
-
- {89565304-F535-D29F-FE4D-5D766AAC3801}
-
-
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/testbed.vcxproj b/build/vs2015/testbed.vcxproj
deleted file mode 100644
index 3038242..0000000
--- a/build/vs2015/testbed.vcxproj
+++ /dev/null
@@ -1,235 +0,0 @@
-
-
-
-
- debug
- Win32
-
-
- debug
- x64
-
-
- release
- Win32
-
-
- release
- x64
-
-
-
- {90781ED9-FC57-9D74-0570-284B71CE03D6}
- true
- Win32Proj
- testbed
-
-
-
- Application
- true
- Unicode
- v140
-
-
- Application
- true
- Unicode
- v140
-
-
- Application
- false
- Unicode
- v140
-
-
- Application
- false
- Unicode
- v140
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- bin\x32\debug\testbed\
- obj\x32\debug\testbed\
- testbed
- .exe
-
-
- true
- bin\x64\debug\testbed\
- obj\x64\debug\testbed\
- testbed
- .exe
-
-
- false
- bin\x32\release\testbed\
- obj\x32\release\testbed\
- testbed
- .exe
-
-
- false
- bin\x64\release\testbed\
- obj\x64\release\testbed\
- testbed
- .exe
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\external;..\..\include;%(AdditionalIncludeDirectories)
- EditAndContinue
- Disabled
- false
- Fast
-
-
- Console
- true
- glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)
- mainCRTStartup
-
-
-
-
- NotUsing
- Level3
- _DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\external;..\..\include;%(AdditionalIncludeDirectories)
- ProgramDatabase
- Disabled
- false
- Fast
-
-
- Console
- true
- glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)
- mainCRTStartup
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\external;..\..\include;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
-
-
- Console
- false
- true
- true
- glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)
- mainCRTStartup
-
-
-
-
- NotUsing
- Level3
- NDEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)
- ..\..\external;..\..\include;%(AdditionalIncludeDirectories)
- Full
- true
- true
- false
- true
- false
- Fast
-
-
- Console
- false
- true
- true
- glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)
- mainCRTStartup
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {C13B93F4-ADDD-BDCA-9698-D11E82D9441B}
-
-
- {DD62977C-C999-980D-7286-7E105E9C140F}
-
-
- {9563977C-819A-980D-2A87-7E10169D140F}
-
-
- {0098A80F-6CAC-D0C0-352E-7420A101CDF1}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/vs2015/testbed.vcxproj.filters b/build/vs2015/testbed.vcxproj.filters
deleted file mode 100644
index 2edc665..0000000
--- a/build/vs2015/testbed.vcxproj.filters
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
- {C196CD9C-2D76-4C38-368E-D70EA2ECB299}
-
-
- {89565304-F535-D29F-FE4D-5D766AAC3801}
-
-
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
- Headers
-
-
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
-
\ No newline at end of file
diff --git a/building.txt b/building.txt
index 6cfdc32..dcdd949 100644
--- a/building.txt
+++ b/building.txt
@@ -1,14 +1,35 @@
Bounce uses premake for generating project files in a platform agnostic manner.
Grab premake from http://industriousone.com/premake.
-Put premake.exe into bounce/.
+Put premake into bounce/.
Visual Studio 2015
-Open bounce/bat.
-Open premake_vs2015.bat. This will run a premake script and open bounce/build/vs2015/bounce.sln.
+Say { premake5 vs2015 } on a command line.
+Open build/vs2015/bounce.sln.
Set testbed as the startup project.
-Press F5 or Ctrl-F5 to run.
+Press F5 to run.
-premake files for building on Mac will be available later because I don't run Mac currently and
-therefore can't test the build system in this platform.
\ No newline at end of file
+Linux
+
+On a clean Ubuntu 16.04 install these packages first:
+
+mesa-common-dev
+libgl1-mesa-dev
+libglu1-mesa-dev
+
+x32
+
+Say { premake5 gmake } on a terminal.
+From build/gmake say { make config="debug_x32" }.
+Open testbed from /bin/x32/testbed/.
+
+x64
+
+Say { premake5 gmake } on a terminal.
+From build/gmake say { make config="debug_x64" }.
+Open testbed from /bin/x64/testbed/.
+
+Mac
+
+I don't run Mac currently and therefore can't test the build system in this platform.
diff --git a/external/glad/glad.h b/external/glad/glad.h
index f256317..030df9c 100644
--- a/external/glad/glad.h
+++ b/external/glad/glad.h
@@ -636,7 +636,7 @@ GLAPI int gladLoadGL(void);
GLAPI int gladLoadGLLoader(GLADloadproc);
#include
-//#include
+//#include
#include
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glxext.h, so must be protected */
diff --git a/external/glad/glad_glx.c b/external/glad/glad_glx.c
new file mode 100644
index 0000000..aaa6e08
--- /dev/null
+++ b/external/glad/glad_glx.c
@@ -0,0 +1,312 @@
+/*
+
+ GLX loader generated by glad 0.1.12a0 on Tue Dec 20 17:04:11 2016.
+
+ Language/Generator: C/C++
+ Specification: glx
+ APIs: glx=1.4
+ Profile: -
+ Extensions:
+
+ Loader: True
+ Local files: False
+ Omit khrplatform: False
+
+ Commandline:
+ --api="glx=1.4" --generator="c" --spec="glx" --extensions=""
+ Online:
+ http://glad.dav1d.de/#language=c&specification=glx&loader=on&api=glx%3D1.4
+*/
+
+#include
+#include
+#include
+#include
+
+static void* get_proc(const char *namez);
+
+#ifdef _WIN32
+#include
+static HMODULE libGL;
+
+typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
+PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
+
+static
+int open_gl(void) {
+ libGL = LoadLibraryW(L"opengl32.dll");
+ if(libGL != NULL) {
+ gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
+ libGL, "wglGetProcAddress");
+ return gladGetProcAddressPtr != NULL;
+ }
+
+ return 0;
+}
+
+static
+void close_gl(void) {
+ if(libGL != NULL) {
+ FreeLibrary(libGL);
+ libGL = NULL;
+ }
+}
+#else
+#include
+static void* libGL;
+
+#ifndef __APPLE__
+typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
+PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
+#endif
+
+static
+int open_gl(void) {
+#ifdef __APPLE__
+ static const char *NAMES[] = {
+ "../Frameworks/OpenGL.framework/OpenGL",
+ "/Library/Frameworks/OpenGL.framework/OpenGL",
+ "/System/Library/Frameworks/OpenGL.framework/OpenGL",
+ "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
+ };
+#else
+ static const char *NAMES[] = {"libGL.so.1", "libGL.so"};
+#endif
+
+ unsigned int index = 0;
+ for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
+ libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
+
+ if(libGL != NULL) {
+#ifdef __APPLE__
+ return 1;
+#else
+ gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
+ "glXGetProcAddressARB");
+ return gladGetProcAddressPtr != NULL;
+#endif
+ }
+ }
+
+ return 0;
+}
+
+static
+void close_gl() {
+ if(libGL != NULL) {
+ dlclose(libGL);
+ libGL = NULL;
+ }
+}
+#endif
+
+static
+void* get_proc(const char *namez) {
+ void* result = NULL;
+ if(libGL == NULL) return NULL;
+
+#ifndef __APPLE__
+ if(gladGetProcAddressPtr != NULL) {
+ result = gladGetProcAddressPtr(namez);
+ }
+#endif
+ if(result == NULL) {
+#ifdef _WIN32
+ result = (void*)GetProcAddress(libGL, namez);
+#else
+ result = dlsym(libGL, namez);
+#endif
+ }
+
+ return result;
+}
+
+int gladLoadGLX(Display *dpy, int screen) {
+ int status = 0;
+
+ if(open_gl()) {
+ status = gladLoadGLXLoader((GLADloadproc)get_proc, dpy, screen);
+ close_gl();
+ }
+
+ return status;
+}
+
+static Display *GLADGLXDisplay = 0;
+static int GLADGLXscreen = 0;
+
+static int get_exts(void) {
+ return 1;
+}
+
+static void free_exts(void) {
+ return;
+}
+
+static int has_ext(const char *ext) {
+ const char *terminator;
+ const char *loc;
+ const char *extensions;
+
+ if(!GLAD_GLX_VERSION_1_1)
+ return 0;
+
+ extensions = glXQueryExtensionsString(GLADGLXDisplay, GLADGLXscreen);
+
+ if(extensions == NULL || ext == NULL)
+ return 0;
+
+ while(1) {
+ loc = strstr(extensions, ext);
+ if(loc == NULL)
+ break;
+
+ terminator = loc + strlen(ext);
+ if((loc == extensions || *(loc - 1) == ' ') &&
+ (*terminator == ' ' || *terminator == '\0'))
+ {
+ return 1;
+ }
+ extensions = terminator;
+ }
+
+ return 0;
+}
+
+int GLAD_GLX_VERSION_1_0;
+int GLAD_GLX_VERSION_1_1;
+int GLAD_GLX_VERSION_1_2;
+int GLAD_GLX_VERSION_1_3;
+int GLAD_GLX_VERSION_1_4;
+PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent;
+PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension;
+PFNGLXMAKECURRENTPROC glad_glXMakeCurrent;
+PFNGLXSELECTEVENTPROC glad_glXSelectEvent;
+PFNGLXCREATECONTEXTPROC glad_glXCreateContext;
+PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap;
+PFNGLXQUERYVERSIONPROC glad_glXQueryVersion;
+PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable;
+PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap;
+PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext;
+PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
+PFNGLXWAITGLPROC glad_glXWaitGL;
+PFNGLXISDIRECTPROC glad_glXIsDirect;
+PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow;
+PFNGLXCREATEWINDOWPROC glad_glXCreateWindow;
+PFNGLXCOPYCONTEXTPROC glad_glXCopyContext;
+PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer;
+PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers;
+PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay;
+PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable;
+PFNGLXQUERYCONTEXTPROC glad_glXQueryContext;
+PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual;
+PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString;
+PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext;
+PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap;
+PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib;
+PFNGLXUSEXFONTPROC glad_glXUseXFont;
+PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer;
+PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig;
+PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext;
+PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent;
+PFNGLXGETCONFIGPROC glad_glXGetConfig;
+PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs;
+PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap;
+PFNGLXWAITXPROC glad_glXWaitX;
+PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig;
+PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable;
+PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString;
+PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString;
+static void load_GLX_VERSION_1_0(GLADloadproc load) {
+ if(!GLAD_GLX_VERSION_1_0) return;
+ glad_glXChooseVisual = (PFNGLXCHOOSEVISUALPROC)load("glXChooseVisual");
+ glad_glXCreateContext = (PFNGLXCREATECONTEXTPROC)load("glXCreateContext");
+ glad_glXDestroyContext = (PFNGLXDESTROYCONTEXTPROC)load("glXDestroyContext");
+ glad_glXMakeCurrent = (PFNGLXMAKECURRENTPROC)load("glXMakeCurrent");
+ glad_glXCopyContext = (PFNGLXCOPYCONTEXTPROC)load("glXCopyContext");
+ glad_glXSwapBuffers = (PFNGLXSWAPBUFFERSPROC)load("glXSwapBuffers");
+ glad_glXCreateGLXPixmap = (PFNGLXCREATEGLXPIXMAPPROC)load("glXCreateGLXPixmap");
+ glad_glXDestroyGLXPixmap = (PFNGLXDESTROYGLXPIXMAPPROC)load("glXDestroyGLXPixmap");
+ glad_glXQueryExtension = (PFNGLXQUERYEXTENSIONPROC)load("glXQueryExtension");
+ glad_glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion");
+ glad_glXIsDirect = (PFNGLXISDIRECTPROC)load("glXIsDirect");
+ glad_glXGetConfig = (PFNGLXGETCONFIGPROC)load("glXGetConfig");
+ glad_glXGetCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC)load("glXGetCurrentContext");
+ glad_glXGetCurrentDrawable = (PFNGLXGETCURRENTDRAWABLEPROC)load("glXGetCurrentDrawable");
+ glad_glXWaitGL = (PFNGLXWAITGLPROC)load("glXWaitGL");
+ glad_glXWaitX = (PFNGLXWAITXPROC)load("glXWaitX");
+ glad_glXUseXFont = (PFNGLXUSEXFONTPROC)load("glXUseXFont");
+}
+static void load_GLX_VERSION_1_1(GLADloadproc load) {
+ if(!GLAD_GLX_VERSION_1_1) return;
+ glad_glXQueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRINGPROC)load("glXQueryExtensionsString");
+ glad_glXQueryServerString = (PFNGLXQUERYSERVERSTRINGPROC)load("glXQueryServerString");
+ glad_glXGetClientString = (PFNGLXGETCLIENTSTRINGPROC)load("glXGetClientString");
+}
+static void load_GLX_VERSION_1_2(GLADloadproc load) {
+ if(!GLAD_GLX_VERSION_1_2) return;
+ glad_glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)load("glXGetCurrentDisplay");
+}
+static void load_GLX_VERSION_1_3(GLADloadproc load) {
+ if(!GLAD_GLX_VERSION_1_3) return;
+ glad_glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)load("glXGetFBConfigs");
+ glad_glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)load("glXChooseFBConfig");
+ glad_glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)load("glXGetFBConfigAttrib");
+ glad_glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)load("glXGetVisualFromFBConfig");
+ glad_glXCreateWindow = (PFNGLXCREATEWINDOWPROC)load("glXCreateWindow");
+ glad_glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)load("glXDestroyWindow");
+ glad_glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)load("glXCreatePixmap");
+ glad_glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)load("glXDestroyPixmap");
+ glad_glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)load("glXCreatePbuffer");
+ glad_glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)load("glXDestroyPbuffer");
+ glad_glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)load("glXQueryDrawable");
+ glad_glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)load("glXCreateNewContext");
+ glad_glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)load("glXMakeContextCurrent");
+ glad_glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)load("glXGetCurrentReadDrawable");
+ glad_glXQueryContext = (PFNGLXQUERYCONTEXTPROC)load("glXQueryContext");
+ glad_glXSelectEvent = (PFNGLXSELECTEVENTPROC)load("glXSelectEvent");
+ glad_glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)load("glXGetSelectedEvent");
+}
+static void load_GLX_VERSION_1_4(GLADloadproc load) {
+ if(!GLAD_GLX_VERSION_1_4) return;
+ glad_glXGetProcAddress = (PFNGLXGETPROCADDRESSPROC)load("glXGetProcAddress");
+}
+static int find_extensionsGLX(void) {
+ if (!get_exts()) return 0;
+ free_exts();
+ return 1;
+}
+
+static void find_coreGLX(Display *dpy, int screen) {
+ int major = 0, minor = 0;
+ if(dpy == 0 && GLADGLXDisplay == 0) {
+ dpy = XOpenDisplay(0);
+ screen = XScreenNumberOfScreen(XDefaultScreenOfDisplay(dpy));
+ } else if(dpy == 0) {
+ dpy = GLADGLXDisplay;
+ screen = GLADGLXscreen;
+ }
+ glXQueryVersion(dpy, &major, &minor);
+ GLADGLXDisplay = dpy;
+ GLADGLXscreen = screen;
+ GLAD_GLX_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
+ GLAD_GLX_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
+ GLAD_GLX_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
+ GLAD_GLX_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
+ GLAD_GLX_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
+}
+
+int gladLoadGLXLoader(GLADloadproc load, Display *dpy, int screen) {
+ glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion");
+ if(glXQueryVersion == NULL) return 0;
+ find_coreGLX(dpy, screen);
+ load_GLX_VERSION_1_0(load);
+ load_GLX_VERSION_1_1(load);
+ load_GLX_VERSION_1_2(load);
+ load_GLX_VERSION_1_3(load);
+ load_GLX_VERSION_1_4(load);
+
+ if (!find_extensionsGLX()) return 0;
+ return 1;
+}
+
diff --git a/external/glad/glad_glx.h b/external/glad/glad_glx.h
new file mode 100644
index 0000000..d402402
--- /dev/null
+++ b/external/glad/glad_glx.h
@@ -0,0 +1,433 @@
+/*
+
+ GLX loader generated by glad 0.1.12a0 on Tue Dec 20 17:04:11 2016.
+
+ Language/Generator: C/C++
+ Specification: glx
+ APIs: glx=1.4
+ Profile: -
+ Extensions:
+
+ Loader: True
+ Local files: False
+ Omit khrplatform: False
+
+ Commandline:
+ --api="glx=1.4" --generator="c" --spec="glx" --extensions=""
+ Online:
+ http://glad.dav1d.de/#language=c&specification=glx&loader=on&api=glx%3D1.4
+*/
+
+
+#include
+#include
+#include
+#include
+
+#ifndef __glad_glxext_h_
+
+#ifdef __glxext_h_
+#error GLX header already included, remove this include, glad already provides it
+#endif
+
+#define __glad_glxext_h_
+#define __glxext_h_
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void* (* GLADloadproc)(const char *name);
+
+#ifndef GLAPI
+# if defined(GLAD_GLAPI_EXPORT)
+# if defined(WIN32) || defined(__CYGWIN__)
+# if defined(GLAD_GLAPI_EXPORT_BUILD)
+# if defined(__GNUC__)
+# define GLAPI __attribute__ ((dllexport)) extern
+# else
+# define GLAPI __declspec(dllexport) extern
+# endif
+# else
+# if defined(__GNUC__)
+# define GLAPI __attribute__ ((dllimport)) extern
+# else
+# define GLAPI __declspec(dllimport) extern
+# endif
+# endif
+# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD)
+# define GLAPI __attribute__ ((visibility ("default"))) extern
+# else
+# define GLAPI extern
+# endif
+# else
+# define GLAPI extern
+# endif
+#endif
+
+GLAPI int gladLoadGLX(Display *dpy, int screen);
+
+GLAPI int gladLoadGLXLoader(GLADloadproc, Display *dpy, int screen);
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include
+#elif defined(__sun__) || defined(__digital__)
+#include
+#if defined(__STDC__)
+#if defined(__arch64__) || defined(_LP64)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS ) || defined(__sgi)
+#include
+#elif defined(__SCO__) || defined(__USLC__)
+#include
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+/* Fallback if nothing above works */
+#include
+#endif
+#endif
+typedef XID GLXFBConfigID;
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXContextID;
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+typedef void (APIENTRY *__GLXextFuncPtr)(void);
+typedef XID GLXVideoCaptureDeviceNV;
+typedef unsigned int GLXVideoDeviceNV;
+typedef XID GLXVideoSourceSGIX;
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+typedef XID GLXPbufferSGIX;
+typedef struct {
+ int event_type; /* GLX_DAMAGED or GLX_SAVED */
+ int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* XID of Drawable */
+ unsigned int buffer_mask; /* mask indicating which buffers are affected */
+ unsigned int aux_buffer; /* which aux buffer was affected */
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXPbufferClobberEvent;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ GLXDrawable drawable; /* drawable on which event was requested in event mask */
+ int event_type;
+ int64_t ust;
+ int64_t msc;
+ int64_t sbc;
+} GLXBufferSwapComplete;
+typedef union __GLXEvent {
+ GLXPbufferClobberEvent glxpbufferclobber;
+ GLXBufferSwapComplete glxbufferswapcomplete;
+ long pad[24];
+} GLXEvent;
+typedef struct {
+ int type;
+ unsigned long serial;
+ Bool send_event;
+ Display *display;
+ int extension;
+ int evtype;
+ GLXDrawable window;
+ Bool stereo_tree;
+} GLXStereoNotifyEventEXT;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* i.d. of Drawable */
+ int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+ int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+ unsigned int mask; /* mask indicating which buffers are affected*/
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int channel;
+ unsigned int participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+#define GLX_EXTENSION_NAME "GLX"
+#define GLX_PbufferClobber 0
+#define GLX_BufferSwapComplete 1
+#define __GLX_NUMBER_EVENTS 17
+#define GLX_BAD_SCREEN 1
+#define GLX_BAD_ATTRIBUTE 2
+#define GLX_NO_EXTENSION 3
+#define GLX_BAD_VISUAL 4
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
+#define GLX_VENDOR 0x1
+#define GLX_VERSION 0x2
+#define GLX_EXTENSIONS 0x3
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#define GLX_SAMPLE_BUFFERS 100000
+#define GLX_SAMPLES 100001
+#ifndef GLX_VERSION_1_0
+#define GLX_VERSION_1_0 1
+GLAPI int GLAD_GLX_VERSION_1_0;
+typedef XVisualInfo * (APIENTRYP PFNGLXCHOOSEVISUALPROC)(Display *dpy, int screen, int *attribList);
+GLAPI PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual;
+#define glXChooseVisual glad_glXChooseVisual
+typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTPROC)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+GLAPI PFNGLXCREATECONTEXTPROC glad_glXCreateContext;
+#define glXCreateContext glad_glXCreateContext
+typedef void (APIENTRYP PFNGLXDESTROYCONTEXTPROC)(Display *dpy, GLXContext ctx);
+GLAPI PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext;
+#define glXDestroyContext glad_glXDestroyContext
+typedef Bool (APIENTRYP PFNGLXMAKECURRENTPROC)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
+GLAPI PFNGLXMAKECURRENTPROC glad_glXMakeCurrent;
+#define glXMakeCurrent glad_glXMakeCurrent
+typedef void (APIENTRYP PFNGLXCOPYCONTEXTPROC)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
+GLAPI PFNGLXCOPYCONTEXTPROC glad_glXCopyContext;
+#define glXCopyContext glad_glXCopyContext
+typedef void (APIENTRYP PFNGLXSWAPBUFFERSPROC)(Display *dpy, GLXDrawable drawable);
+GLAPI PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers;
+#define glXSwapBuffers glad_glXSwapBuffers
+typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPPROC)(Display *dpy, XVisualInfo *visual, Pixmap pixmap);
+GLAPI PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap;
+#define glXCreateGLXPixmap glad_glXCreateGLXPixmap
+typedef void (APIENTRYP PFNGLXDESTROYGLXPIXMAPPROC)(Display *dpy, GLXPixmap pixmap);
+GLAPI PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap;
+#define glXDestroyGLXPixmap glad_glXDestroyGLXPixmap
+typedef Bool (APIENTRYP PFNGLXQUERYEXTENSIONPROC)(Display *dpy, int *errorb, int *event);
+GLAPI PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension;
+#define glXQueryExtension glad_glXQueryExtension
+typedef Bool (APIENTRYP PFNGLXQUERYVERSIONPROC)(Display *dpy, int *maj, int *min);
+GLAPI PFNGLXQUERYVERSIONPROC glad_glXQueryVersion;
+#define glXQueryVersion glad_glXQueryVersion
+typedef Bool (APIENTRYP PFNGLXISDIRECTPROC)(Display *dpy, GLXContext ctx);
+GLAPI PFNGLXISDIRECTPROC glad_glXIsDirect;
+#define glXIsDirect glad_glXIsDirect
+typedef int (APIENTRYP PFNGLXGETCONFIGPROC)(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+GLAPI PFNGLXGETCONFIGPROC glad_glXGetConfig;
+#define glXGetConfig glad_glXGetConfig
+typedef GLXContext (APIENTRYP PFNGLXGETCURRENTCONTEXTPROC)();
+GLAPI PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext;
+#define glXGetCurrentContext glad_glXGetCurrentContext
+typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTDRAWABLEPROC)();
+GLAPI PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable;
+#define glXGetCurrentDrawable glad_glXGetCurrentDrawable
+typedef void (APIENTRYP PFNGLXWAITGLPROC)();
+GLAPI PFNGLXWAITGLPROC glad_glXWaitGL;
+#define glXWaitGL glad_glXWaitGL
+typedef void (APIENTRYP PFNGLXWAITXPROC)();
+GLAPI PFNGLXWAITXPROC glad_glXWaitX;
+#define glXWaitX glad_glXWaitX
+typedef void (APIENTRYP PFNGLXUSEXFONTPROC)(Font font, int first, int count, int list);
+GLAPI PFNGLXUSEXFONTPROC glad_glXUseXFont;
+#define glXUseXFont glad_glXUseXFont
+#endif
+#ifndef GLX_VERSION_1_1
+#define GLX_VERSION_1_1 1
+GLAPI int GLAD_GLX_VERSION_1_1;
+typedef const char * (APIENTRYP PFNGLXQUERYEXTENSIONSSTRINGPROC)(Display *dpy, int screen);
+GLAPI PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString;
+#define glXQueryExtensionsString glad_glXQueryExtensionsString
+typedef const char * (APIENTRYP PFNGLXQUERYSERVERSTRINGPROC)(Display *dpy, int screen, int name);
+GLAPI PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString;
+#define glXQueryServerString glad_glXQueryServerString
+typedef const char * (APIENTRYP PFNGLXGETCLIENTSTRINGPROC)(Display *dpy, int name);
+GLAPI PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString;
+#define glXGetClientString glad_glXGetClientString
+#endif
+#ifndef GLX_VERSION_1_2
+#define GLX_VERSION_1_2 1
+GLAPI int GLAD_GLX_VERSION_1_2;
+typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYPROC)();
+GLAPI PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay;
+#define glXGetCurrentDisplay glad_glXGetCurrentDisplay
+#endif
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+GLAPI int GLAD_GLX_VERSION_1_3;
+typedef GLXFBConfig * (APIENTRYP PFNGLXGETFBCONFIGSPROC)(Display *dpy, int screen, int *nelements);
+GLAPI PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs;
+#define glXGetFBConfigs glad_glXGetFBConfigs
+typedef GLXFBConfig * (APIENTRYP PFNGLXCHOOSEFBCONFIGPROC)(Display *dpy, int screen, const int *attrib_list, int *nelements);
+GLAPI PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig;
+#define glXChooseFBConfig glad_glXChooseFBConfig
+typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBPROC)(Display *dpy, GLXFBConfig config, int attribute, int *value);
+GLAPI PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib;
+#define glXGetFBConfigAttrib glad_glXGetFBConfigAttrib
+typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGPROC)(Display *dpy, GLXFBConfig config);
+GLAPI PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig;
+#define glXGetVisualFromFBConfig glad_glXGetVisualFromFBConfig
+typedef GLXWindow (APIENTRYP PFNGLXCREATEWINDOWPROC)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+GLAPI PFNGLXCREATEWINDOWPROC glad_glXCreateWindow;
+#define glXCreateWindow glad_glXCreateWindow
+typedef void (APIENTRYP PFNGLXDESTROYWINDOWPROC)(Display *dpy, GLXWindow win);
+GLAPI PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow;
+#define glXDestroyWindow glad_glXDestroyWindow
+typedef GLXPixmap (APIENTRYP PFNGLXCREATEPIXMAPPROC)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+GLAPI PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap;
+#define glXCreatePixmap glad_glXCreatePixmap
+typedef void (APIENTRYP PFNGLXDESTROYPIXMAPPROC)(Display *dpy, GLXPixmap pixmap);
+GLAPI PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap;
+#define glXDestroyPixmap glad_glXDestroyPixmap
+typedef GLXPbuffer (APIENTRYP PFNGLXCREATEPBUFFERPROC)(Display *dpy, GLXFBConfig config, const int *attrib_list);
+GLAPI PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer;
+#define glXCreatePbuffer glad_glXCreatePbuffer
+typedef void (APIENTRYP PFNGLXDESTROYPBUFFERPROC)(Display *dpy, GLXPbuffer pbuf);
+GLAPI PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer;
+#define glXDestroyPbuffer glad_glXDestroyPbuffer
+typedef void (APIENTRYP PFNGLXQUERYDRAWABLEPROC)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+GLAPI PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable;
+#define glXQueryDrawable glad_glXQueryDrawable
+typedef GLXContext (APIENTRYP PFNGLXCREATENEWCONTEXTPROC)(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+GLAPI PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext;
+#define glXCreateNewContext glad_glXCreateNewContext
+typedef Bool (APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+GLAPI PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent;
+#define glXMakeContextCurrent glad_glXMakeContextCurrent
+typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLEPROC)();
+GLAPI PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable;
+#define glXGetCurrentReadDrawable glad_glXGetCurrentReadDrawable
+typedef int (APIENTRYP PFNGLXQUERYCONTEXTPROC)(Display *dpy, GLXContext ctx, int attribute, int *value);
+GLAPI PFNGLXQUERYCONTEXTPROC glad_glXQueryContext;
+#define glXQueryContext glad_glXQueryContext
+typedef void (APIENTRYP PFNGLXSELECTEVENTPROC)(Display *dpy, GLXDrawable draw, unsigned long event_mask);
+GLAPI PFNGLXSELECTEVENTPROC glad_glXSelectEvent;
+#define glXSelectEvent glad_glXSelectEvent
+typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTPROC)(Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+GLAPI PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent;
+#define glXGetSelectedEvent glad_glXGetSelectedEvent
+#endif
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+GLAPI int GLAD_GLX_VERSION_1_4;
+typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSPROC)(const GLubyte *procName);
+GLAPI PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
+#define glXGetProcAddress glad_glXGetProcAddress
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/external/glfw/CMakeLists.txt b/external/glfw/CMakeLists.txt
deleted file mode 100644
index 9c5ee15..0000000
--- a/external/glfw/CMakeLists.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-add_definitions(-D_GLFW_USE_CONFIG_H)
-
-set(common_HEADERS internal.h
- "${GLFW_BINARY_DIR}/src/glfw_config.h"
- "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
- "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
-set(common_SOURCES context.c init.c input.c monitor.c vulkan.c window.c)
-
-if (_GLFW_COCOA)
- set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h cocoa_joystick.h
- posix_tls.h nsgl_context.h)
- set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_joystick.m
- cocoa_monitor.m cocoa_window.m cocoa_time.c posix_tls.c
- nsgl_context.m)
-elseif (_GLFW_WIN32)
- set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_joystick.h
- wgl_context.h egl_context.h)
- set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_joystick.c
- win32_monitor.c win32_time.c win32_tls.c win32_window.c
- wgl_context.c egl_context.c)
-elseif (_GLFW_X11)
- set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h
- linux_joystick.h posix_time.h posix_tls.h glx_context.h
- egl_context.h)
- set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c
- xkb_unicode.c linux_joystick.c posix_time.c posix_tls.c
- glx_context.c egl_context.c)
-elseif (_GLFW_WAYLAND)
- set(glfw_HEADERS ${common_HEADERS} wl_platform.h linux_joystick.h
- posix_time.h posix_tls.h xkb_unicode.h egl_context.h)
- set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c
- linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c
- egl_context.c)
-
- ecm_add_wayland_client_protocol(glfw_SOURCES
- PROTOCOL
- ${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml
- BASENAME relative-pointer-unstable-v1)
- ecm_add_wayland_client_protocol(glfw_SOURCES
- PROTOCOL
- ${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
- BASENAME pointer-constraints-unstable-v1)
-elseif (_GLFW_MIR)
- set(glfw_HEADERS ${common_HEADERS} mir_platform.h linux_joystick.h
- posix_time.h posix_tls.h xkb_unicode.h egl_context.h)
- set(glfw_SOURCES ${common_SOURCES} mir_init.c mir_monitor.c mir_window.c
- linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c
- egl_context.c)
-endif()
-
-if (APPLE)
- # For some reason, CMake doesn't know about .m
- set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
-endif()
-
-add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
-set_target_properties(glfw PROPERTIES
- OUTPUT_NAME ${GLFW_LIB_NAME}
- VERSION ${GLFW_VERSION}
- SOVERSION ${GLFW_VERSION_MAJOR}
- POSITION_INDEPENDENT_CODE ON
- FOLDER "GLFW3")
-
-target_compile_definitions(glfw PRIVATE -D_GLFW_USE_CONFIG_H)
-target_include_directories(glfw PUBLIC
- $
- $/include>)
-target_include_directories(glfw PRIVATE
- "${GLFW_SOURCE_DIR}/src"
- "${GLFW_BINARY_DIR}/src"
- ${glfw_INCLUDE_DIRS})
-
-# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
-# the inclusion of stddef.h (by glfw3.h), which is itself included before
-# win32_platform.h. We define them here until a saner solution can be found
-# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
-target_compile_definitions(glfw PRIVATE
- "$<$:UNICODE;WINVER=0x0501>")
-
-# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
-target_compile_options(glfw PRIVATE
- "$<$:-Wall>"
- "$<$:-Wall>")
-
-if (BUILD_SHARED_LIBS)
- if (WIN32)
- if (MINGW)
- # Remove the lib prefix on the DLL (but not the import library
- set_target_properties(glfw PROPERTIES PREFIX "")
-
- # Add a suffix to the import library to avoid naming conflicts
- set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.a")
- else()
- # Add a suffix to the import library to avoid naming conflicts
- set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
- endif()
- elseif (APPLE)
- # Add -fno-common to work around a bug in Apple's GCC
- target_compile_options(glfw PRIVATE "-fno-common")
-
- set_target_properties(glfw PROPERTIES
- INSTALL_NAME_DIR "lib${LIB_SUFFIX}")
- elseif (UNIX)
- # Hide symbols not explicitly tagged for export from the shared library
- target_compile_options(glfw PRIVATE "-fvisibility=hidden")
- endif()
-
- target_compile_definitions(glfw INTERFACE -DGLFW_DLL)
- target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
-else()
- target_link_libraries(glfw INTERFACE ${glfw_LIBRARIES})
-endif()
-
-if (MSVC)
- target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS)
-endif()
-
-if (GLFW_INSTALL)
- install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX})
-endif()
-
diff --git a/external/glfw/glfw_config.h b/external/glfw/glfw_config.h
index 76dc937..2250ff0 100644
--- a/external/glfw/glfw_config.h
+++ b/external/glfw/glfw_config.h
@@ -37,7 +37,7 @@
// Define this to 1 if building GLFW for X11
/* #undef _GLFW_X11 */
// Define this to 1 if building GLFW for Win32
-#define _GLFW_WIN32
+//#define _GLFW_WIN32
// Define this to 1 if building GLFW for Cocoa
/* #undef _GLFW_COCOA */
// Define this to 1 if building GLFW for Wayland
@@ -63,3 +63,16 @@
// Define this to 1 if windows should use full resolution on Retina displays
/* #undef _GLFW_USE_RETINA */
+#if defined ( _WIN32 )
+ #define _GLFW_WIN32
+ #define _GLFW_WGL
+#elif defined ( __APPLE__ )
+ #define _GLFW_COCOA
+ #define _GLFW_NSGL
+#else
+ #define _GLFW_X11
+ #define _GLFW_GLX
+#endif
+
+#define _GLFW_USE_MENUBAR
+#define _GLFW_USE_OPENGL
diff --git a/external/imgui/CMakeLists.txt b/external/imgui/CMakeLists.txt
deleted file mode 100644
index 048d0f6..0000000
--- a/external/imgui/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-set(imgui_HEADERS
- imconfig.h
- imgui.h
- imgui_internal.h
- imgui_impl_glfw_gl3.h
- stb_rect_pack.h
- stb_textedit.h
- stb_truetype.h
-)
-
-set(imgui_SOURCES
- imgui.cpp
- imgui_draw.cpp
- imgui_impl_glfw_gl3.cpp
-)
-
-include_directories(../)
-add_library(imgui STATIC ${imgui_HEADERS} ${imgui_SOURCES})
\ No newline at end of file
diff --git a/external/imgui/imgui_impl_glfw_gl3.cpp b/external/imgui/imgui_impl_glfw_gl3.cpp
index e8ff8d4..d097d65 100644
--- a/external/imgui/imgui_impl_glfw_gl3.cpp
+++ b/external/imgui/imgui_impl_glfw_gl3.cpp
@@ -6,21 +6,23 @@
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
-#include "imgui.h"
+#include
#include "imgui_impl_glfw_gl3.h"
-// GL3W/GLFW
#if defined(__APPLE_CC__)
-#include
+ #include
#else
-#include
+ // GLEW/GL3W/GLAD/...
+ #include
#endif
+
#include
-#ifdef _WIN32
-#undef APIENTRY
-#define GLFW_EXPOSE_NATIVE_WIN32
-#define GLFW_EXPOSE_NATIVE_WGL
-#include
+
+#if defined ( _WIN32 )
+ #undef APIENTRY
+ #define GLFW_EXPOSE_NATIVE_WIN32
+ #define GLFW_EXPOSE_NATIVE_WGL
+ #include
#endif
// Data
@@ -208,7 +210,7 @@ bool ImGui_ImplGlfwGL3_CreateDeviceObjects()
glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array);
const GLchar *vertex_shader =
- "#version 330\n"
+ "#version 130\n"
"uniform mat4 ProjMtx;\n"
"in vec2 Position;\n"
"in vec2 UV;\n"
@@ -223,7 +225,7 @@ bool ImGui_ImplGlfwGL3_CreateDeviceObjects()
"}\n";
const GLchar* fragment_shader =
- "#version 330\n"
+ "#version 130\n"
"uniform sampler2D Texture;\n"
"in vec2 Frag_UV;\n"
"in vec4 Frag_Color;\n"
diff --git a/include/bounce/bounce.h b/include/bounce/bounce.h
index 081c14d..c6bfbcf 100644
--- a/include/bounce/bounce.h
+++ b/include/bounce/bounce.h
@@ -21,40 +21,40 @@
// Include this file header in your project to directly access Bounce objects.
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
-#include
-#include
-#include
+#include
+#include
+#include
-#include
-#include
-#include
+#include
+#include
+#include
#endif
\ No newline at end of file
diff --git a/include/bounce/collision/broad_phase.h b/include/bounce/collision/broad_phase.h
index fec07b8..7dfb836 100644
--- a/include/bounce/collision/broad_phase.h
+++ b/include/bounce/collision/broad_phase.h
@@ -19,7 +19,7 @@
#ifndef B3_BROAD_PHASE_H
#define B3_BROAD_PHASE_H
-#include
+#include
#include
// A pair of broad-phase proxies.
@@ -29,8 +29,8 @@ struct b3Pair
i32 proxy2;
};
-// The broad-phase collision interface.
-// It is used to perform ray, AABB, and overlapping-pair queries
+// The broad-phase interface.
+// It is used to perform ray casts, volume queries, and overlapping queries
// against AABBs.
class b3BroadPhase
{
@@ -38,14 +38,14 @@ public:
b3BroadPhase();
~b3BroadPhase();
- // Create a broad-phase proxy and return a proxy.
+ // Create a proxy and return a index to it.
i32 CreateProxy(const b3AABB3& aabb, void* userData);
- // Destroy an existing proxy.
+ // Destroy a given proxy and remove it from the broadphase.
void DestroyProxy(i32 proxyId);
- // Update an existing proxy with a given AABB and a displacement.
- // displacement = int[a, b](dv/dt) dt = F(b) - F(a) = x(b) - x(a) ~= v * dt
+ // Update an existing proxy AABB with a given AABB and a displacement.
+ // displacement = dt * velocity
// Return true if the proxy has moved.
bool MoveProxy(i32 proxyId, const b3AABB3& aabb, const b3Vec3& displacement);
@@ -65,15 +65,15 @@ public:
// Notify the client callback the AABBs that are overlapping the
// passed ray.
template
- void QueryRay(T* callback, const b3RayCastInput& input) const;
+ void RayCast(T* callback, const b3RayCastInput& input) const;
// Notify the client callback the AABB pairs that are overlapping.
// The client must store the notified pairs.
template
void FindNewPairs(T* callback);
- // Debug b3Draw the AABB proxies.
- void Draw(b3Draw* b3Draw) const;
+ // Draw the proxy AABBs.
+ void Draw(b3Draw* draw) const;
private :
friend class b3DynamicTree;
@@ -81,18 +81,18 @@ private :
// Only moved proxies will be used as an AABB query reference object.
void BufferMove(i32 proxyId);
- // The client callback used to add a overlapping pair
+ // The client callback used to add an overlapping pair
// to the overlapping pair buffer.
bool Report(i32 proxyId);
// The dynamic tree.
b3DynamicTree m_tree;
- // The current proxy being queried for
- // overlap witha another proxies. Is used to avoid a proxy overlap with itself.
+ // The current proxy being queried for overlap with another proxies.
+ // It is used to avoid a proxy overlap with itself.
i32 m_queryProxyId;
- // Keep a buffer of the objects that have moved in a step.
+ // The objects that have moved in a step.
i32* m_moveBuffer;
u32 m_moveBufferCount;
u32 m_moveBufferCapacity;
@@ -120,9 +120,9 @@ inline void b3BroadPhase::QueryAABB(T* callback, const b3AABB3& aabb) const
}
template
-inline void b3BroadPhase::QueryRay(T* callback, const b3RayCastInput& input) const
+inline void b3BroadPhase::RayCast(T* callback, const b3RayCastInput& input) const
{
- return m_tree.QueryRay(callback, input);
+ return m_tree.RayCast(callback, input);
}
inline bool operator<(const b3Pair& pair1, const b3Pair& pair2)
@@ -189,9 +189,9 @@ inline void b3BroadPhase::FindNewPairs(T* callback)
}
}
-inline void b3BroadPhase::Draw(b3Draw* b3Draw) const
+inline void b3BroadPhase::Draw(b3Draw* draw) const
{
- m_tree.Draw(b3Draw);
+ m_tree.Draw(draw);
}
#endif
\ No newline at end of file
diff --git a/include/bounce/collision/distance.h b/include/bounce/collision/distance.h
index 916000e..49f15f3 100644
--- a/include/bounce/collision/distance.h
+++ b/include/bounce/collision/distance.h
@@ -16,27 +16,13 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
-#ifndef B3_COLLISION_H
-#define B3_COLLISION_H
+#ifndef B3_DISTANCE_H
+#define B3_DISTANCE_H
-#include
-#include
-#include
+#include
+#include
-// Input for a ray cast query.
-struct b3RayCastInput
-{
- b3Vec3 p1; // first point on segment
- b3Vec3 p2; // second point on segment
- float32 maxFraction; // maximum intersection
-};
-
-// Output of ray cast query.
-struct b3RayCastOutput
-{
- float32 fraction; // time of intersection
- b3Vec3 normal; // surface normal of intersection
-};
+///////////////////////////////////////////////////////////////////////////////////////////////////
// Find the closest point for a point P to a normalized plane.
b3Vec3 b3ClosestPointOnPlane(const b3Vec3& P, const b3Plane& plane);
@@ -59,9 +45,26 @@ void b3ClosestPointsOnNormalizedLines(b3Vec3* C1, b3Vec3* C2,
const b3Vec3& P1, const b3Vec3& N1,
const b3Vec3& P2, const b3Vec3& N2);
-// Find the closest points of two segments P1-Q1 to a segment P2-Q2.
+// Find the closest points of two segments.
void b3ClosestPointsOnSegments(b3Vec3* C1, b3Vec3* C2,
const b3Vec3& P1, const b3Vec3& Q1,
const b3Vec3& P2, const b3Vec3& Q2);
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Input for a ray cast.
+struct b3RayCastInput
+{
+ b3Vec3 p1; // first point on segment
+ b3Vec3 p2; // second point on segment
+ float32 maxFraction; // maximum intersection
+};
+
+// Output of a ray cast.
+struct b3RayCastOutput
+{
+ float32 fraction; // time of intersection on ray-segment
+ b3Vec3 normal; // surface normal of intersection
+};
+
#endif
\ No newline at end of file
diff --git a/include/bounce/collision/gjk/gjk.h b/include/bounce/collision/gjk/gjk.h
index 75e6a4b..652d331 100644
--- a/include/bounce/collision/gjk/gjk.h
+++ b/include/bounce/collision/gjk/gjk.h
@@ -19,7 +19,7 @@
#ifndef B3_GJK_H
#define B3_GJK_H
-#include
+#include
class b3GJKProxy;
struct b3SimplexCache;
@@ -30,8 +30,8 @@ struct b3SimplexVertex
b3Vec3 pointB; // support vertex on proxy B
b3Vec3 point; // minkowski vertex
float32 weight; // barycentric coordinate for point
- u32 indexA; // support A index
- u32 indexB; // support B index
+ u32 indexA; // support A vertex index
+ u32 indexB; // support B vertex index
};
struct b3Simplex
@@ -58,7 +58,8 @@ struct b3Simplex
// The output of the GJK algorithm.
// It contains the closest points between two proxies
// and their euclidean distance.
-struct b3GJKOutput
+// If the distance is zero then the proxies are overlapping.
+struct b3GJKOutput
{
b3Vec3 pointA; // closest point on proxy A
b3Vec3 pointB; // closest point on proxy B
@@ -67,8 +68,7 @@ struct b3GJKOutput
};
// Find the closest points and distance between two proxies.
-// If the distance is zero then the proxies are overlapping.
b3GJKOutput b3GJK(const b3Transform& xfA, const b3GJKProxy& proxyA,
const b3Transform& xfB, const b3GJKProxy& proxyB);
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/gjk/gjk_cache.h b/include/bounce/collision/gjk/gjk_cache.h
index e58306b..51c8ffd 100644
--- a/include/bounce/collision/gjk/gjk_cache.h
+++ b/include/bounce/collision/gjk/gjk_cache.h
@@ -19,15 +19,16 @@
#ifndef B3_GJK_CACHE_H
#define B3_GJK_CACHE_H
-#include
+#include
-// A simplex used to improve the performance
+// A cached simplex is used to improve the performance
// of the GJK when called more than once.
// Make sure to set cache.count to zero before
-// calling the GJK for the first time.
+// passing this structure as an argument to GJK when called
+// for the first time.
struct b3SimplexCache
{
- float32 metric; // length or area or volume
+ float32 metric; // distance or area or volume
u32 iterations; // number of GJK iterations
u16 count; // number of support vertices
u8 indexA[4]; // support vertices on proxy A
@@ -36,11 +37,13 @@ struct b3SimplexCache
// Find the closest points and distance between two proxies.
// Assumes a simplex is given for increasing the performance of
-// the GJK when called more than once.
+// the algorithm when called more than once.
b3GJKOutput b3GJK(const b3Transform& xfA, const b3GJKProxy& proxyA,
const b3Transform& xfB, const b3GJKProxy& proxyB,
bool applyRadius, b3SimplexCache* cache);
+// A feature pair contains the vertices of the features associated
+// with the closest points.
struct b3GJKFeaturePair
{
enum Type
@@ -57,10 +60,10 @@ struct b3GJKFeaturePair
u32 indexB[3]; // vertices on proxy B
};
-// Get the vertices of the features that the closest points between two
+// Identify the vertices of the features that the closest points between two
// GJK proxies are contained on given a cached simplex.
// The GJK must have been called using the pair of proxies and
// cache.count must be < 4, that is, the proxies must not be overlapping.
b3GJKFeaturePair b3GetFeaturePair(const b3SimplexCache& cache);
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/gjk/gjk_proxy.h b/include/bounce/collision/gjk/gjk_proxy.h
index b29ace4..a9189e1 100644
--- a/include/bounce/collision/gjk/gjk_proxy.h
+++ b/include/bounce/collision/gjk/gjk_proxy.h
@@ -19,31 +19,31 @@
#ifndef B3_GJK_PROXY_H
#define B3_GJK_PROXY_H
-#include
+#include
// A GJK proxy encapsulates any convex hull to be used by the GJK.
class b3GJKProxy
{
public:
- b3GJKProxy() : m_vertices(nullptr), m_count(0), m_radius(0.0f) { }
+ b3GJKProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) { }
- // Get the number of vertices of this proxy.
+ // Get the number of vertices in this proxy.
u32 GetVertexCount() const;
// Read an indexed vertex from this proxy.
const b3Vec3& GetVertex(u32 index) const;
// Get the support vertex index in a given direction.
- u32 GetSupportIndex(const b3Vec3& d) const;
+ u32 GetSupportIndex(const b3Vec3& direction) const;
// Convenience function.
// Get the support vertex in a given direction.
- const b3Vec3& GetSupportVertex(const b3Vec3& d) const;
+ const b3Vec3& GetSupportVertex(const b3Vec3& direction) const;
- b3Vec3 m_buffer[3]; // for childs
- const b3Vec3* m_vertices;
- u32 m_count;
- float32 m_radius;
+ const b3Vec3* m_vertices; // vertices in this proxy
+ u32 m_count; // number of vertices
+ float32 m_radius; // shape radius
+ b3Vec3 m_buffer[3]; // vertices from a child shape
};
inline u32 b3GJKProxy::GetVertexCount() const
@@ -79,4 +79,4 @@ inline const b3Vec3& b3GJKProxy::GetSupportVertex(const b3Vec3& d) const
return m_vertices[index];
}
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/sat/sat.h b/include/bounce/collision/sat/sat.h
index 5992864..afb2431 100644
--- a/include/bounce/collision/sat/sat.h
+++ b/include/bounce/collision/sat/sat.h
@@ -19,7 +19,7 @@
#ifndef B3_SAT_H
#define B3_SAT_H
-#include
+#include
struct b3Hull;
diff --git a/include/bounce/collision/sat/sat_edge_and_hull.h b/include/bounce/collision/sat/sat_edge_and_hull.h
index cacc941..1b796c5 100644
--- a/include/bounce/collision/sat/sat_edge_and_hull.h
+++ b/include/bounce/collision/sat/sat_edge_and_hull.h
@@ -16,10 +16,10 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
-#ifndef B3_EDGE_SAT_H
-#define B3_EDGE_SAT_H
+#ifndef B3_EDGE_HULL_SAT_H
+#define B3_EDGE_HULL_SAT_H
-#include
+#include
struct b3Capsule;
@@ -37,4 +37,4 @@ float32 b3ProjectEdge(const b3Vec3& P1, const b3Vec3& E1, const b3Vec3& P2, cons
b3EdgeQuery b3QueryEdgeSeparation(const b3Transform& xfA, const b3Capsule* hullA,
const b3Transform& xfB, const b3Hull* hullB);
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/sat/sat_vertex_and_hull.h b/include/bounce/collision/sat/sat_vertex_and_hull.h
index 0a5fea4..24c8de6 100644
--- a/include/bounce/collision/sat/sat_vertex_and_hull.h
+++ b/include/bounce/collision/sat/sat_vertex_and_hull.h
@@ -16,10 +16,10 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
-#ifndef B3_VERTEX_SAT_H
-#define B3_VERTEX_SAT_H
+#ifndef B3_VERTEX_HULL_SAT_H
+#define B3_VERTEX_HULL_SAT_H
-#include
+#include
struct b3Sphere;
diff --git a/include/bounce/collision/shapes/aabb3.h b/include/bounce/collision/shapes/aabb3.h
index 137e1be..5206ef5 100644
--- a/include/bounce/collision/shapes/aabb3.h
+++ b/include/bounce/collision/shapes/aabb3.h
@@ -19,11 +19,15 @@
#ifndef B3_AABB_3_H
#define B3_AABB_3_H
-#include
+#include
// A min-max representation of a three-dimensional AABB.
struct b3AABB3
{
+ b3Vec3 m_lower; // lower vertex
+ b3Vec3 m_upper; // upper vertex
+
+ // Get the support vertex in a given direction.
b3Vec3 GetSupportVertex(const b3Vec3& direction) const
{
b3Vec3 support;
@@ -128,7 +132,7 @@ struct b3AABB3
}
// Test if this AABB contains a point.
- bool TestPoint(const b3Vec3& point) const
+ bool Contains(const b3Vec3& point) const
{
return m_lower.x <= point.x && point.x <= m_upper.x &&
m_lower.y <= point.y && point.y <= m_upper.y &&
@@ -138,11 +142,11 @@ struct b3AABB3
// Test if this AABB contains another AABB.
bool Contains(const b3AABB3& aabb) const
{
- return TestPoint(aabb.m_lower) && TestPoint(aabb.m_upper);
+ return Contains(aabb.m_lower) && Contains(aabb.m_upper);
}
- // Test if a ray intersect this AABB.
- // Output the minimum fraction to derive the intersection point.
+ // Test if a ray intersects this AABB.
+ // Output the minimum and maximum intersection fractions to derive the minimum and maximum intersection points.
bool TestRay(const b3Vec3& p1, const b3Vec3& p2, float32 maxFraction, float32& minFraction) const
{
// Solve segment to slab plane.
@@ -159,9 +163,10 @@ struct b3AABB3
for (u32 i = 0; i < 3; ++i)
{
float32 numerators[2], denominators[2];
- //numerators[0] = (-m_lower[i]) - (-p1[i]);
+
numerators[0] = p1[i] - m_lower[i];
numerators[1] = m_upper[i] - p1[i];
+
denominators[0] = -d[i];
denominators[1] = d[i];
@@ -215,9 +220,6 @@ struct b3AABB3
minFraction = lower;
return true;
}
-
- b3Vec3 m_lower; // lower vertex
- b3Vec3 m_upper; // upper vertex
};
// Compute an AABB that encloses two AABBs.
@@ -236,4 +238,4 @@ inline bool b3TestOverlap(const b3AABB3& a, const b3AABB3& b)
(a.m_upper.x >= b.m_lower.x) && (a.m_upper.y >= b.m_lower.y) && (a.m_upper.z >= b.m_lower.z);
}
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/shapes/box_hull.h b/include/bounce/collision/shapes/box_hull.h
index f83b1f5..690c10c 100644
--- a/include/bounce/collision/shapes/box_hull.h
+++ b/include/bounce/collision/shapes/box_hull.h
@@ -19,7 +19,7 @@
#ifndef B3_BOX_HULL_H
#define B3_BOX_HULL_H
-#include
+#include
struct b3BoxHull : public b3Hull
{
@@ -28,9 +28,10 @@ struct b3BoxHull : public b3Hull
b3Face boxFaces[6];
b3Plane boxPlanes[6];
+ // Does nothing for performance.
b3BoxHull() { }
- // Set this box to the unit box.
+ // Set this box to the unit box centered at the origin.
void SetIdentity()
{
boxVertices[0] = b3Vec3(1.0f, 1.0f, -1.0f);
@@ -90,9 +91,18 @@ struct b3BoxHull : public b3Hull
planes = boxPlanes;
faceCount = 6;
}
+
+ // Set this box from three extents and centered at the origin.
+ void Set(float32 ex, float32 ey, float32 ez)
+ {
+ b3Transform xf;
+ xf.position.SetZero();
+ xf.rotation = b3Diagonal(ex, ey, ez);
+ SetTransform(xf);
+ }
- // Set this box to the unit box and transform
- // it. The transform must not contain non-uniform
+ // Set this box to the unit box and transform it.
+ // Warning: The transform must not contain non-uniform
// scaling!
void SetTransform(const b3Transform& T)
{
@@ -162,4 +172,4 @@ struct b3BoxHull : public b3Hull
}
};
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/shapes/capsule.h b/include/bounce/collision/shapes/capsule.h
index 49ca261..7ad03b1 100644
--- a/include/bounce/collision/shapes/capsule.h
+++ b/include/bounce/collision/shapes/capsule.h
@@ -19,7 +19,7 @@
#ifndef B3_CAPSULE_H
#define B3_CAPSULE_H
-#include
+#include
struct b3Capsule
{
@@ -27,7 +27,6 @@ struct b3Capsule
float32 radius;
const b3Vec3& GetVertex(u32 index) const;
-
u32 GetSupportVertex(const b3Vec3& direction) const;
};
@@ -36,13 +35,13 @@ inline const b3Vec3& b3Capsule::GetVertex(u32 index) const
return vertices[index];
}
-inline u32 b3Capsule::GetSupportVertex(const b3Vec3& direction) const
+inline u32 b3Capsule::GetSupportVertex(const b3Vec3& d) const
{
- if (b3Dot(direction, vertices[0]) > b3Dot(direction, vertices[1]))
+ if (b3Dot(d, vertices[0]) > b3Dot(d, vertices[1]))
{
return 0;
}
return 1;
}
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/shapes/hull.h b/include/bounce/collision/shapes/hull.h
index 909673a..c3a43e9 100644
--- a/include/bounce/collision/shapes/hull.h
+++ b/include/bounce/collision/shapes/hull.h
@@ -19,7 +19,7 @@
#ifndef B3_HULL_H
#define B3_HULL_H
-#include
+#include
struct b3Face
{
@@ -52,14 +52,14 @@ struct b3Hull
u32 GetSupportVertex(const b3Vec3& direction) const;
u32 GetSupportFace(const b3Vec3& direction) const;
-
b3Plane GetEdgeSidePlane(u32 index) const;
+
u32 GetSize() const;
void Validate() const;
void Validate(const b3Face* face) const;
void Validate(const b3HalfEdge* edge) const;
};
-#include
+#include
#endif
\ No newline at end of file
diff --git a/include/bounce/collision/shapes/mesh.h b/include/bounce/collision/shapes/mesh.h
index 3298a33..dfdefc6 100644
--- a/include/bounce/collision/shapes/mesh.h
+++ b/include/bounce/collision/shapes/mesh.h
@@ -19,8 +19,8 @@
#ifndef B3_MESH_H
#define B3_MESH_H
-#include
-#include
+#include
+#include
struct b3Mesh
{
diff --git a/include/bounce/collision/shapes/sphere.h b/include/bounce/collision/shapes/sphere.h
index 5746b01..49198d5 100644
--- a/include/bounce/collision/shapes/sphere.h
+++ b/include/bounce/collision/shapes/sphere.h
@@ -19,7 +19,7 @@
#ifndef B3_SPHERE_H
#define B3_SPHERE_H
-#include
+#include
struct b3Sphere
{
@@ -27,7 +27,6 @@ struct b3Sphere
float32 radius;
const b3Vec3& GetVertex(u32 index) const;
-
u32 GetSupportVertex(const b3Vec3& direction) const;
};
diff --git a/include/bounce/collision/shapes/triangle_hull.h b/include/bounce/collision/shapes/triangle_hull.h
index c3f2417..1ed5964 100644
--- a/include/bounce/collision/shapes/triangle_hull.h
+++ b/include/bounce/collision/shapes/triangle_hull.h
@@ -19,7 +19,7 @@
#ifndef B3_TRIANGLE_HULL_H
#define B3_TRIANGLE_HULL_H
-#include
+#include
struct b3TriangleHull : public b3Hull
{
@@ -37,9 +37,7 @@ struct b3TriangleHull : public b3Hull
void Set(const b3Vec3& A, const b3Vec3& B, const b3Vec3& C)
{
- const float32 kInv3 = 1.0f / 3.0f;
-
- centroid = kInv3 * (A + B + C);
+ centroid = (A + B + C) / 3.0f;
triangleVertices[0] = A;
triangleVertices[1] = B;
@@ -73,4 +71,4 @@ struct b3TriangleHull : public b3Hull
}
};
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/trees/dynamic_tree.h b/include/bounce/collision/trees/dynamic_tree.h
index 6d953dc..ad3b01f 100644
--- a/include/bounce/collision/trees/dynamic_tree.h
+++ b/include/bounce/collision/trees/dynamic_tree.h
@@ -19,21 +19,21 @@
#ifndef B3_DYNAMIC_TREE_H
#define B3_DYNAMIC_TREE_H
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
#define NULL_NODE (-1)
-// An AABB tree for dynamic AABBs.
+// AABB tree for dynamic AABBs.
class b3DynamicTree
{
public :
b3DynamicTree();
~b3DynamicTree();
- // Insert a node to the tree and return its ID.
+ // Insert a node into the tree and return its ID.
i32 InsertNode(const b3AABB3& aabb, void* userData);
// Remove a node from the tree.
@@ -48,7 +48,7 @@ public :
// Get the data associated with a given proxy.
void* GetUserData(i32 proxyId) const;
- // Check if two aabbs of this tree are overlapping.
+ // Check if two aabbs in this tree are overlapping.
bool TestOverlap(i32 proxy1, i32 proxy2) const;
// Keep reporting the client callback the AABBs that are overlapping with
@@ -61,22 +61,24 @@ public :
// the given ray. The client callback must return the new intersection fraction.
// If the fraction == 0 then the query is cancelled immediately.
template
- void QueryRay(T* callback, const b3RayCastInput& input) const;
+ void RayCast(T* callback, const b3RayCastInput& input) const;
// Validate a given node of this tree.
void Validate(i32 node) const;
// Draw this tree.
- void Draw(b3Draw* b3Draw) const;
+ void Draw(b3Draw* draw) const;
private :
struct b3Node
{
+ // Is this node a leaf?
bool IsLeaf() const
{
- return child1 == NULL_NODE; //or child 2 == NULL_NODE, or height == 0.
+ //A node is a leaf if child 2 == NULL_NODE or height == 0.
+ return child1 == NULL_NODE;
}
- // The (enlarged) AABB of this node.
+ // The fattened node AABB.
b3AABB3 aabb;
// The associated user data.
@@ -91,31 +93,30 @@ private :
i32 child1;
i32 child2;
- // leaf = 0, free node = -1
+ // leaf if 0, free node if -1
i32 height;
};
- // Insert a allocated (leaf) node into the tree.
+ // Insert a node into the tree.
void InsertLeaf(i32 node);
- // Remove a allocated node from the tree.
+ // Remove a node from the tree.
void RemoveLeaf(i32 node);
- // Rebuild the tree hierarchy starting from the given node.
+ // Rebuild the hierarchy starting from the given node.
void WalkBackNodeAndCombineVolumes(i32 node);
- // Perform a basic surface area heuristic search to find the best
- // node that can be merged with a given AABB.
- i32 HeuristicSearch(const b3AABB3& leafAABB) const;
+ // Find the best node that can be merged with a given AABB.
+ i32 FindBest(const b3AABB3& aabb) const;
// Peel a node from the free list and insert into the node array.
// Allocate a new node if necessary. The function returns the new node index.
i32 AllocateNode();
- // Free a node (not destroy) from the node pool and add it to the free list.
+ // Free a node from the node pool and add it to the free list.
void FreeNode(i32 node);
- // Make a node available for the next allocation request.
+ // Make a node available for the next allocation.
void AddToFreeList(i32 node);
// The root of this tree.
@@ -128,25 +129,25 @@ private :
i32 m_freeList;
};
-inline bool b3DynamicTree::TestOverlap(i32 proxy1, i32 proxy2) const
-{
- B3_ASSERT(proxy1 < m_nodeCount);
- B3_ASSERT(proxy2 < m_nodeCount);
- return b3TestOverlap(m_nodes[proxy1].aabb, m_nodes[proxy2].aabb);
-}
-
-inline const b3AABB3& b3DynamicTree::GetAABB(i32 proxyId) const
+inline const b3AABB3& b3DynamicTree::GetAABB(i32 proxyId) const
{
B3_ASSERT(proxyId < m_nodeCount);
return m_nodes[proxyId].aabb;
}
-inline void* b3DynamicTree::GetUserData(i32 proxyId) const
+inline void* b3DynamicTree::GetUserData(i32 proxyId) const
{
B3_ASSERT(proxyId < m_nodeCount);
return m_nodes[proxyId].userData;
}
+inline bool b3DynamicTree::TestOverlap(i32 proxy1, i32 proxy2) const
+{
+ B3_ASSERT(proxy1 < m_nodeCount);
+ B3_ASSERT(proxy2 < m_nodeCount);
+ return b3TestOverlap(m_nodes[proxy1].aabb, m_nodes[proxy2].aabb);
+}
+
template
inline void b3DynamicTree::QueryAABB(T* callback, const b3AABB3& aabb) const
{
@@ -184,14 +185,14 @@ inline void b3DynamicTree::QueryAABB(T* callback, const b3AABB3& aabb) const
}
template
-inline void b3DynamicTree::QueryRay(T* callback, const b3RayCastInput& input) const
+inline void b3DynamicTree::RayCast(T* callback, const b3RayCastInput& input) const
{
b3Vec3 p1 = input.p1;
b3Vec3 p2 = input.p2;
b3Vec3 d = p2 - p1;
float32 maxFraction = input.maxFraction;
- // Ensure non-degeneracy.
+ // Ensure non-degenerate segment.
B3_ASSERT(b3Dot(d, d) > B3_EPSILON * B3_EPSILON);
b3Stack stack;
@@ -237,4 +238,4 @@ inline void b3DynamicTree::QueryRay(T* callback, const b3RayCastInput& input) co
}
}
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/collision/trees/static_tree.h b/include/bounce/collision/trees/static_tree.h
index 3acc8cb..d09c293 100644
--- a/include/bounce/collision/trees/static_tree.h
+++ b/include/bounce/collision/trees/static_tree.h
@@ -19,28 +19,28 @@
#ifndef B3_STATIC_TREE_H
#define B3_STATIC_TREE_H
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
#define NULL_NODE_S (0xFFFFFFFF)
-// An AABB tree for static AABBs.
+// AABB tree for static AABBs.
class b3StaticTree
{
public:
b3StaticTree();
~b3StaticTree();
- // Build the tree.
- // Output a sorted index array.
+ // Build this tree from a list of AABBs and the list
+ // of indices to the AABBs.
void Build(u32* indices, const b3AABB3* aabbs, u32 count);
// Get the AABB of a given proxy.
const b3AABB3& GetAABB(u32 proxyId) const;
- // Get the index associated of a given proxy.
+ // Get the user data associated with a given proxy.
u32 GetUserData(u32 proxyId) const;
// Report the client callback all AABBs that are overlapping with
@@ -53,10 +53,10 @@ public:
// the given ray. The client callback must return the new intersection fraction
// (real). If the fraction == 0 then the query is cancelled immediatly.
template
- void QueryRay(T* callback, const b3RayCastInput& input) const;
+ void RayCast(T* callback, const b3RayCastInput& input) const;
- // Draw the hierarchy.
- void Draw(b3Draw* b3Draw) const;
+ // Draw this tree.
+ void Draw(b3Draw* draw) const;
private :
// A node in a static tree.
struct b3Node
@@ -69,13 +69,14 @@ private :
u32 index;
};
- // Check if a node is a leaf node
+ // Is this node a leaf?
bool IsLeaf() const
{
return child1 == NULL_NODE_S;
}
};
+ // The nodes of this tree stored in an array.
u32 m_nodeCount;
b3Node* m_nodes;
};
@@ -109,7 +110,12 @@ inline void b3StaticTree::QueryAABB(T* callback, const b3AABB3& aabb) const
while (stack.IsEmpty() == false)
{
u32 nodeIndex = stack.Top();
-
+
+ if (nodeIndex == NULL_NODE_S)
+ {
+ continue;
+ }
+
stack.Pop();
const b3Node* node = m_nodes + nodeIndex;
@@ -133,7 +139,7 @@ inline void b3StaticTree::QueryAABB(T* callback, const b3AABB3& aabb) const
}
template
-inline void b3StaticTree::QueryRay(T* callback, const b3RayCastInput& input) const
+inline void b3StaticTree::RayCast(T* callback, const b3RayCastInput& input) const
{
if (m_nodeCount == 0)
{
@@ -145,7 +151,7 @@ inline void b3StaticTree::QueryRay(T* callback, const b3RayCastInput& input) con
b3Vec3 d = p2 - p1;
float32 maxFraction = input.maxFraction;
- // Ensure non-degeneracy.
+ // Ensure non-degenerate segment.
B3_ASSERT(b3Dot(d, d) > B3_EPSILON * B3_EPSILON);
u32 root = 0;
diff --git a/include/bounce/common/draw.h b/include/bounce/common/draw.h
index 1703ccf..fb35cfd 100644
--- a/include/bounce/common/draw.h
+++ b/include/bounce/common/draw.h
@@ -19,10 +19,10 @@
#ifndef B3_DRAW_H
#define B3_DRAW_H
-#include
-#include
+#include
+#include
-// Color channels used by the debug b3Draw interface.
+// Color channels used by the debug draw interface.
struct b3Color
{
b3Color() { }
@@ -32,11 +32,11 @@ struct b3Color
float32 r, g, b, a;
};
-// Implement this interface and set to a world so it can b3Draw the physics entities.
+// Implement this interface and set to a world so it can draw the physics entities.
class b3Draw
{
public :
- // Bit flags to tell the world what needs to be b3Draw.
+ // Bit flags to tell the world what needs to be draw.
enum b3Flags
{
e_shapesFlag = 0x0001,
@@ -88,10 +88,10 @@ public :
// Draw a AABB.
virtual void DrawAABB(const b3AABB3& aabb, const b3Color& color) = 0;
- // Draw a b3Transform.
+ // Draw a transform.
virtual void DrawTransform(const b3Transform& xf) = 0;
- // Debug b3Draw flags.
+ // Debug draw flags.
u32 m_flags;
};
diff --git a/include/bounce/common/geometry.h b/include/bounce/common/geometry.h
index e2c4b4c..8fbc1d6 100644
--- a/include/bounce/common/geometry.h
+++ b/include/bounce/common/geometry.h
@@ -19,8 +19,8 @@
#ifndef B3_GEOMETRY_H
#define B3_GEOMETRY_H
-#include
-#include
+#include
+#include
// A triangle in indexed form.
struct b3Triangle
@@ -106,13 +106,13 @@ inline b3Plane b3Mul(const b3Transform& T, const b3Plane& plane)
return b3Plane(normal, plane.offset + b3Dot(normal, T.position));
}
+// Compute the distance between a point and a plane.
inline float32 b3Distance(const b3Vec3& P, const b3Plane& plane)
{
return b3Dot(plane.normal, P) - plane.offset;
}
-// Project a point onto a plane.
-// The plane must be normalized.
+// Project a point onto a normal plane.
inline b3Vec3 b3Project(const b3Vec3& P, const b3Plane& plane)
{
float32 fraction = b3Distance(P, plane);
diff --git a/include/bounce/common/math/mat.h b/include/bounce/common/math/mat.h
index 15658f7..e30a0c9 100644
--- a/include/bounce/common/math/mat.h
+++ b/include/bounce/common/math/mat.h
@@ -19,7 +19,7 @@
#ifndef B3_MAT_H
#define B3_MAT_H
-#include
+#include
// A vector stored in column-major order.
template
@@ -79,7 +79,10 @@ struct b3Mat
};
// Solve Ax = b.
-// Warning: Make sure to pass a copy of A to the function. It will be invalidated.
+// It doesn't compute the inverse.
+// Therefore, is more efficient.
+// Returns false if the matrix is singular.
+// Warning: Make sure to pass a copy of the original matrix to the function. A will be invalidated.
bool b3Solve(float32* b, float32* A, u32 n);
-#endif
+#endif
\ No newline at end of file
diff --git a/include/bounce/common/math/mat22.h b/include/bounce/common/math/mat22.h
index 9266d50..d4ca2f2 100644
--- a/include/bounce/common/math/mat22.h
+++ b/include/bounce/common/math/mat22.h
@@ -19,7 +19,7 @@
#ifndef B3_MAT_22_H
#define B3_MAT_22_H
-#include
+#include
// A 2-by-2 matrix stored in column-major order.
struct b3Mat22
@@ -27,7 +27,7 @@ struct b3Mat22
// Does nothing for performance.
b3Mat22() { }
- // Set this matrix from two vector elements.
+ // Set this matrix from two vectors.
b3Mat22(const b3Vec2& _x, const b3Vec2& _y) : x(_x), y(_y) { }
// Solve Ax = b.
diff --git a/include/bounce/common/math/mat33.h b/include/bounce/common/math/mat33.h
index 13a3511..ae681f7 100644
--- a/include/bounce/common/math/mat33.h
+++ b/include/bounce/common/math/mat33.h
@@ -19,7 +19,7 @@
#ifndef B3_MAT_33_H
#define B3_MAT_33_H
-#include
+#include
// A 3-by-3 matrix stored in column-major order.
struct b3Mat33
@@ -27,7 +27,7 @@ struct b3Mat33
// Does nothing for performance.
b3Mat33() { }
- // Set this matrix from three elements.
+ // Set this matrix from three column vectors.
b3Mat33(const b3Vec3& _x, const b3Vec3& _y, const b3Vec3& _z) : x(_x), y(_y), z(_z) { }
// Read an indexed column vector from this matrix.
@@ -42,6 +42,12 @@ struct b3Mat33
return (&x)[i];
}
+ // Read an indexed element from this matrix.
+ float32 operator()(u32 i, u32 j) const
+ {
+ return (&x.x)[i + 3 * j];
+ }
+
// Add a matrix to this matrix.
void operator+=(const b3Mat33& B)
{
@@ -72,11 +78,6 @@ struct b3Mat33
// Returns the zero vector if the matrix is singular.
b3Vec3 Solve(const b3Vec3& b) const;
- float32 operator()(u32 i, u32 j) const
- {
- return (&x.x)[i + 3 * j];
- }
-
b3Vec3 x, y, z;
};
@@ -134,7 +135,7 @@ inline b3Mat33 b3Mul(const b3Mat33& A, const b3Mat33& B)
// Multiply the transpose of a matrix times a vector. If
// the matrix represents a rotation frame this transforms the
-// vector from one frame to another (inverse b3Transform).
+// vector from one frame to another (inverse transform).
inline b3Vec3 b3MulT(const b3Mat33& A, const b3Vec3& v)
{
return b3Vec3(b3Dot(A.x, v), b3Dot(A.y, v), b3Dot(A.z, v));
diff --git a/include/bounce/common/math/math.h b/include/bounce/common/math/math.h
index 85e522f..17522cb 100644
--- a/include/bounce/common/math/math.h
+++ b/include/bounce/common/math/math.h
@@ -20,7 +20,7 @@
#define B3_MATH_H
#include
-#include
+#include
inline bool b3IsValid(float32 fx)
{
@@ -30,13 +30,13 @@ inline bool b3IsValid(float32 fx)
inline float32 b3Sqrt(float32 x)
{
- return sqrtf(x);
+ return std::sqrt(x);
}
template
inline T b3Abs(T x)
{
- return abs(x);
+ return std::abs(x);
}
template
diff --git a/include/bounce/common/math/quat.h b/include/bounce/common/math/quat.h
index 4b02508..fa88783 100644
--- a/include/bounce/common/math/quat.h
+++ b/include/bounce/common/math/quat.h
@@ -19,10 +19,10 @@
#ifndef B3_QUAT_H
#define B3_QUAT_H
-#include
-#include
+#include
+#include
-// A quaternion represents an orientation with 4 real numbers.
+// A quaternion can represent an orientation with 4 scalars.
struct b3Quat
{
// Default constructor does nothing for performance.
@@ -157,13 +157,13 @@ inline b3Quat b3Normalize(const b3Quat& q)
return b3Quat(0.0f, 0.0f, 0.0f, 1.0f);
}
-// Compute the dot poduct of two quaternions.
+// Perform the dot poduct of two quaternions.
inline float b3Dot(const b3Quat& a, const b3Quat& b)
{
return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
}
-// Compute the conjugate of a quaternion.
+// Conjugate of a quaternion.
inline b3Quat b3Conjugate(const b3Quat& q)
{
return b3Quat(-q.x, -q.y, -q.z, q.w);
@@ -230,7 +230,6 @@ inline b3Quat b3Slerp(const b3Quat& a, const b3Quat& b, float32 fraction)
b3Quat q1 = sin(w1 * angle) * a;
b3Quat q2 = sin(w2 * angle) * b2;
float32 invSin = 1.0f / sine;
-
return invSin * (q1 + q2);
}
diff --git a/include/bounce/common/math/transform.h b/include/bounce/common/math/transform.h
index cdfdc76..b4baf2f 100644
--- a/include/bounce/common/math/transform.h
+++ b/include/bounce/common/math/transform.h
@@ -19,10 +19,10 @@
#ifndef B3_TRANSFORM_H
#define B3_TRANSFORM_H
-#include
-#include
+#include
+#include
-// A b3Transform represents a rigid frame.
+// A transform represents a rigid frame.
// It has a translation representing a position
// and a rotation representing an orientation.
struct b3Transform
@@ -30,7 +30,7 @@ struct b3Transform
// Default ctor does nothing for performance.
b3Transform() { }
- // Set this b3Transform from a translation vector and an orientation
+ // Set this transform from a translation vector and an orientation
// quaternion.
b3Transform(const b3Vec3& p, const b3Quat& q)
{
@@ -38,7 +38,7 @@ struct b3Transform
rotation = b3ConvertQuatToRot(q);
}
- // Set this b3Transform to the identity.
+ // Set this transform to the identity.
void SetIdentity()
{
position.SetZero();
@@ -61,7 +61,7 @@ struct b3Sweep
b3Vec3 worldCenter; // world center
b3Quat orientation; // world orientation
- // Get this sweep b3Transform at a given time between [0, 1]
+ // Get this sweep transform at a given time between [0, 1]
b3Transform GetTransform(float32 t) const;
// Advance to a new initial state.
@@ -90,7 +90,7 @@ inline void b3Sweep::Advance(float32 t)
t0 = t;
}
-// Multiply a b3Transform times a vector. If the b3Transform
+// Multiply a transform times a vector. If the transform
// represents a frame this returns the vector in terms
// of the frame.
inline b3Vec3 operator*(const b3Transform& T, const b3Vec3& v)
@@ -98,7 +98,7 @@ inline b3Vec3 operator*(const b3Transform& T, const b3Vec3& v)
return b3Mul(T.rotation, v) + T.position;
}
-// Multiply a b3Transform times another b3Transform (composed b3Transform).
+// Multiply a transform times another transform (composed transform).
// [A y][B x] = [AB Ax+y]
// [0 1][0 1] [0 1 ]
inline b3Transform operator*(const b3Transform& A, const b3Transform& B)
@@ -109,13 +109,13 @@ inline b3Transform operator*(const b3Transform& A, const b3Transform& B)
return C;
}
-// Multiply a b3Transform times a vector.
+// Multiply a transform times a vector.
inline b3Vec3 b3Mul(const b3Transform& T, const b3Vec3& v)
{
return b3Mul(T.rotation, v) + T.position;
}
-// Multiply a b3Transform times another b3Transform.
+// Multiply a transform times another transform.
// [A y][B x] = [AB Ax+y]
// [0 1][0 1] [0 1 ]
inline b3Transform b3Mul(const b3Transform& A, const b3Transform& B)
@@ -126,8 +126,8 @@ inline b3Transform b3Mul(const b3Transform& A, const b3Transform& B)
return C;
}
-// Multiply the transpose of one b3Transform (inverse
-// b3Transform) times another b3Transform (composed b3Transform).
+// Multiply the transpose of one transform (inverse
+// transform) times another transform (composed transform).
//[A^-1 -A^-1*y][B x] = [A^-1*B A^-1(x-y)]
//[0 1 ][0 1] [0 1 ]
inline b3Transform b3MulT(const b3Transform& A, const b3Transform& B)
@@ -138,9 +138,9 @@ inline b3Transform b3MulT(const b3Transform& A, const b3Transform& B)
return C;
}
-// Multiply the transpose of a b3Transform times a vector.
-// If the b3Transform represents a frame then this transforms
-// the vector from one frame to another (inverse b3Transform).
+// Multiply the transpose of a transform times a vector.
+// If the transform represents a frame then this transforms
+// the vector from one frame to another (inverse transform).
//[A^-1 -A^-1*y][x] = A^-1*x - A^-1*y = A^-1 * (x - y)
//[0 1 ][1]
inline b3Vec3 b3MulT(const b3Transform& A, const b3Vec3& v)
@@ -148,7 +148,7 @@ inline b3Vec3 b3MulT(const b3Transform& A, const b3Vec3& v)
return b3MulT(A.rotation, v - A.position);
}
-// Inverse b3Transform.
+// Inverse transform.
inline b3Transform b3Inverse(const b3Transform& T)
{
b3Transform B;
diff --git a/include/bounce/common/math/vec2.h b/include/bounce/common/math/vec2.h
index f2fe4a3..cf7dcd6 100644
--- a/include/bounce/common/math/vec2.h
+++ b/include/bounce/common/math/vec2.h
@@ -19,7 +19,7 @@
#ifndef B3_VEC2_H
#define B3_VEC2_H
-#include
+#include
// A 2D column vector.
struct b3Vec2
diff --git a/include/bounce/common/math/vec3.h b/include/bounce/common/math/vec3.h
index 54b9664..20c53f8 100644
--- a/include/bounce/common/math/vec3.h
+++ b/include/bounce/common/math/vec3.h
@@ -19,7 +19,7 @@
#ifndef B3_VEC_3_H
#define B3_VEC_3_H
-#include
+#include
// A 3D column vector.
struct b3Vec3
diff --git a/include/bounce/common/memory/block_pool.h b/include/bounce/common/memory/block_pool.h
index 22b3bde..583b6b6 100644
--- a/include/bounce/common/memory/block_pool.h
+++ b/include/bounce/common/memory/block_pool.h
@@ -19,7 +19,7 @@
#ifndef B3_BLOCK_POOL_H
#define B3_BLOCK_POOL_H
-#include
+#include
// Number of blocks per chunk.
const u32 b3_blockCount = 32;
diff --git a/include/bounce/common/memory/stack_allocator.h b/include/bounce/common/memory/stack_allocator.h
index a1b3c45..2ac323f 100644
--- a/include/bounce/common/memory/stack_allocator.h
+++ b/include/bounce/common/memory/stack_allocator.h
@@ -19,13 +19,13 @@
#ifndef B3_STACK_ALLOCATOR_H
#define B3_STACK_ALLOCATOR_H
-#include
+#include
// Allocate 10 MiB from the stack.
// Increase as you want.
const u32 b3_maxStackSize = B3_MiB(10);
-// An stack allocator.
+// A stack allocator.
class b3StackAllocator
{
public :
diff --git a/include/bounce/common/settings.h b/include/bounce/common/settings.h
index cd7be98..eb2bc57 100644
--- a/include/bounce/common/settings.h
+++ b/include/bounce/common/settings.h
@@ -60,7 +60,7 @@ typedef float float32;
#define B3_AABB_MULTIPLIER (2.0f)
// Collision and constraint tolerance.
-#define B3_LINEAR_SLOP (0.005f)
+#define B3_LINEAR_SLOP (0.01f)
// Collision and constraint tolerance.
#define B3_ANGULAR_SLOP (2.0f / 180.0f * B3_PI)
diff --git a/include/bounce/common/template/array.h b/include/bounce/common/template/array.h
index 42e4500..da21e5d 100644
--- a/include/bounce/common/template/array.h
+++ b/include/bounce/common/template/array.h
@@ -19,7 +19,7 @@
#ifndef B3_ARRAY_POD_H
#define B3_ARRAY_POD_H
-#include
+#include
// An array for bytes (POD).
template
diff --git a/include/bounce/common/template/list.h b/include/bounce/common/template/list.h
index 3a1d336..396ee7c 100644
--- a/include/bounce/common/template/list.h
+++ b/include/bounce/common/template/list.h
@@ -19,7 +19,7 @@
#ifndef B3_LIST_H
#define B3_LIST_H
-#include
+#include
// A singly-linked list.
template
@@ -28,7 +28,7 @@ class b3List1
public:
b3List1()
{
- m_head = nullptr;
+ m_head = NULL;
m_count = 0;
}
@@ -58,7 +58,7 @@ class b3List2
public:
b3List2()
{
- m_head = nullptr;
+ m_head = NULL;
m_count = 0;
}
@@ -66,7 +66,7 @@ public:
void PushFront(T* link)
{
- link->m_prev = nullptr;
+ link->m_prev = NULL;
link->m_next = m_head;
if (m_head)
{
diff --git a/include/bounce/common/template/object_array.h b/include/bounce/common/template/object_array.h
index 2e61516..9360f49 100644
--- a/include/bounce/common/template/object_array.h
+++ b/include/bounce/common/template/object_array.h
@@ -19,7 +19,7 @@
#ifndef B3_OBJECT_ARRAY_H
#define B3_OBJECT_ARRAY_H
-#include
+#include
// An array for objects.
template
diff --git a/include/bounce/common/template/stack.h b/include/bounce/common/template/stack.h
index 4908bec..9e9adc9 100644
--- a/include/bounce/common/template/stack.h
+++ b/include/bounce/common/template/stack.h
@@ -19,7 +19,7 @@
#ifndef B3_STACK_H
#define B3_STACK_H
-#include
+#include
// A growable stack for plain-old-data (POD).
template
@@ -39,7 +39,7 @@ public:
{
b3Free(m_elements);
}
- m_elements = nullptr;
+ m_elements = NULL;
}
const T& Top() const
diff --git a/include/bounce/common/time.h b/include/bounce/common/time.h
index 903876d..4625535 100644
--- a/include/bounce/common/time.h
+++ b/include/bounce/common/time.h
@@ -19,45 +19,195 @@
#ifndef B3_TIME_H
#define B3_TIME_H
-#include
+#include
+
+#define B3_WINDOWS 1
+#define B3_MAC 2
+#define B3_UNIX 3
+
+#if defined (_WIN32)
+#define B3_PLATFORM B3_WINDOWS
+#elif defined( __APPLE__ )
+#define B3_PLATFORM B3_MAC
+#else
+#define B3_PLATFORM B3_UNIX
+#endif
+
+#if B3_PLATFORM == B3_WINDOWS
+
+#include
// A timer class that accumulates time.
-// Usefull for measuring elapsed times of
-// sections of code.
+// Usefull for measuring elapsed times between code sections.
class b3Time
{
-public :
- b3Time();
+public:
+ b3Time()
+ {
+ LARGE_INTEGER c;
+ QueryPerformanceCounter(&c);
+ m_c0 = c.QuadPart;
+ m_t0 = 0.0;
+ m_t = 0.0;
+ }
- // Get the accumulated time in miliseconds
- // from this timer.
- float64 GetCurMilis() const;
+ // Get the accumulated time in miliseconds from this timer.
+ float64 GetCurrentMilis() const
+ {
+ return m_t;
+ }
// Get the elapsed time since this timer was updated.
- float64 GetElapsedMilis() const;
+ float64 GetElapsedMilis() const
+ {
+ return m_t - m_t0;
+ }
- // Add the elapsed time since this function
- // was called to this timer.
- void Update();
+ // Add the elapsed time since this function was called to this timer.
+ void Update()
+ {
+ static float64 inv_frequency = 0.0;
+ if (inv_frequency == 0.0)
+ {
+ LARGE_INTEGER c;
+ QueryPerformanceFrequency(&c);
+
+ float64 cycles_per_s = float64(c.QuadPart);
+ float64 s_per_cycle = 1.0 / cycles_per_s;
+ float64 ms_per_cycle = 1000.0 * s_per_cycle;
+ inv_frequency = ms_per_cycle;
+ }
+
+ LARGE_INTEGER c;
+ QueryPerformanceCounter(&c);
+
+ float64 dt = inv_frequency * float64(c.QuadPart - m_c0);
+ m_c0 = c.QuadPart;
+ Add(dt);
+ }
+
+ // Add time to this timer.
+ void Add(float64 dt)
+ {
+ m_t0 = m_t;
+ m_t += dt;
+ }
- // Add a given ammout of time to this timer.
- void UpdateBy(float64 dt);
private:
- static float64 m_invFrequency;
-
- u64 m_lastRealTime;
- float64 m_lastTime;
- float64 m_curTime;
+ u64 m_c0;
+ float64 m_t0;
+ float64 m_t;
};
-inline float64 b3Time::GetCurMilis() const
-{
- return m_curTime;
-}
+#elif B3_PLATFORM == B3_MAC
-inline float64 b3Time::GetElapsedMilis() const
-{
- return m_curTime - m_lastTime;
-}
+#include
+
+// A timer class that accumulates time.
+// Usefull for measuring elapsed times between code sections.
+class b3Time
+{
+public:
+ b3Time()
+ {
+ m_c0 = mach_absolute_time();
+ m_t0 = 0.0;
+ m_t = 0.0;
+ }
+
+ // Get the accumulated time in miliseconds from this timer.
+ double GetCurrentMilis() const
+ {
+ return m_t;
+ }
+
+ // Get the elapsed time since this timer was updated.
+ double GetElapsedMilis() const
+ {
+ return m_t - m_t0;
+ }
+
+ // Add the elapsed time since this function was called to this timer.
+ void Update()
+ {
+ static double inv_frequency = 0.0;
+ if (inv_frequency == 0.0)
+ {
+ mach_timebase_info_data_t info;
+ mach_timebase_info(&info);
+ inv_frequency = double(info.numer) / (double(info.denom) * 1.0e6);
+ }
+
+ uint64_t c = mach_absolute_time();
+ double dt = inv_frequency * (double)(c - m_c0);
+ m_c0 = c;
+ Add(dt);
+ }
+
+ // Add time to this timer.
+ void Add(double dt)
+ {
+ m_t0 = m_t;
+ m_t += dt;
+ }
+
+private:
+ uint64_t m_c0;
+ double m_t0;
+ double m_t;
+};
+
+#else
+
+#include
+
+// A timer class that accumulates time.
+// Usefull for measuring elapsed times between code sections.
+class b3Time
+{
+public:
+ b3Time()
+ {
+ clock_gettime(CLOCK_MONOTONIC, &m_c0);
+ m_t0 = 0.0;
+ m_t = 0.0;
+ }
+
+ // Get the accumulated time in miliseconds from this timer.
+ double GetCurrentMilis() const
+ {
+ return m_t;
+ }
+
+ // Get the elapsed time since this timer was updated.
+ double GetElapsedMilis() const
+ {
+ return m_t - m_t0;
+ }
+
+ // Add the elapsed time since this function was called to this timer.
+ void Update()
+ {
+ struct timespec c;
+ clock_gettime(CLOCK_MONOTONIC, &c);
+ double dt = (double)(c.tv_nsec - m_c0.tv_nsec) * 1.0e-6;
+ m_c0 = c;
+ Add(dt);
+ }
+
+ // Add time to this timer.
+ void Add(double dt)
+ {
+ m_t0 = m_t;
+ m_t += dt;
+ }
+
+private:
+ struct timespec m_c0;
+ double m_t0;
+ double m_t;
+};
+
+#endif // B3_PLATFORM
#endif
diff --git a/include/bounce/dynamics/body.h b/include/bounce/dynamics/body.h
index 3a39562..1087ffe 100644
--- a/include/bounce/dynamics/body.h
+++ b/include/bounce/dynamics/body.h
@@ -19,11 +19,11 @@
#ifndef B3_BODY_H
#define B3_BODY_H
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
class b3World;
class b3Shape;
@@ -51,7 +51,7 @@ struct b3BodyDef
fixedRotationX = false;
fixedRotationY = false;
fixedRotationZ = false;
- userData = nullptr;
+ userData = NULL;
position.SetZero();
orientation.SetIdentity();
linearVelocity.SetZero();
@@ -81,6 +81,13 @@ public:
// A world manages the body destruction.
~b3Body() { }
+ // Get the type of the body.
+ b3BodyType GetType() const;
+
+ // Set the type of the body.
+ // This will reset the current body inertial properties.
+ void SetType(b3BodyType type);
+
// Create a new shape for the body given the shape definition and return a pointer to its clone.
// The shape passed to the definition it will be cloned and is not recommended modifying
// it inside simulation callbacks.
@@ -90,36 +97,20 @@ public:
// Destroy a given shape from the body.
void DestroyShape(b3Shape* shape);
- // Destroy all shapes associated with the body.
- void DestroyShapes();
-
- // Destroy all contacts associated with the body.
- void DestroyContacts();
-
- // Destroy all joints connected to the body.
- void DestroyJoints();
-
// Get the shapes associated with the body.
const b3List1& GetShapeList() const;
b3List1& GetShapeList();
- // Get the type of the body.
- b3BodyType GetType() const;
-
- // Set the type of the body.
- // This will reset the current body inertial properties.
- void SetType(b3BodyType type);
-
// Get the world the body belongs to.
const b3World* GetWorld() const;
b3World* GetWorld();
- // Get the body world b3Transform.
+ // Get the body world transform.
const b3Transform& GetTransform() const;
- // Set the body world b3Transform from a position, axis of rotation and an angle
+ // Set the body world transform from a position, axis of rotation and an angle
// of rotation about the axis.
- // However, manipulating a body b3Transform during the simulation may cause non-physical behaviour.
+ // However, manipulating a body transform during the simulation may cause non-physical behaviour.
void SetTransform(const b3Vec3& position, const b3Vec3& axis, float32 angle);
// Get the gravity scale of the body. One is used by default.
@@ -186,7 +177,7 @@ public:
// Get the rotational inertia of the body about the center of mass. Typically in kg/m^3.
const b3Mat33& GetInertia() const;
- // Get the total kinetic energy of the body.
+ // Get the total kinetic energy of the body in Joules (kilogram-meters squared per second squared).
float32 GetKineticEnergy() const;
// Transform a vector to the local space of this body.
@@ -242,18 +233,25 @@ private:
e_fixedRotationY = 0x0008,
e_fixedRotationZ = 0x0010,
};
-
+
+ // Destroy all shapes associated with the body.
+ void DestroyShapes();
+
+ // Destroy all contacts associated with the body.
+ void DestroyContacts();
+
+ // Destroy all joints connected to the body.
+ void DestroyJoints();
+
// Recalculate the mass of the body based on the shapes associated
// with it.
void ResetMass();
- // Synchronize this body b3Transform with its world
+ // Synchronize this body transform with its world
// center of mass and orientation.
void SynchronizeTransform();
- // Compute the body world inertial tensor.
- // Compute the shapes world AABBs.
- // Usually this is called after the body b3Transform is synchronized.
+ // Synchronize this body shape AABBs with the synchronized transform.
void SynchronizeShapes();
// Check if this body should collide with another.
@@ -267,7 +265,7 @@ private:
// The shapes attached to this body.
b3List1 m_shapeList;
- // Bidirectional joint edges for this body
+ // Joint edges for this body joint graph.
b3List2 m_jointEdges;
// User associated data (usually an entity).
@@ -275,13 +273,16 @@ private:
// Body mass.
float32 m_mass;
+
// Inverse body mass.
float32 m_invMass;
// Inertia about the body local center of mass.
b3Mat33 m_I;
+
// Inverse inertia about the body local center of mass.
b3Mat33 m_invI;
+
// Inverse inertia about the body world center of mass.
b3Mat33 m_worldInvI;
diff --git a/include/bounce/dynamics/contact_manager.h b/include/bounce/dynamics/contact_manager.h
index 6154ccc..a32ffc9 100644
--- a/include/bounce/dynamics/contact_manager.h
+++ b/include/bounce/dynamics/contact_manager.h
@@ -19,9 +19,9 @@
#ifndef B3_CONTACT_MANAGER_H
#define B3_CONTACT_MANAGER_H
-#include
-#include
-#include
+#include
+#include
+#include
class b3Shape;
class b3Contact;
@@ -29,7 +29,7 @@ class b3ContactFilter;
class b3ContactListener;
struct b3MeshContactLink;
-// This is used to avoid b3World pollution.
+// Contact delegator for b3World.
class b3ContactManager
{
public:
@@ -38,6 +38,8 @@ public:
// The broad-phase callback.
void AddPair(void* proxyDataA, void* proxyDataB);
+ // Reference AABBs in mesh contacts need to be synchronized with the
+ // synchronized body transforms.
void SynchronizeShapes();
void FindNewContacts();
@@ -45,7 +47,6 @@ public:
void UpdateContacts();
b3Contact* Create(b3Shape* shapeA, b3Shape* shapeB);
-
void Destroy(b3Contact* c);
b3BlockPool m_convexBlocks;
diff --git a/include/bounce/dynamics/contacts/collide/clip.h b/include/bounce/dynamics/contacts/collide/clip.h
index 27d9c81..ad3f7b2 100644
--- a/include/bounce/dynamics/contacts/collide/clip.h
+++ b/include/bounce/dynamics/contacts/collide/clip.h
@@ -19,8 +19,8 @@
#ifndef B3_CLIP_H
#define B3_CLIP_H
-#include
-#include
+#include
+#include
#define B3_NULL_EDGE (0xFF)
diff --git a/include/bounce/dynamics/contacts/collide/collide.h b/include/bounce/dynamics/contacts/collide/collide.h
index c83ec6a..062d7ac 100644
--- a/include/bounce/dynamics/contacts/collide/collide.h
+++ b/include/bounce/dynamics/contacts/collide/collide.h
@@ -19,11 +19,11 @@
#ifndef B3_COLLIDE_H
#define B3_COLLIDE_H
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
class b3Shape;
class b3SphereShape;
diff --git a/include/bounce/dynamics/contacts/contact.h b/include/bounce/dynamics/contacts/contact.h
index bc53509..a08ed85 100644
--- a/include/bounce/dynamics/contacts/contact.h
+++ b/include/bounce/dynamics/contacts/contact.h
@@ -19,9 +19,9 @@
#ifndef B3_CONTACT_H
#define B3_CONTACT_H
-#include
-#include
-#include
+#include
+#include
+#include
struct b3Manifold;
struct b3WorldManifold;
@@ -58,7 +58,7 @@ struct b3OverlappingPair
// todo
struct b3TOIEvent
{
- //float32 t;
+ float32 t;
};
enum b3ContactType
diff --git a/include/bounce/dynamics/contacts/contact_cluster.h b/include/bounce/dynamics/contacts/contact_cluster.h
index c5cc7aa..6cb09c2 100644
--- a/include/bounce/dynamics/contacts/contact_cluster.h
+++ b/include/bounce/dynamics/contacts/contact_cluster.h
@@ -19,9 +19,9 @@
#ifndef B3_CONTACT_CLUSTER_H
#define B3_CONTACT_CLUSTER_H
-#include
-#include
-#include
+#include
+#include
+#include
#define B3_NULL_CLUSTER (-1)
@@ -40,7 +40,7 @@ struct b3Observation
{
u32 manifold;
u32 manifoldPoint;
- b3Vec3 point;
+ b3Vec3 point; // normal
i32 cluster; // normal
};
diff --git a/include/bounce/dynamics/contacts/contact_solver.h b/include/bounce/dynamics/contacts/contact_solver.h
index 5db172e..d35b501 100644
--- a/include/bounce/dynamics/contacts/contact_solver.h
+++ b/include/bounce/dynamics/contacts/contact_solver.h
@@ -19,10 +19,10 @@
#ifndef B3_CONTACT_SOLVER_H
#define B3_CONTACT_SOLVER_H
-#include
-#include