GameServer - Merged with gamephysics
This commit is contained in:
commit
deb173bc46
724
Code/DanBias.sln
724
Code/DanBias.sln
|
@ -5,14 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterGraphics", "OysterGra
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterMath", "OysterMath\OysterMath.vcxproj", "{F10CBC03-9809-4CBA-95D8-327C287B18EE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterPhysics3D", "OysterPhysics3D\OysterPhysics3D.vcxproj", "{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sound", "Sound\Sound.vcxproj", "{34D6295A-00DD-4B1A-8258-97DA2818EC26}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowManager", "WindowManager\WindowManager.vcxproj", "{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Input", "Input\Input.vcxproj", "{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Misc", "Misc\Misc.vcxproj", "{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Network", "Network", "{C27B926E-B3EF-4990-8822-47580E43A0BE}"
|
||||
|
@ -23,25 +15,35 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterNetworkServer", "Netw
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkDependencies", "Network\NetworkDependencies\NetworkDependencies.vcxproj", "{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\GamePhysics.vcxproj", "{104FA3E9-94D9-4E1D-A941-28A03BC8A095}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tester", "Tester\Tester.vcxproj", "{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Game", "Game", "{B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aDanBiasGameLauncher", "Game\aDanBiasGameLauncher\aDanBiasGameLauncher.vcxproj", "{666FEA52-975F-41CD-B224-B19AF3C0ABBA}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "Game\DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Game", "Game", "{20720CA7-795C-45AD-A302-9383A6DD503A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameLogic", "Game\GameLogic\GameLogic.vcxproj", "{B1195BB9-B3A5-47F0-906C-8DEA384D1520}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasLauncher", "Game\DanBiasLauncher\DanBiasLauncher.vcxproj", "{8690FDDF-C5B7-4C42-A337-BD5243F29B85}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkAPI", "Network\NetworkAPI\NetworkAPI.vcxproj", "{460D625F-2AC9-4559-B809-0BA89CEAEDF4}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameProtocols", "Game\GameProtocols\GameProtocols.vcxproj", "{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasServerLauncher", "Game\DanBiasServerLauncher\DanBiasServerLauncher.vcxproj", "{060B1890-CBF3-4808-BA99-A4776222093B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameLogic", "Game\GameLogic\GameLogic.vcxproj", "{B1195BB9-B3A5-47F0-906C-8DEA384D1520}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameProtocols", "Game\GameProtocols\GameProtocols.vcxproj", "{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameServer", "Game\GameServer\GameServer.vcxproj", "{143BD516-20A1-4890-A3E4-F8BFD02220E7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aDanBiasGameLauncher", "Game\aDanBiasGameLauncher\aDanBiasGameLauncher.vcxproj", "{666FEA52-975F-41CD-B224-B19AF3C0ABBA}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkAPI", "Network\NetworkAPI\NetworkAPI.vcxproj", "{460D625F-2AC9-4559-B809-0BA89CEAEDF4}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\GamePhysics.vcxproj", "{104FA3E9-94D9-4E1D-A941-28A03BC8A095}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Input", "Input\Input.vcxproj", "{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterPhysics3D", "OysterPhysics3D\OysterPhysics3D.vcxproj", "{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sound", "Sound\Sound.vcxproj", "{34D6295A-00DD-4B1A-8258-97DA2818EC26}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowManager", "WindowManager\WindowManager.vcxproj", "{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Physics", "Physics", "{0D86E569-9C74-47F0-BDB2-390C0C9A084B}"
|
||||
EndProject
|
||||
|
@ -61,10 +63,11 @@ Global
|
|||
RelWithDebInfo|x64 = RelWithDebInfo|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Deploy.0 = Debug|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
|
@ -73,8 +76,8 @@ Global
|
|||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.Build.0 = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.Build.0 = Release|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.ActiveCfg = Release|x64
|
||||
|
@ -85,10 +88,11 @@ Global
|
|||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Deploy.0 = Debug|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
|
@ -97,8 +101,8 @@ Global
|
|||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.Build.0 = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|x64.ActiveCfg = Release|x64
|
||||
|
@ -109,6 +113,342 @@ Global
|
|||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Debug|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Deploy.0 = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.Build.0 = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.Build.0 = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.Build.0 = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.Build.0 = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Debug|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.Build.0 = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.Build.0 = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.Build.0 = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.Build.0 = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.Build.0 = Debug|x64
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.MinSizeRel|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.MinSizeRel|Win32.ActiveCfg = Debug|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.MinSizeRel|x64.ActiveCfg = Debug|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.ActiveCfg = Release|x64
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.Build.0 = Release|x64
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|x64.Build.0 = Debug|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Win32.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|x64.Build.0 = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.Build.0 = Debug|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.Build.0 = Debug|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.ActiveCfg = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.Build.0 = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.Build.0 = Debug|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.ActiveCfg = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.Build.0 = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.ActiveCfg = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.Build.0 = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.Build.0 = Debug|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.ActiveCfg = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.Build.0 = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|x64.Build.0 = Debug|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Win32.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|x64.ActiveCfg = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|x64.Build.0 = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.Build.0 = Debug|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.ActiveCfg = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.Build.0 = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.Build.0 = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.Build.0 = Debug|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.ActiveCfg = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.Build.0 = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
|
@ -181,324 +521,6 @@ Global
|
|||
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.Build.0 = Debug|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.ActiveCfg = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.Build.0 = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.Build.0 = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Debug|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.Build.0 = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.ActiveCfg = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.Build.0 = Release|x64
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Debug|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.Build.0 = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.ActiveCfg = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.Build.0 = Release|x64
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Debug|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.Build.0 = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.ActiveCfg = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.Build.0 = Release|x64
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.Build.0 = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.Build.0 = Debug|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.ActiveCfg = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.Build.0 = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.Build.0 = Debug|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.ActiveCfg = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.Build.0 = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.Build.0 = Debug|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.ActiveCfg = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.Build.0 = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.Build.0 = Debug|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.ActiveCfg = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.Build.0 = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.Build.0 = Debug|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.ActiveCfg = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.Build.0 = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|x64.Build.0 = Debug|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Win32.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|x64.ActiveCfg = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|x64.Build.0 = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|x64.Build.0 = Debug|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Win32.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|x64.Build.0 = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Mixed Platforms.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -508,12 +530,12 @@ Global
|
|||
{6A066806-F43F-4B31-A4E3-57179674F460} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
|
||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
|
||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA} = {20720CA7-795C-45AD-A302-9383A6DD503A}
|
||||
{666FEA52-975F-41CD-B224-B19AF3C0ABBA} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
{2A1BC987-AF42-4500-802D-89CD32FC1309} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
{8690FDDF-C5B7-4C42-A337-BD5243F29B85} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
{060B1890-CBF3-4808-BA99-A4776222093B} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
{B1195BB9-B3A5-47F0-906C-8DEA384D1520} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
{143BD516-20A1-4890-A3E4-F8BFD02220E7} = {B0AFF0DC-5C7E-43DC-9586-CD4E38EB037B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -215,6 +215,9 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GameClientRecieverFunc.h" />
|
||||
<ClInclude Include="GameClientState\Buttons\ButtonEllipse.h" />
|
||||
<ClInclude Include="GameClientState\Buttons\EventButtonGUI.h" />
|
||||
<ClInclude Include="GameClientState\Buttons\ButtonRectangle.h" />
|
||||
<ClInclude Include="GameClientState\Camera.h" />
|
||||
<ClInclude Include="GameClientState\C_obj\C_DynamicObj.h" />
|
||||
<ClInclude Include="GameClientState\C_obj\C_Player.h" />
|
||||
|
|
|
@ -59,8 +59,8 @@ namespace DanBias
|
|||
{
|
||||
|
||||
WindowShell::CreateConsoleWindow();
|
||||
//if(! m_data->window->CreateWin(WindowShell::WINDOW_INIT_DESC(L"Window", cPOINT(1600, 900), cPOINT())))
|
||||
if(! m_data->window->CreateWin(WindowShell::WINDOW_INIT_DESC()))
|
||||
if(! m_data->window->CreateWin(WindowShell::WINDOW_INIT_DESC(L"Window", cPOINT(1024, 768), cPOINT())))
|
||||
//if(! m_data->window->CreateWin(WindowShell::WINDOW_INIT_DESC()))
|
||||
return DanBiasClientReturn_Error;
|
||||
|
||||
if( FAILED( InitDirect3D() ) )
|
||||
|
@ -95,9 +95,10 @@ namespace DanBias
|
|||
capFrame += dt;
|
||||
if(capFrame > 0.03)
|
||||
{
|
||||
if(Update(dt) != S_OK)
|
||||
Oyster::Graphics::API::Update(capFrame);
|
||||
if(Update(capFrame) != S_OK)
|
||||
return DanBiasClientReturn_Error;
|
||||
if(Render(dt) != S_OK)
|
||||
if(Render(capFrame) != S_OK)
|
||||
return DanBiasClientReturn_Error;
|
||||
capFrame = 0;
|
||||
}
|
||||
|
@ -116,12 +117,12 @@ namespace DanBias
|
|||
//--------------------------------------------------------------------------------------
|
||||
HRESULT DanBiasGame::InitDirect3D()
|
||||
{
|
||||
if(Oyster::Graphics::API::Init(m_data->window->GetHWND(), false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess)
|
||||
return E_FAIL;
|
||||
Oyster::Graphics::API::Option p;
|
||||
p.modelPath = L"..\\Content\\Models\\";
|
||||
p.texturePath = L"..\\Content\\Textures\\";
|
||||
Oyster::Graphics::API::SetOptions(p);
|
||||
if(Oyster::Graphics::API::Init(m_data->window->GetHWND(), false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess)
|
||||
return E_FAIL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -131,7 +132,7 @@ namespace DanBias
|
|||
HRESULT DanBiasGame::InitInput()
|
||||
{
|
||||
m_data->inputObj = new InputClass;
|
||||
if(!m_data->inputObj->Initialize(m_data->window->GetHINSTANCE(), m_data->window->GetHWND(), m_data->window->GetHeight(), m_data->window->GetWidth()))
|
||||
if(!m_data->inputObj->Initialize(m_data->window->GetHINSTANCE(), m_data->window->GetHWND(), m_data->window->GetWidth(), m_data->window->GetHeight()))
|
||||
{
|
||||
MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK);
|
||||
return E_FAIL;
|
||||
|
@ -141,6 +142,20 @@ namespace DanBias
|
|||
|
||||
HRESULT DanBiasGame::Update(float deltaTime)
|
||||
{
|
||||
//Get mouse pos and window size (Temporary)
|
||||
POINT p;
|
||||
RECT r;
|
||||
GetCursorPos(&p);
|
||||
ScreenToClient(WindowShell::GetHWND(), &p);
|
||||
GetClientRect(WindowShell::GetHWND(), &r);
|
||||
|
||||
//Update menu buttons
|
||||
MouseInput mouseInput;
|
||||
mouseInput.x = (float)p.x / (float)r.right;
|
||||
mouseInput.y = (float)p.y / (float)r.bottom;
|
||||
mouseInput.mouseButtonPressed = m_data->inputObj->IsMousePressed();
|
||||
EventHandler::Instance().Update(mouseInput);
|
||||
|
||||
m_data->inputObj->Update();
|
||||
|
||||
if(m_data->serverOwner)
|
||||
|
@ -190,15 +205,16 @@ namespace DanBias
|
|||
|
||||
HRESULT DanBiasGame::Render(float deltaTime)
|
||||
{
|
||||
|
||||
|
||||
m_data->recieverObj->gameClientState->Render();
|
||||
|
||||
m_data->recieverObj->gameClientState->Render(deltaTime);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT DanBiasGame::CleanUp()
|
||||
{
|
||||
Oyster::Graphics::API::Clean();
|
||||
EventHandler::Instance().Clean();
|
||||
GameServerAPI::ServerStop();
|
||||
|
||||
m_data->recieverObj->gameClientState->Release();
|
||||
delete m_data->recieverObj->gameClientState;
|
||||
m_data->recieverObj->Disconnect();
|
||||
|
@ -206,9 +222,7 @@ namespace DanBias
|
|||
delete m_data->inputObj;
|
||||
delete m_data;
|
||||
|
||||
Oyster::Graphics::API::Clean();
|
||||
|
||||
GameServerAPI::ServerStop();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
//////////////////////////////////////
|
||||
// Created by Pontus Fransson 2014 //
|
||||
//////////////////////////////////////
|
||||
|
||||
#ifndef DANBIAS_CLIENT_BUTTON_CIRCLE_H
|
||||
#define DANBIAS_CLIENT_BUTTON_CIRCLE_H
|
||||
|
||||
#include "EventButtonGUI.h"
|
||||
|
||||
//Only for testing because we don't have any other input
|
||||
#include "../WindowManager/WindowShell.h"
|
||||
|
||||
namespace DanBias
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
template <typename Owner>
|
||||
class ButtonEllipse : public EventButtonGUI<Owner>
|
||||
{
|
||||
public:
|
||||
ButtonEllipse()
|
||||
: EventButtonGUI(), radius(0)
|
||||
{}
|
||||
ButtonEllipse(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, Owner owner, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, owner, pos, size, resize)
|
||||
{}
|
||||
ButtonEllipse(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, func, pos, size, resize)
|
||||
{}
|
||||
ButtonEllipse(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Owner owner, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, func, owner, pos, size, resize)
|
||||
{}
|
||||
ButtonEllipse(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Owner owner, void* userData, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, func, owner, userData, pos, size, resize)
|
||||
{}
|
||||
virtual ~ButtonEllipse()
|
||||
{}
|
||||
|
||||
//Circle vs point collision
|
||||
bool Collision(Oyster::Event::MouseInput& input)
|
||||
{
|
||||
//Should come from the InputClass
|
||||
float xMouse = input.x, yMouse = input.y;
|
||||
|
||||
double normx = (xMouse - pos.x) / size.x;
|
||||
double normy = (yMouse - pos.y) / size.y;
|
||||
|
||||
return (normx * normx + normy * normy) < 0.25;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,70 @@
|
|||
//////////////////////////////////////
|
||||
// Created by Pontus Fransson 2014 //
|
||||
//////////////////////////////////////
|
||||
|
||||
#ifndef DANBIAS_CLIENT_BUTTON_RECTANGLE_H
|
||||
#define DANBIAS_CLIENT_BUTTON_RECTANGLE_H
|
||||
|
||||
#include "EventButtonGUI.h"
|
||||
#include <iostream>
|
||||
//Only for testing because we don't have any other input
|
||||
#include "../WindowManager/WindowShell.h"
|
||||
|
||||
namespace DanBias
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
template <typename Owner>
|
||||
class ButtonRectangle : public EventButtonGUI<Owner>
|
||||
{
|
||||
public:
|
||||
ButtonRectangle()
|
||||
: EventButtonGUI(), width(0), height(0)
|
||||
{}
|
||||
ButtonRectangle(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, Owner owner, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, owner, pos, size, resize)
|
||||
{}
|
||||
ButtonRectangle(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, func, pos, size, resize)
|
||||
{}
|
||||
ButtonRectangle(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Owner owner, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, func, owner, pos, size, resize)
|
||||
{}
|
||||
ButtonRectangle(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Owner owner, void* userData, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButtonGUI(textureName, buttonText, textColor, func, owner, userData, pos, size, resize)
|
||||
{}
|
||||
virtual ~ButtonRectangle()
|
||||
{}
|
||||
|
||||
//Circle vs point collision
|
||||
bool Collision(Oyster::Event::MouseInput& input)
|
||||
{
|
||||
//Should come from the InputClass
|
||||
float xMouse = input.x, yMouse = input.y;
|
||||
|
||||
float widthTemp = pos.x - size.x * 0.5f;
|
||||
float widthTemp2 = pos.x + size.x * 0.5f;
|
||||
float heightTemp = pos.y - size.y * 0.5f;
|
||||
float heightTemp2 = pos.y + size.y * 0.5f;
|
||||
//std::cout << p.x << ' ' << p.y << ' ' << widthTemp << ' ' << heightTemp << std::endl;
|
||||
|
||||
if(xMouse >= widthTemp && xMouse <= widthTemp2 &&
|
||||
yMouse >= heightTemp && yMouse <= heightTemp2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,132 @@
|
|||
//////////////////////////////////////
|
||||
// Created by Pontus Fransson 2014 //
|
||||
//////////////////////////////////////
|
||||
|
||||
#ifndef DANBIAS_CLIENT_EVENT_BUTTON_GUI_H
|
||||
#define DANBIAS_CLIENT_EVENT_BUTTON_GUI_H
|
||||
|
||||
#include "../Misc/EventHandler/EventButton.h"
|
||||
#include "../OysterGraphics/DllInterfaces/GFXAPI.h"
|
||||
|
||||
|
||||
|
||||
namespace DanBias
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
/*Dictates if the texture should be resized based on the screen aspect ratio.
|
||||
|
||||
*/
|
||||
enum ResizeAspectRatio
|
||||
{
|
||||
ResizeAspectRatio_None,
|
||||
ResizeAspectRatio_Width,
|
||||
ResizeAspectRatio_Height,
|
||||
|
||||
ResizeAspectRatio_Count,
|
||||
ResizeAspectRatio_Unknown = -1
|
||||
};
|
||||
|
||||
|
||||
template <typename Owner>
|
||||
class EventButtonGUI : public Oyster::Event::EventButton<Owner>
|
||||
{
|
||||
public:
|
||||
EventButtonGUI()
|
||||
: EventButton(), pos(0, 0), size(0, 0), texture(NULL), buttonText(""), textColor(0, 0, 0)
|
||||
{}
|
||||
EventButtonGUI(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, Owner owner, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButton(owner), pos(pos), size(size), texture(NULL), buttonText(buttonText), textColor(textColor)
|
||||
{
|
||||
CreateTexture(textureName);
|
||||
if(resize != ResizeAspectRatio_None) ResizeWithAspectRatio(resize);
|
||||
}
|
||||
EventButtonGUI(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButton(func), pos(pos), size(size), texture(NULL), buttonText(buttonText), textColor(textColor)
|
||||
{
|
||||
CreateTexture(textureName);
|
||||
if(resize != ResizeAspectRatio_None) ResizeWithAspectRatio(resize);
|
||||
}
|
||||
EventButtonGUI(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Owner owner, Oyster::Math::Float3 pos,
|
||||
Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButton(func, owner), pos(pos), size(size), texture(NULL), buttonText(buttonText), textColor(textColor)
|
||||
{
|
||||
CreateTexture(textureName);
|
||||
if(resize != ResizeAspectRatio_None) ResizeWithAspectRatio(resize);
|
||||
}
|
||||
EventButtonGUI(std::wstring textureName, std::wstring buttonText, Oyster::Math::Float3 textColor, EventFunc func, Owner owner, void* userData, Oyster::Math::Float3 pos, Oyster::Math::Float2 size, ResizeAspectRatio resize = ResizeAspectRatio_Height)
|
||||
: EventButton(func, owner, userData), pos(pos), size(size), texture(NULL), buttonText(buttonText), textColor(textColor)
|
||||
{
|
||||
CreateTexture(textureName);
|
||||
if(resize != ResizeAspectRatio_None) ResizeWithAspectRatio(resize);
|
||||
}
|
||||
virtual ~EventButtonGUI()
|
||||
{
|
||||
Oyster::Graphics::API::DeleteTexture(texture);
|
||||
texture = NULL;
|
||||
}
|
||||
|
||||
void CreateTexture(std::wstring textureName)
|
||||
{
|
||||
//Create texture
|
||||
texture = Oyster::Graphics::API::CreateTexture(textureName);
|
||||
}
|
||||
|
||||
virtual void RenderTexture()
|
||||
{
|
||||
if(EventButton<Owner>::Enabled())
|
||||
{
|
||||
//Render att xPos and yPos
|
||||
//With width and height
|
||||
|
||||
if(EventButton<Owner>::GetState() == ButtonState_None)
|
||||
{
|
||||
//Oyster::Graphics::API::RenderGuiElement(texture, pos.xy, size, Oyster::Math::Float3(1.0f, 1.0f, 1.0f));
|
||||
}
|
||||
else if(EventButton<Owner>::GetState() == ButtonState_Hover)
|
||||
{
|
||||
//Oyster::Graphics::API::RenderGuiElement(texture, pos.xy, size, Oyster::Math::Float3(0.0f, 1.0f, 0.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Oyster::Graphics::API::RenderGuiElement(texture, pos.xy, size, Oyster::Math::Float3(1.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
virtual void RenderText()
|
||||
{
|
||||
if(buttonText.size() > 0)
|
||||
{
|
||||
//Oyster::Graphics::API::RenderText(buttonText, pos.xy, size, textColor);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void ResizeWithAspectRatio(ResizeAspectRatio resize)
|
||||
{
|
||||
RECT r;
|
||||
GetClientRect(WindowShell::GetHWND(), &r);
|
||||
|
||||
if(resize == ResizeAspectRatio_Height)
|
||||
size.y *= (float)r.right/(float)r.bottom;
|
||||
else if(resize == ResizeAspectRatio_Width)
|
||||
size.x *= (float)r.bottom/(float)r.right;
|
||||
}
|
||||
|
||||
protected:
|
||||
Oyster::Math::Float3 pos;
|
||||
Oyster::Math::Float2 size;
|
||||
|
||||
Oyster::Graphics::API::Texture texture;
|
||||
|
||||
std::wstring buttonText;
|
||||
Oyster::Math::Float3 textColor;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -23,9 +23,11 @@ private:
|
|||
Oyster::Math::Float3 position;
|
||||
Oyster::Math::Quaternion rotation;
|
||||
Oyster::Math::Float3 scale;
|
||||
Oyster::Graphics::Model::Model *model;
|
||||
|
||||
int id;
|
||||
void updateWorld();
|
||||
protected:
|
||||
Oyster::Graphics::Model::Model *model;
|
||||
public:
|
||||
|
||||
virtual void Init(ModelInitData modelInit);
|
||||
|
|
|
@ -16,4 +16,6 @@ C_Player::~C_Player(void)
|
|||
void C_Player::Init(ModelInitData modelInit)
|
||||
{
|
||||
C_Object::Init(modelInit);
|
||||
Oyster::Graphics::API::PlayAnimation(model, L"movement");
|
||||
//Oyster::Graphics::API::Update(0.002f);
|
||||
}
|
|
@ -69,7 +69,7 @@ public:
|
|||
virtual ~GameClientState(void);
|
||||
virtual bool Init(Oyster::Network::NetworkClient* nwClient) = 0;
|
||||
virtual ClientState Update(float deltaTime, InputClass* KeyInput) = 0;
|
||||
virtual bool Render() = 0;
|
||||
virtual bool Render(float dt) = 0;
|
||||
virtual bool Release() = 0;
|
||||
virtual void Protocol(ProtocolStruct* protocolStruct) = 0;
|
||||
|
||||
|
|
|
@ -4,18 +4,17 @@
|
|||
#include "NetworkClient.h"
|
||||
#include "Camera.h"
|
||||
#include <GameServerAPI.h>
|
||||
#include "LevelLoader\ObjectDefines.h"
|
||||
|
||||
using namespace GameLogic;
|
||||
using namespace DanBias::Client;
|
||||
using namespace Oyster::Math;
|
||||
struct GameState::myData
|
||||
{
|
||||
myData(){}
|
||||
//std::vector<C_Object*> object;
|
||||
int modelCount;
|
||||
Oyster::Network::NetworkClient* nwClient;
|
||||
gameStateState state;
|
||||
|
||||
|
||||
}privData;
|
||||
|
||||
GameState::GameState(void)
|
||||
|
@ -24,6 +23,7 @@ GameState::GameState(void)
|
|||
key_backward = false;
|
||||
key_strafeRight = false;
|
||||
key_strafeLeft = false;
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,36 +50,21 @@ bool GameState::Init(Oyster::Network::NetworkClient* nwClient)
|
|||
GameState::gameStateState GameState::LoadGame()
|
||||
{
|
||||
Oyster::Graphics::Definitions::Pointlight plight;
|
||||
plight.Pos = Oyster::Math::Float3(315.0f, 0.0f ,5.0f);
|
||||
plight.Color = Oyster::Math::Float3(0.9f,0.7f,0.2f);
|
||||
plight.Radius = 100.0f;
|
||||
plight.Bright = 0.9f;
|
||||
plight.Pos = Float3(615, 0 ,5);
|
||||
plight.Color = Float3(0.9f,0.7f,0.2f);
|
||||
plight.Radius = 100;
|
||||
plight.Bright = 0.5f;
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
plight.Pos = Oyster::Math::Float3(10.0f,350.0f,5.0f);
|
||||
plight.Color = Oyster::Math::Float3(0.9f,0.7f,0.3f);
|
||||
plight.Radius = 200.0f;
|
||||
plight.Bright = 0.7f;
|
||||
plight.Pos = Float3(10,800,5);
|
||||
plight.Color = Float3(0.9f,0.7f,0.3f);
|
||||
plight.Radius = 300;
|
||||
plight.Bright = 0.5f;
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
plight.Pos = Oyster::Math::Float3(350.0f,350.0f,5.0f);
|
||||
plight.Color = Oyster::Math::Float3(0.9f,0.7f,0.3f);
|
||||
plight.Radius = 200.0f;
|
||||
plight.Bright = 0.7f;
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
plight.Pos = Oyster::Math::Float3(10.0f,350.0f,350.0f);
|
||||
plight.Color = Oyster::Math::Float3(0.9f,0.7f,0.3f);
|
||||
plight.Radius = 200.0f;
|
||||
plight.Bright = 0.7f;
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
plight.Pos = Oyster::Math::Float3(10.0f,-15.0f,5.0f);
|
||||
plight.Color = Oyster::Math::Float3(0.0f,0.0f,1.0f);
|
||||
plight.Radius = 50.0f;
|
||||
plight.Bright = 2.0f;
|
||||
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
LoadModels();
|
||||
InitCamera(Oyster::Math::Float3(0.0f,0.0f,20.0f));
|
||||
// use level loader
|
||||
LoadModels("../Content/Worlds/ccc.bias");
|
||||
|
||||
// hardcoded objects
|
||||
LoadModels();
|
||||
Float3 startPos = Float3(0,0,20.0f);
|
||||
InitCamera(startPos);
|
||||
return gameStateState_playing;
|
||||
|
@ -105,7 +90,7 @@ bool GameState::LoadModels()
|
|||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
/*
|
||||
|
||||
// add box model
|
||||
modelData.position = Oyster::Math::Float3(0,0,0);
|
||||
modelData.rotation = Oyster::Math::Quaternion::identity;
|
||||
|
@ -122,9 +107,8 @@ bool GameState::LoadModels()
|
|||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
}
|
||||
|
||||
|
||||
// add crystal model
|
||||
modelData.position = Oyster::Math::Float3(10, 301, 0);
|
||||
modelData.position = Oyster::Math::Float3(10, 601, 0);
|
||||
modelData.modelPath = L"crystalformation_b.dan";
|
||||
modelData.id = id++;
|
||||
// load models
|
||||
|
@ -132,19 +116,26 @@ bool GameState::LoadModels()
|
|||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
// add house model
|
||||
modelData.position = Oyster::Math::Float3(-50, 290, 0);
|
||||
modelData.position = Oyster::Math::Float3(-50, 590, 0);
|
||||
//Oyster::Math3D::Float4x4 rot = Oyster::Math3D::RotationMatrix(Oyster::Math::Float3(0 ,Utility::Value::Radian(90.0f), 0));
|
||||
|
||||
modelData.visible = true;
|
||||
modelData.modelPath = L"building_corporation.dan";
|
||||
modelData.id = id++;
|
||||
// load models
|
||||
this->dynamicObjects.Push(new C_DynamicObj());
|
||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
// add jumppad
|
||||
modelData.position = Oyster::Math::Float3(4, 600.3f, 0);
|
||||
modelData.modelPath = L"jumppad_round.dan";
|
||||
modelData.id = id++;
|
||||
// load models
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
// add player model
|
||||
modelData.position = Oyster::Math::Float3(0, 320, 0);
|
||||
modelData.position = Oyster::Math::Float3(0, 602, 0);
|
||||
modelData.modelPath = L"char_still_sizeref.dan";
|
||||
modelData.id = id++;
|
||||
// load models
|
||||
|
@ -152,20 +143,14 @@ bool GameState::LoadModels()
|
|||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
// add player model 2
|
||||
modelData.position = Oyster::Math::Float3(50, 320, 0);
|
||||
modelData.position = Oyster::Math::Float3(50, 602, 0);
|
||||
modelData.modelPath = L"char_still_sizeref.dan";
|
||||
modelData.id = id++;
|
||||
// load models
|
||||
this->dynamicObjects.Push(new C_DynamicObj());
|
||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
// add jumppad
|
||||
modelData.position = Oyster::Math::Float3(4, 300.3, 0);
|
||||
modelData.modelPath = L"jumppad_round.dan";
|
||||
modelData.id = id++;
|
||||
// load models
|
||||
this->dynamicObjects.Push(new C_DynamicObj());
|
||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
|
||||
// add sky sphere
|
||||
modelData.position = Oyster::Math::Float3(0,0,0);
|
||||
|
@ -174,7 +159,7 @@ bool GameState::LoadModels()
|
|||
modelData.id = id++;
|
||||
// load models
|
||||
this->dynamicObjects.Push(new C_DynamicObj());
|
||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);*/
|
||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
return true;
|
||||
}
|
||||
bool GameState::LoadModels(std::string mapFile)
|
||||
|
@ -184,7 +169,7 @@ bool GameState::LoadModels(std::string mapFile)
|
|||
objects = levelLoader.LoadLevel(mapFile);
|
||||
|
||||
int objCount = objects.size();
|
||||
int modelId = 0;
|
||||
int modelId = 100;
|
||||
ModelInitData modelData;
|
||||
for (int i = 0; i < objCount; i++)
|
||||
{
|
||||
|
@ -201,9 +186,9 @@ bool GameState::LoadModels(std::string mapFile)
|
|||
|
||||
modelData.modelPath.assign(staticObjData->ModelFile.begin(), staticObjData->ModelFile.end());
|
||||
modelData.visible = true;
|
||||
//modelData.position = ;
|
||||
//modelData.rotation = Oyster::Math::Quaternion(Oyster::Math::Float3(2,2,-2), 1);
|
||||
//modelData.scale = Oyster::Math::Float3(2,2,2);
|
||||
modelData.position = staticObjData->position;
|
||||
modelData.rotation = Oyster::Math::Quaternion(Oyster::Math::Float3(staticObjData->rotation), staticObjData->rotation[3]);
|
||||
modelData.scale = staticObjData->scale;
|
||||
modelData.id = modelId++;
|
||||
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
|
@ -213,11 +198,11 @@ bool GameState::LoadModels(std::string mapFile)
|
|||
case GameLogic::ObjectType::ObjectType_Dynamic:
|
||||
{
|
||||
GameLogic::ObjectHeader* dynamicObjData = ((GameLogic::ObjectHeader*)obj);
|
||||
//modelData.position = ;
|
||||
//modelData.rotation = Oyster::Math::Quaternion(Oyster::Math::Float3(2,2,-2), 1);
|
||||
//modelData.scale = Oyster::Math::Float3(2,2,2);
|
||||
modelData.modelPath.assign(dynamicObjData->ModelFile.begin(), dynamicObjData->ModelFile.end());
|
||||
modelData.visible = true;
|
||||
modelData.position = dynamicObjData->position;
|
||||
modelData.rotation = Oyster::Math::Quaternion(Oyster::Math::Float3(dynamicObjData->rotation), dynamicObjData->rotation[3]);
|
||||
modelData.scale = dynamicObjData->scale;
|
||||
modelData.id = modelId++;
|
||||
|
||||
this->dynamicObjects.Push(new C_DynamicObj());
|
||||
|
@ -231,8 +216,8 @@ bool GameState::LoadModels(std::string mapFile)
|
|||
if(lightData->lightType == GameLogic::LightType_PointLight)
|
||||
{
|
||||
Oyster::Graphics::Definitions::Pointlight plight;
|
||||
plight.Pos = ((GameLogic::PointLight*)lightData)->position;
|
||||
plight.Color = lightData->diffuseColor;
|
||||
plight.Pos = ((GameLogic::BasicLight*)lightData)->position;
|
||||
plight.Color = lightData->color;
|
||||
plight.Radius = 100;
|
||||
plight.Bright = 0.9f;
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
|
@ -243,24 +228,51 @@ bool GameState::LoadModels(std::string mapFile)
|
|||
break;
|
||||
}
|
||||
}
|
||||
myId += modelId++;
|
||||
// add player model
|
||||
//modelData.position = ;
|
||||
//modelData.rotation = Oyster::Math::Quaternion(Oyster::Math::Float3(2,2,-2), 1);
|
||||
//modelData.scale = Oyster::Math::Float3(2,2,2);
|
||||
|
||||
|
||||
Oyster::Math::Quaternion first = Oyster::Math::Quaternion(Float3(0.3536,0.3536,-0.146), 0.8536);
|
||||
Oyster::Math::Quaternion second = Oyster::Math::Quaternion(Float3(0.3536,0.3536,-0.146), 0.8536);
|
||||
Oyster::Math::Quaternion result = first * second;
|
||||
Oyster::Math::Quaternion total = Oyster::Math::Quaternion(Float3(0.5,0.5,-0.5), 0.5);
|
||||
modelData.visible = true;
|
||||
modelData.position = Oyster::Math::Float3(20, 127,0);
|
||||
modelData.rotation = first;
|
||||
modelData.scale = Oyster::Math::Float3(1,1,1);
|
||||
modelData.modelPath = L"char_still_sizeref.dan";
|
||||
modelData.id = myId;
|
||||
// load models
|
||||
this->dynamicObjects.Push(new C_DynamicObj());
|
||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
/*C_Player* obj = new C_Player();
|
||||
privData->object.push_back(obj);
|
||||
privData->object[privData->object.size() -1 ]->Init(modelData);
|
||||
*/
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
modelData.visible = true;
|
||||
modelData.position = Oyster::Math::Float3(22, 127,0);
|
||||
modelData.rotation = second;
|
||||
modelData.scale = Oyster::Math::Float3(1,1,1);
|
||||
modelData.modelPath = L"char_still_sizeref.dan";
|
||||
modelData.id = myId;
|
||||
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
modelData.visible = true;
|
||||
modelData.position = Oyster::Math::Float3(24, 127,0);
|
||||
modelData.rotation = result;
|
||||
modelData.scale = Oyster::Math::Float3(1,1,1);
|
||||
modelData.modelPath = L"char_still_sizeref.dan";
|
||||
modelData.id = myId;
|
||||
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
modelData.visible = true;
|
||||
modelData.position = Oyster::Math::Float3(26, 127,0);
|
||||
modelData.rotation = total;
|
||||
modelData.scale = Oyster::Math::Float3(1,1,1);
|
||||
modelData.modelPath = L"char_still_sizeref.dan";
|
||||
modelData.id = myId;
|
||||
|
||||
this->staticObjects.Push(new C_StaticObj());
|
||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
@ -342,7 +354,12 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
|
|||
// read server data
|
||||
// update objects
|
||||
{
|
||||
readKeyInput(KeyInput);
|
||||
timer += deltaTime;
|
||||
if(timer > 0.03)
|
||||
{
|
||||
readKeyInput(KeyInput);
|
||||
timer = 0;
|
||||
}
|
||||
camera->UpdateViewMatrix();
|
||||
|
||||
}
|
||||
|
@ -357,7 +374,7 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
|
|||
// send key input to server.
|
||||
return ClientState_Same;
|
||||
}
|
||||
bool GameState::Render()
|
||||
bool GameState::Render(float dt)
|
||||
{
|
||||
Oyster::Graphics::API::SetView(camera->View());
|
||||
|
||||
|
@ -370,6 +387,11 @@ bool GameState::Render()
|
|||
{
|
||||
dynamicObjects[i]->Render();
|
||||
}
|
||||
Oyster::Graphics::API::StartTextRender();
|
||||
std::wstring fps;
|
||||
float f = 1/dt;
|
||||
fps = std::to_wstring(f);
|
||||
//Oyster::Graphics::API::RenderText(fps,Oyster::Math::Float2(0.5f,0.1f),Oyster::Math::Float2(0.2f,0.05f));
|
||||
|
||||
Oyster::Graphics::API::EndFrame();
|
||||
return true;
|
||||
|
@ -392,7 +414,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
|
||||
if(KeyInput->IsKeyPressed(DIK_W))
|
||||
{
|
||||
if(!key_forward)
|
||||
//if(!key_forward)
|
||||
{
|
||||
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementForward());
|
||||
key_forward = true;
|
||||
|
@ -403,7 +425,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
|
||||
if(KeyInput->IsKeyPressed(DIK_S))
|
||||
{
|
||||
if(!key_backward)
|
||||
//if(!key_backward)
|
||||
{
|
||||
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementBackward());
|
||||
key_backward = true;
|
||||
|
@ -414,7 +436,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
|
||||
if(KeyInput->IsKeyPressed(DIK_A))
|
||||
{
|
||||
if(!key_strafeLeft)
|
||||
//if(!key_strafeLeft)
|
||||
{
|
||||
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementLeft());
|
||||
key_strafeLeft = true;
|
||||
|
@ -425,7 +447,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
|
||||
if(KeyInput->IsKeyPressed(DIK_D))
|
||||
{
|
||||
if(!key_strafeRight)
|
||||
//if(!key_strafeRight)
|
||||
{
|
||||
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementRight());
|
||||
key_strafeRight = true;
|
||||
|
@ -436,20 +458,17 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
|
||||
|
||||
//send delta mouse movement
|
||||
//if (KeyInput->IsMousePressed())
|
||||
if (KeyInput->IsMousePressed())
|
||||
{
|
||||
camera->Yaw(-KeyInput->GetYaw());
|
||||
camera->Pitch(KeyInput->GetPitch());
|
||||
pitch = KeyInput->GetPitch();
|
||||
camera->UpdateViewMatrix();
|
||||
GameLogic::Protocol_PlayerLook playerLookDir;
|
||||
Oyster::Math::Float4 look = camera->GetLook();
|
||||
playerLookDir.lookDirX = look.x;
|
||||
playerLookDir.lookDirY = look.y;
|
||||
playerLookDir.lookDirZ = look.z;
|
||||
playerLookDir.deltaX = -KeyInput->GetYaw();
|
||||
Oyster::Math::Float3 look = camera->GetLook();
|
||||
Oyster::Math::Float3 right = camera->GetRight();
|
||||
GameLogic::Protocol_PlayerLook playerLook(look, right);
|
||||
|
||||
privData->nwClient->Send(playerLookDir);
|
||||
privData->nwClient->Send(playerLook);
|
||||
}
|
||||
|
||||
// shoot
|
||||
|
@ -467,6 +486,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
}
|
||||
else
|
||||
key_Shoot = false;
|
||||
|
||||
if(KeyInput->IsKeyPressed(DIK_X))
|
||||
{
|
||||
if(!key_Shoot)
|
||||
|
@ -481,6 +501,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
|
|||
}
|
||||
else
|
||||
key_Shoot = false;
|
||||
|
||||
if(KeyInput->IsKeyPressed(DIK_C))
|
||||
{
|
||||
if(!key_Shoot)
|
||||
|
@ -541,44 +562,26 @@ void GameState::Protocol( ObjPos* pos )
|
|||
{
|
||||
world[i] = pos->worldPos[i];
|
||||
}
|
||||
//printf("pos for obj %d, ",pos->object_ID );
|
||||
|
||||
for (unsigned int i = 0; i < dynamicObjects.Size(); i++)
|
||||
{
|
||||
if(dynamicObjects[i]->GetId() == pos->object_ID)
|
||||
{
|
||||
|
||||
|
||||
//dynamicObjects[i]->setPos(Float3(world[12], world[13], world[14]));
|
||||
dynamicObjects[i]->setWorld(world);
|
||||
dynamicObjects[i]->setPos(Float3(world[0], world[1], world[2]));
|
||||
dynamicObjects[i]->setRot(Quaternion(Float3(world[3], world[4], world[5]), world[6]));
|
||||
//dynamicObjects[i]->setWorld(world);
|
||||
|
||||
if(dynamicObjects[i]->GetId() == myId) // playerobj
|
||||
{
|
||||
Float3 right = Float3(world[0], world[1], world[2]);
|
||||
Float3 up = Float3(world[4], world[5], world[6]);
|
||||
Float3 objForward = Float3(world[8], world[9], world[10]);
|
||||
Float3 pos = Float3(world[12], world[13], world[14]);
|
||||
|
||||
Float3 cameraLook = camera->GetLook();
|
||||
Float3 cameraUp = camera->GetUp();
|
||||
|
||||
|
||||
|
||||
/*Oyster::Math::Float3 newUp = cameraUp.Dot(up);
|
||||
up *= newUp;
|
||||
up.Normalize();
|
||||
Oyster::Math::Float3 newLook = up.Cross(right);
|
||||
newLook.Normalize();*/
|
||||
|
||||
//camera->setRight(right);
|
||||
//camera->setUp(up);
|
||||
//camera->setLook(objForward);
|
||||
|
||||
up *= 1;
|
||||
objForward *= -2;
|
||||
Float3 pos = dynamicObjects[i]->getPos();
|
||||
Float3 up = dynamicObjects[i]->getWorld().v[1];
|
||||
Float3 objForward = dynamicObjects[i]->getWorld().v[2];
|
||||
up *= 3;
|
||||
objForward *= -4;
|
||||
Oyster::Math::Float3 cameraPos = pos + up + objForward;
|
||||
//camera->SetPosition(cameraPos);
|
||||
//camera->UpdateViewMatrix();
|
||||
|
||||
camera->SetPosition(cameraPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ private:
|
|||
|
||||
int myId;
|
||||
float pitch;
|
||||
float timer;
|
||||
struct myData;
|
||||
myData* privData;
|
||||
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_StaticObj>> staticObjects;
|
||||
|
@ -49,7 +50,7 @@ public:
|
|||
void InitiatePlayer(int id, std::wstring modelName, Oyster::Math::Float4x4 world);
|
||||
gameStateState LoadGame();
|
||||
void readKeyInput(InputClass* KeyInput);
|
||||
bool Render()override;
|
||||
bool Render(float dt)override;
|
||||
bool Release()override;
|
||||
|
||||
void Protocol(ProtocolStruct* pos)override;
|
||||
|
|
|
@ -169,7 +169,7 @@ GameClientState::ClientState LanMenuState::ChangeState(InputClass* KeyInput)
|
|||
return ClientState_Same;
|
||||
}
|
||||
|
||||
bool LanMenuState::Render()
|
||||
bool LanMenuState::Render(float dt)
|
||||
{
|
||||
Oyster::Graphics::API::SetView(privData->view);
|
||||
Oyster::Graphics::API::SetProjection( privData->proj);
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace DanBias
|
|||
bool LoadModels(std::wstring file);
|
||||
bool InitCamera(Oyster::Math::Float3 startPos);
|
||||
|
||||
virtual bool Render();
|
||||
virtual bool Render(float dt);
|
||||
virtual bool Release();
|
||||
virtual void Protocol(ProtocolStruct* protocolStruct);
|
||||
|
||||
|
|
|
@ -17,7 +17,14 @@ struct LevelLoader::PrivData
|
|||
LevelLoader::LevelLoader()
|
||||
: pData(new PrivData)
|
||||
{
|
||||
pData->folderPath = "Standard path";
|
||||
//standard path
|
||||
pData->folderPath = "";
|
||||
}
|
||||
|
||||
LevelLoader::LevelLoader(std::string folderPath)
|
||||
: pData(new PrivData)
|
||||
{
|
||||
pData->folderPath = folderPath;
|
||||
}
|
||||
|
||||
LevelLoader::~LevelLoader()
|
||||
|
@ -26,10 +33,20 @@ LevelLoader::~LevelLoader()
|
|||
|
||||
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LevelLoader::LoadLevel(std::string fileName)
|
||||
{
|
||||
return pData->parser.Parse(fileName);
|
||||
return pData->parser.Parse(pData->folderPath + fileName);
|
||||
}
|
||||
|
||||
LevelMetaData LevelLoader::LoadLevelHeader(std::string fileName)
|
||||
{
|
||||
return pData->parser.ParseHeader(fileName);
|
||||
return pData->parser.ParseHeader(pData->folderPath + fileName);
|
||||
}
|
||||
|
||||
std::string LevelLoader::GetFolderPath()
|
||||
{
|
||||
return this->pData->folderPath;
|
||||
}
|
||||
|
||||
void LevelLoader::SetFolderPath(std::string folderPath)
|
||||
{
|
||||
|
||||
}
|
|
@ -17,11 +17,15 @@ namespace GameLogic
|
|||
|
||||
public:
|
||||
LevelLoader();
|
||||
/***********************************************************
|
||||
* Lets you set the standard folderpath for the levels
|
||||
********************************************************/
|
||||
LevelLoader(std::string folderPath);
|
||||
~LevelLoader();
|
||||
|
||||
/********************************************************
|
||||
* Loads the level and objects from file.
|
||||
* @param fileName: Path to the level-file that you want to load.
|
||||
* @param fileName: Path/name to the level-file that you want to load.
|
||||
* @return: Returns all structs with objects and information about the level.
|
||||
********************************************************/
|
||||
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LoadLevel(std::string fileName);
|
||||
|
@ -33,6 +37,16 @@ namespace GameLogic
|
|||
********************************************************/
|
||||
LevelMetaData LoadLevelHeader(std::string fileName); //.
|
||||
|
||||
/***********************************************************
|
||||
* @return: Returns the current standard folder path
|
||||
********************************************************/
|
||||
std::string GetFolderPath();
|
||||
|
||||
/***********************************************************
|
||||
* Sets the standard folder path
|
||||
********************************************************/
|
||||
void SetFolderPath(std::string folderPath);
|
||||
|
||||
private:
|
||||
struct PrivData;
|
||||
Utility::DynamicMemory::SmartPointer<PrivData> pData;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/////////////////////////////////////
|
||||
// Created by Pontus Fransson 2013 //
|
||||
/////////////////////////////////////
|
||||
|
||||
#include "LevelParser.h"
|
||||
|
||||
#include "Loader.h"
|
||||
|
@ -9,7 +13,7 @@ using namespace Utility::DynamicMemory;
|
|||
|
||||
LevelParser::LevelParser()
|
||||
{
|
||||
formatVersion.formatVersionMajor = 1;
|
||||
formatVersion.formatVersionMajor = 3;
|
||||
formatVersion.formatVersionMinor = 0;
|
||||
}
|
||||
|
||||
|
@ -21,6 +25,7 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
{
|
||||
int bufferSize = 0;
|
||||
int counter = 0;
|
||||
bool loadCgf;
|
||||
|
||||
std::vector<SmartPointer<ObjectTypeHeader>> objects;
|
||||
|
||||
|
@ -29,35 +34,117 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
char* buffer = (char*)loader.LoadFile(filename.c_str(), bufferSize);
|
||||
|
||||
//Read format version
|
||||
FormatVersion levelFormatVersion;
|
||||
LevelLoaderInternal::FormatVersion levelFormatVersion;
|
||||
ParseObject(&buffer[counter], &levelFormatVersion, sizeof(levelFormatVersion));
|
||||
counter += sizeof(levelFormatVersion);
|
||||
if(this->formatVersion != levelFormatVersion)
|
||||
{
|
||||
//Do something if it's not the same version
|
||||
//Returns an empty vector, because it will most likely fail to read the level format.
|
||||
return objects;
|
||||
}
|
||||
|
||||
while(counter < bufferSize)
|
||||
{
|
||||
loadCgf = true;
|
||||
//Get typeID
|
||||
ObjectTypeHeader typeID;
|
||||
ObjectType typeID;
|
||||
ParseObject(&buffer[counter], &typeID, sizeof(typeID));
|
||||
switch((int)typeID.typeID)
|
||||
switch((int)typeID)
|
||||
{
|
||||
case ObjectType_LevelMetaData:
|
||||
{
|
||||
LevelMetaData* header = new LevelMetaData;
|
||||
ParseLevelMetaData(&buffer[counter], *header, counter);
|
||||
SmartPointer<ObjectTypeHeader> header = new LevelMetaData;
|
||||
ParseLevelMetaData(&buffer[counter], *(LevelMetaData*)header.Get(), counter);
|
||||
objects.push_back(header);
|
||||
break;
|
||||
}
|
||||
|
||||
//This is by design, static and dynamic is using the same converter. Do not add anything inbetween them.
|
||||
//Unless they are changed to not be the same.
|
||||
case ObjectType_Static: case ObjectType_Dynamic:
|
||||
{
|
||||
ObjectHeader* header = new ObjectHeader;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
objects.push_back(header);
|
||||
//Get specialType.
|
||||
ObjectSpecialType specialType;
|
||||
ParseObject(&buffer[counter+4], &specialType, sizeof(typeID));
|
||||
|
||||
switch(specialType)
|
||||
{
|
||||
//there is no difference when parsing these specialTypes.
|
||||
case ObjectSpecialType_CrystalShard:
|
||||
case ObjectSpecialType_CrystalFormation:
|
||||
case ObjectSpecialType_Spike:
|
||||
case ObjectSpecialType_SpikeBox:
|
||||
case ObjectSpecialType_RedExplosiveBox:
|
||||
case ObjectSpecialType_StandarsBox:
|
||||
case ObjectSpecialType_Stone:
|
||||
case ObjectSpecialType_Building:
|
||||
{
|
||||
ObjectHeader* header = new ObjectHeader;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_JumpPad:
|
||||
{
|
||||
JumpPadAttributes* header = new JumpPadAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
//Read the spec
|
||||
ParseObject(&buffer[counter], header->direction, 16);
|
||||
counter += 16;
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_Portal:
|
||||
{
|
||||
PortalAttributes* header = new PortalAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
ParseObject(&buffer[counter], header->destination, 12);
|
||||
counter += 12;
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_World:
|
||||
{
|
||||
WorldAttributes* header = new WorldAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
ParseObject(&buffer[counter], &header->worldSize, 8);
|
||||
counter += 8;
|
||||
objects.push_back(header);
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_Sky:
|
||||
{
|
||||
loadCgf = false;
|
||||
SkyAttributes* header = new SkyAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
ParseObject(&buffer[counter], &header->skySize, 4);
|
||||
counter += 4;
|
||||
objects.push_back(header);
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_SpawnPoint:
|
||||
{
|
||||
loadCgf = false;
|
||||
ObjectHeader* header = new ObjectHeader;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
}
|
||||
|
||||
default:
|
||||
//Couldn't find specialType
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -68,7 +155,12 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
//Get Light type
|
||||
ParseObject(&buffer[counter+4], &lightType, sizeof(lightType));
|
||||
|
||||
switch(lightType)
|
||||
//We only support PointLight for now.
|
||||
BasicLight* header = new BasicLight;
|
||||
ParseObject(&buffer[counter], header, sizeof(*header));
|
||||
counter += sizeof(*header);
|
||||
objects.push_back(header);
|
||||
/*switch(lightType)
|
||||
{
|
||||
case LightType_PointLight:
|
||||
{
|
||||
|
@ -98,7 +190,7 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
//Undefined LightType.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;*/
|
||||
}
|
||||
default:
|
||||
//Couldn't find typeID. FAIL!!!!!!
|
||||
|
@ -123,21 +215,25 @@ LevelMetaData LevelParser::ParseHeader(std::string filename)
|
|||
char* buffer = (char*)loader.LoadFile(filename.c_str(), bufferSize);
|
||||
|
||||
//Read format version
|
||||
FormatVersion levelFormatVersion;
|
||||
LevelLoaderInternal::FormatVersion levelFormatVersion;
|
||||
ParseObject(&buffer[counter], &levelFormatVersion, sizeof(formatVersion));
|
||||
counter += sizeof(levelFormatVersion);
|
||||
if(this->formatVersion != levelFormatVersion)
|
||||
{
|
||||
//Do something if it's not the same version
|
||||
|
||||
//Returns an empty levelHeader with ObjectType_Unknown.
|
||||
//Because it will not be able to read another version of the level format.
|
||||
return levelHeader;
|
||||
}
|
||||
|
||||
//Find the header in the returned string.
|
||||
while(counter < bufferSize)
|
||||
{
|
||||
ObjectTypeHeader typeID;
|
||||
ObjectType typeID;
|
||||
ParseObject(&buffer[counter], &typeID, sizeof(typeID));
|
||||
|
||||
switch(typeID.typeID)
|
||||
switch(typeID)
|
||||
{
|
||||
case ObjectType_LevelMetaData:
|
||||
ParseLevelMetaData(&buffer[counter], levelHeader, counter);
|
||||
|
@ -148,7 +244,19 @@ LevelMetaData LevelParser::ParseHeader(std::string filename)
|
|||
case ObjectType_Static: case ObjectType_Dynamic:
|
||||
{
|
||||
ObjectHeader header;
|
||||
ParseObject(&buffer[counter], header, counter);
|
||||
ParseObject(&buffer[counter], &header, counter);
|
||||
|
||||
switch(header.specialTypeID)
|
||||
{
|
||||
case ObjectSpecialType_JumpPad:
|
||||
counter += sizeof(16);
|
||||
break;
|
||||
case ObjectSpecialType_Portal:
|
||||
counter += sizeof(12);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -157,6 +265,9 @@ LevelMetaData LevelParser::ParseHeader(std::string filename)
|
|||
LightType lightType;
|
||||
ParseObject(&buffer[counter+4], &lightType, sizeof(lightType));
|
||||
|
||||
//We only support pointlight for now.
|
||||
counter += sizeof(BasicLight);
|
||||
/*
|
||||
switch(lightType)
|
||||
{
|
||||
case LightType_PointLight:
|
||||
|
@ -177,7 +288,7 @@ LevelMetaData LevelParser::ParseHeader(std::string filename)
|
|||
default:
|
||||
//Undefined LightType.
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
default:
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace GameLogic
|
|||
LevelMetaData ParseHeader(std::string filename);
|
||||
|
||||
private:
|
||||
FormatVersion formatVersion;
|
||||
LevelLoaderInternal::FormatVersion formatVersion;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -23,31 +23,45 @@ namespace GameLogic
|
|||
ObjectType_Unknown = -1
|
||||
};
|
||||
|
||||
enum UsePhysics
|
||||
enum ObjectSpecialType
|
||||
{
|
||||
UsePhysics_UseFullPhysics,
|
||||
UsePhysics_IgnoreGravity,
|
||||
UsePhysics_IgnorePhysics,
|
||||
UsePhysics_IgnoreCollision,
|
||||
ObjectSpecialType_None,
|
||||
ObjectSpecialType_Sky,
|
||||
ObjectSpecialType_World, //Always the main celestial body
|
||||
ObjectSpecialType_Building,
|
||||
ObjectSpecialType_Stone,
|
||||
ObjectSpecialType_StandarsBox,
|
||||
ObjectSpecialType_RedExplosiveBox,
|
||||
ObjectSpecialType_SpikeBox,
|
||||
ObjectSpecialType_Spike,
|
||||
ObjectSpecialType_CrystalFormation,
|
||||
ObjectSpecialType_CrystalShard,
|
||||
ObjectSpecialType_JumpPad,
|
||||
ObjectSpecialType_Portal,
|
||||
ObjectSpecialType_SpawnPoint,
|
||||
ObjectSpecialType_Player,
|
||||
|
||||
UsePhysics_Count,
|
||||
UsePhysics_Unknown = -1
|
||||
|
||||
ObjectSpecialType_Count,
|
||||
ObjectSpecialType_Unknown = -1
|
||||
};
|
||||
|
||||
enum CollisionGeometryType
|
||||
{
|
||||
CollisionGeometryType_Box,
|
||||
CollisionGeometryType_Sphere,
|
||||
CollisionGeometryType_Cylinder,
|
||||
|
||||
CollisionGeometryType_Count,
|
||||
CollisionGeometryType_Unknown = -1
|
||||
};
|
||||
|
||||
//Only supports Pointlight right now.
|
||||
enum LightType
|
||||
{
|
||||
LightType_PointLight,
|
||||
LightType_DirectionalLight,
|
||||
LightType_SpotLight,
|
||||
//LightType_DirectionalLight,
|
||||
//LightType_SpotLight,
|
||||
|
||||
LightType_Count,
|
||||
LightType_Unknown = -1
|
||||
|
@ -80,38 +94,84 @@ namespace GameLogic
|
|||
/************************************
|
||||
Structs
|
||||
*************************************/
|
||||
|
||||
struct FormatVersion
|
||||
namespace LevelLoaderInternal
|
||||
{
|
||||
unsigned int formatVersionMajor;
|
||||
unsigned int formatVersionMinor;
|
||||
|
||||
bool operator ==(const FormatVersion& obj)
|
||||
struct FormatVersion
|
||||
{
|
||||
return (this->formatVersionMajor != obj.formatVersionMajor && this->formatVersionMinor != obj.formatVersionMinor);
|
||||
}
|
||||
unsigned int formatVersionMajor;
|
||||
unsigned int formatVersionMinor;
|
||||
|
||||
bool operator !=(const FormatVersion& obj)
|
||||
{
|
||||
return !(*this == obj);
|
||||
}
|
||||
};
|
||||
FormatVersion()
|
||||
: formatVersionMajor(0), formatVersionMinor(0)
|
||||
{}
|
||||
|
||||
FormatVersion(unsigned int major, unsigned int minor)
|
||||
: formatVersionMajor(major), formatVersionMinor(minor)
|
||||
{}
|
||||
|
||||
bool operator ==(const FormatVersion& obj)
|
||||
{
|
||||
return (this->formatVersionMajor == obj.formatVersionMajor && this->formatVersionMinor == obj.formatVersionMinor);
|
||||
}
|
||||
|
||||
bool operator !=(const FormatVersion& obj)
|
||||
{
|
||||
return !(*this == obj);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
struct ObjectTypeHeader
|
||||
{
|
||||
ObjectType typeID;
|
||||
|
||||
//Unless this is here the object destructor wont be called.
|
||||
virtual ~ObjectTypeHeader(){}
|
||||
};
|
||||
|
||||
struct PhysicsObject
|
||||
namespace LevelLoaderInternal
|
||||
{
|
||||
UsePhysics usePhysics;
|
||||
float mass;
|
||||
float inertiaMagnitude[3];
|
||||
float inertiaRotation[3];
|
||||
float frictionCoeffStatic;
|
||||
float frictionCoeffDynamic;
|
||||
CollisionGeometryType geometryType;
|
||||
};
|
||||
const FormatVersion boundingVolumeVersion(2, 0);
|
||||
|
||||
struct BoundingVolumeBase
|
||||
{
|
||||
CollisionGeometryType geoType;
|
||||
float position[3];
|
||||
float rotation[4];
|
||||
float frictionCoeffStatic;
|
||||
float frictionCoeffDynamic;
|
||||
float restitutionCoeff;
|
||||
float mass;
|
||||
};
|
||||
|
||||
struct BoundingVolumeBox : public BoundingVolumeBase
|
||||
{
|
||||
float size[3];
|
||||
};
|
||||
|
||||
struct BoundingVolumeSphere : public BoundingVolumeBase
|
||||
{
|
||||
float radius;
|
||||
};
|
||||
|
||||
struct BoundingVolumeCylinder : public BoundingVolumeBase
|
||||
{
|
||||
float length;
|
||||
float radius;
|
||||
};
|
||||
|
||||
struct BoundingVolume
|
||||
{
|
||||
CollisionGeometryType geoType;
|
||||
union
|
||||
{
|
||||
LevelLoaderInternal::BoundingVolumeBox box;
|
||||
LevelLoaderInternal::BoundingVolumeSphere sphere;
|
||||
LevelLoaderInternal::BoundingVolumeCylinder cylinder;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
struct LevelMetaData : public ObjectTypeHeader
|
||||
{
|
||||
|
@ -123,21 +183,56 @@ namespace GameLogic
|
|||
WorldSize worldSize;
|
||||
std::string overviewPicturePath;
|
||||
std::vector<GameMode> gameModesSupported;
|
||||
|
||||
virtual ~LevelMetaData(){}
|
||||
|
||||
};
|
||||
|
||||
struct ObjectHeader : public ObjectTypeHeader, public PhysicsObject
|
||||
struct ObjectHeader : public ObjectTypeHeader
|
||||
{
|
||||
//Special type id for special objects: portal, jumppad, exploding objects, etc.
|
||||
ObjectSpecialType specialTypeID;
|
||||
//Model,
|
||||
std::string ModelFile;
|
||||
//Position
|
||||
float position[3];
|
||||
//Rotation
|
||||
float rotation[3];
|
||||
float angle;
|
||||
//Rotation Quaternion
|
||||
float rotation[4];
|
||||
//Scale
|
||||
float scale[3];
|
||||
|
||||
::GameLogic::LevelLoaderInternal::BoundingVolume boundingVolume;
|
||||
|
||||
virtual ~ObjectHeader(){}
|
||||
};
|
||||
|
||||
/************************************
|
||||
Special objects
|
||||
*************************************/
|
||||
|
||||
struct JumpPadAttributes : public ObjectHeader
|
||||
{
|
||||
float direction[3];
|
||||
float power;
|
||||
};
|
||||
|
||||
struct PortalAttributes : public ObjectHeader
|
||||
{
|
||||
float destination[3];
|
||||
};
|
||||
|
||||
struct WorldAttributes : public ObjectHeader
|
||||
{
|
||||
float worldSize;
|
||||
float atmoSphereSize;
|
||||
};
|
||||
|
||||
struct SkyAttributes : public ObjectHeader
|
||||
{
|
||||
float skySize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/************************************
|
||||
Lights
|
||||
|
@ -145,12 +240,13 @@ namespace GameLogic
|
|||
|
||||
struct BasicLight : public ObjectTypeHeader
|
||||
{
|
||||
LightType lightType;
|
||||
float ambientColor[3];
|
||||
float diffuseColor[3];
|
||||
float specularColor[3];
|
||||
LightType lightType; //Is not used right now
|
||||
float color[3];
|
||||
float position[3];
|
||||
float raduis;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
/* We only support pointlight right now.
|
||||
struct PointLight : public BasicLight
|
||||
{
|
||||
float position[3];
|
||||
|
@ -166,7 +262,7 @@ namespace GameLogic
|
|||
float direction[3];
|
||||
float range;
|
||||
float attenuation[3];
|
||||
};
|
||||
};*/
|
||||
}
|
||||
|
||||
#endif
|
|
@ -3,10 +3,9 @@
|
|||
//////////////////////////////////
|
||||
|
||||
#include "ParseFunctions.h"
|
||||
#include "../../../../Misc/Packing/Packing.h"
|
||||
#include "Loader.h"
|
||||
#include <string>
|
||||
|
||||
using namespace Oyster::Packing;
|
||||
using namespace GameLogic::LevelFileLoader;
|
||||
using namespace GameLogic;
|
||||
using namespace std;
|
||||
|
@ -15,12 +14,13 @@ namespace GameLogic
|
|||
{
|
||||
namespace LevelFileLoader
|
||||
{
|
||||
//can parse any struct if the struct doesnt contain strings or char[]
|
||||
void ParseObject(char* buffer, void *header, int size)
|
||||
{
|
||||
memcpy(header, buffer, size);
|
||||
}
|
||||
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size)
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size, bool loadCgf)
|
||||
{
|
||||
char tempName[128];
|
||||
unsigned int tempSize = 0;
|
||||
|
@ -29,6 +29,9 @@ namespace GameLogic
|
|||
memcpy(&header.typeID, &buffer[start], 4);
|
||||
start += 4;
|
||||
|
||||
memcpy(&header.specialTypeID, &buffer[start], 4);
|
||||
start += 4;
|
||||
|
||||
memcpy(&tempSize, &buffer[start], 4);
|
||||
start += 4;
|
||||
|
||||
|
@ -36,13 +39,29 @@ namespace GameLogic
|
|||
header.ModelFile.assign(&tempName[0], &tempName[tempSize]);
|
||||
start += tempSize;
|
||||
|
||||
//The reset of the object struct
|
||||
//3 float[3], 1 float
|
||||
memcpy(&header.position, &buffer[start], 40);
|
||||
start += 40;
|
||||
|
||||
//2 float[3], 3 float, 2 uint
|
||||
memcpy(&header.usePhysics, &buffer[start], 44);
|
||||
start += 44;
|
||||
//if loadCgf : Read path for bounding volume
|
||||
if(loadCgf)
|
||||
{
|
||||
ParseBoundingVolume(&buffer[start], header.boundingVolume, start);
|
||||
}
|
||||
|
||||
//else make sure the counter counts the name so we can jump over the string in the buffer.
|
||||
else
|
||||
{
|
||||
memcpy(&tempSize, &buffer[start], 4);
|
||||
start += 4;
|
||||
|
||||
memcpy(&tempName, &buffer[start], tempSize);
|
||||
|
||||
string fileName;
|
||||
fileName.assign(&tempName[0], &tempName[tempSize]);
|
||||
start += tempSize;
|
||||
}
|
||||
|
||||
size += start;
|
||||
}
|
||||
|
@ -107,5 +126,57 @@ namespace GameLogic
|
|||
|
||||
size += start;
|
||||
}
|
||||
|
||||
void ParseBoundingVolume(char* buffer, LevelLoaderInternal::BoundingVolume& volume, int &size)
|
||||
{
|
||||
int start = 0;
|
||||
int tempSize = 0;
|
||||
char tempName[128];
|
||||
|
||||
memcpy(&tempSize, &buffer[start], 4);
|
||||
start += 4;
|
||||
|
||||
memcpy(&tempName, &buffer[start], tempSize);
|
||||
|
||||
string fileName;
|
||||
fileName.assign(&tempName[0], &tempName[tempSize]);
|
||||
start += tempSize;
|
||||
|
||||
size += start;
|
||||
|
||||
//Läs in filen.
|
||||
int fileLength = 0;
|
||||
Loader loader;
|
||||
char* buf = loader.LoadFile("../Content/Worlds/cgf/"+ fileName, fileLength);
|
||||
|
||||
start = 0;
|
||||
LevelLoaderInternal::FormatVersion version;
|
||||
memcpy(&version, &buf[0], sizeof(version));
|
||||
start += 4;
|
||||
|
||||
memcpy(&volume.geoType, &buf[start], sizeof(volume.geoType));
|
||||
start += sizeof(volume.geoType);
|
||||
|
||||
switch(volume.geoType)
|
||||
{
|
||||
case CollisionGeometryType_Box:
|
||||
memcpy(&volume.box, &buf[start], sizeof(volume.box));
|
||||
start += sizeof(volume.box);
|
||||
break;
|
||||
|
||||
case CollisionGeometryType_Sphere:
|
||||
memcpy(&volume.sphere, &buf[start], sizeof(volume.sphere));
|
||||
start += sizeof(volume.sphere);
|
||||
break;
|
||||
|
||||
case CollisionGeometryType_Cylinder:
|
||||
memcpy(&volume.cylinder, &buf[start], sizeof(volume.cylinder));
|
||||
start += sizeof(volume.cylinder);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,10 +17,10 @@ namespace GameLogic
|
|||
Or the current index that is being used to parse the entire file (if it is sent by reference) this means you have to increase size with the appropiate size after you have copied.
|
||||
|
||||
*/
|
||||
|
||||
void ParseObject(char* buffer, void *header, int size);
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size);
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size , bool loadCgf);
|
||||
void ParseLevelMetaData(char* buffer, LevelMetaData &header, int &size);
|
||||
void ParseBoundingVolume(char* buffer, LevelLoaderInternal::BoundingVolume& volume, int &size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ GameClientState::ClientState LobbyState::Update(float deltaTime, InputClass* Key
|
|||
|
||||
return ClientState_Same;
|
||||
}
|
||||
bool LobbyState::Render()
|
||||
bool LobbyState::Render(float dt)
|
||||
{
|
||||
|
||||
Oyster::Graphics::API::SetView(privData->view);
|
||||
|
@ -126,6 +126,7 @@ bool LobbyState::Render()
|
|||
}
|
||||
bool LobbyState::Release()
|
||||
{
|
||||
Oyster::Graphics::API::ClearLights();
|
||||
for (int i = 0; i < privData->modelCount; i++)
|
||||
{
|
||||
privData->object[i]->Release();
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
// chat
|
||||
// kick
|
||||
|
||||
bool Render();
|
||||
bool Render(float dt);
|
||||
bool Release();
|
||||
void Protocol(ProtocolStruct* protocol)override;
|
||||
void PlayerJoinProtocol(PlayerName* name);
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
|
||||
using namespace DanBias::Client;
|
||||
|
||||
//Menu buttons
|
||||
#include "Buttons/ButtonEllipse.h"
|
||||
#include "Buttons/ButtonRectangle.h"
|
||||
#include "../Misc/EventHandler/EventHandler.h"
|
||||
using namespace Oyster::Event;
|
||||
|
||||
struct LoginState::myData
|
||||
{
|
||||
myData(){}
|
||||
|
@ -17,11 +23,76 @@ struct LoginState::myData
|
|||
int modelCount;
|
||||
// UI object
|
||||
// game client*
|
||||
|
||||
//Menu button collection
|
||||
EventButtonCollection collection;
|
||||
bool createGame;
|
||||
int testNumber;
|
||||
}privData;
|
||||
|
||||
|
||||
enum TestEnum
|
||||
{
|
||||
Create,
|
||||
Options,
|
||||
Incr,
|
||||
Decr,
|
||||
Exit,
|
||||
};
|
||||
|
||||
LoginState::LoginState(void)
|
||||
{
|
||||
}
|
||||
|
||||
void LoginState::ButtonCallback(Oyster::Event::ButtonEvent<LoginState*>& e)
|
||||
{
|
||||
TestEnum type = TestEnum((int)e.userData);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case Create:
|
||||
if(e.state == ButtonState_None)
|
||||
{
|
||||
int a = 0;
|
||||
std::cout << "None" << std::endl;
|
||||
}
|
||||
else if(e.state == ButtonState_Hover)
|
||||
{
|
||||
int a = 0;
|
||||
std::cout << "Hover" << std::endl;
|
||||
}
|
||||
else if(e.state == ButtonState_Down)
|
||||
{
|
||||
int a = 0;
|
||||
std::cout << "Down" << std::endl;
|
||||
}
|
||||
else if(e.state == ButtonState_Pressed)
|
||||
{
|
||||
int a = 0;
|
||||
std::cout << "Pressed" << std::endl;
|
||||
}
|
||||
else if(e.state == ButtonState_Released)
|
||||
{
|
||||
//Change to create state or something similar
|
||||
int a = 0;
|
||||
std::cout << "Released" << std::endl;
|
||||
e.owner->privData->createGame = true;
|
||||
}
|
||||
break;
|
||||
case Options:
|
||||
break;
|
||||
case Exit:
|
||||
break;
|
||||
|
||||
case Incr:
|
||||
if(e.state == ButtonState_Released)
|
||||
e.owner->privData->testNumber++;
|
||||
break;
|
||||
case Decr:
|
||||
if(e.state == ButtonState_Released)
|
||||
e.owner->privData->testNumber--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LoginState::~LoginState(void)
|
||||
|
@ -34,15 +105,48 @@ bool LoginState::Init(Oyster::Network::NetworkClient* nwClient)
|
|||
privData = new myData();
|
||||
this->nwClient = nwClient;
|
||||
// load models
|
||||
LoadModels(L"UImodels.txt");
|
||||
//LoadModels(L"UImodels.txt");
|
||||
InitCamera(Oyster::Math::Float3(0,0,5.4f));
|
||||
|
||||
//Create menu buttons
|
||||
EventHandler::Instance().AddCollection(&privData->collection);
|
||||
privData->collection.AddButton(new ButtonEllipse<LoginState*>(L"circle.png", L"Hej", Oyster::Math::Float3(1, 1, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.2f, 0.2f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f), ResizeAspectRatio_Width));
|
||||
privData->collection.AddButton(new ButtonEllipse<LoginState*>(L"circle.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.2f, 0.3f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f), ResizeAspectRatio_Width));
|
||||
privData->collection.AddButton(new ButtonEllipse<LoginState*>(L"circle.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.2f, 0.4f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f), ResizeAspectRatio_Width));
|
||||
privData->collection.AddButton(new ButtonEllipse<LoginState*>(L"circle.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.2f, 0.5f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f), ResizeAspectRatio_Width));
|
||||
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.15f, 0.05f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f)));
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.25f, 0.05f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f)));
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.35f, 0.05f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f)));
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Options, Oyster::Math::Float3(0.45f, 0.05f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f)));
|
||||
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"Create Game", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Create, Oyster::Math::Float3(0.5f, 0.5f, 0.0f), Oyster::Math::Float2(0.3f, 0.3f)));
|
||||
|
||||
//Incr/decr buttons .
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Incr, Oyster::Math::Float3(0.85f, 0.2f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f)));
|
||||
privData->collection.AddButton(new ButtonRectangle<LoginState*>(L"button.png", L"Hej", Oyster::Math::Float3(1, 0, 0), &LoginState::ButtonCallback, this,
|
||||
(void*)Decr, Oyster::Math::Float3(0.55f, 0.2f, 0.0f), Oyster::Math::Float2(0.1f, 0.1f)));
|
||||
|
||||
privData->createGame = false;
|
||||
privData->testNumber = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
bool LoginState::LoadModels(std::wstring file)
|
||||
{
|
||||
Oyster::Graphics::Definitions::Pointlight plight;
|
||||
plight.Pos = Oyster::Math::Float3(0,0,5);
|
||||
plight.Color = Oyster::Math::Float3(1,1,1);
|
||||
plight.Color = Oyster::Math::Float3(1,0,1);
|
||||
plight.Radius = 100;
|
||||
plight.Bright = 1;
|
||||
Oyster::Graphics::API::AddLight(plight);
|
||||
|
@ -90,7 +194,7 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
|
|||
// check data from server
|
||||
|
||||
// create game
|
||||
if( KeyInput->IsKeyPressed(DIK_C))
|
||||
if( KeyInput->IsKeyPressed(DIK_C) || privData->createGame)
|
||||
{
|
||||
DanBias::GameServerAPI::ServerInitDesc desc;
|
||||
|
||||
|
@ -104,6 +208,7 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
|
|||
// failed to connect
|
||||
return ClientState_Same;
|
||||
}
|
||||
privData->collection.SetState(EventCollectionState_Disabled);
|
||||
return ClientState_LobbyCreated;
|
||||
}
|
||||
// join game
|
||||
|
@ -118,13 +223,13 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
|
|||
// failed to connect
|
||||
return ClientState_Same;
|
||||
}
|
||||
privData->collection.SetState(EventCollectionState_Disabled);
|
||||
return ClientState_Lobby;
|
||||
}
|
||||
return ClientState_Same;
|
||||
}
|
||||
bool LoginState::Render()
|
||||
bool LoginState::Render(float dt)
|
||||
{
|
||||
|
||||
Oyster::Graphics::API::SetView(privData->view);
|
||||
Oyster::Graphics::API::SetProjection( privData->proj);
|
||||
|
||||
|
@ -139,11 +244,25 @@ bool LoginState::Render()
|
|||
|
||||
// render lights
|
||||
|
||||
//Render buttons
|
||||
Oyster::Graphics::API::StartGuiRender();
|
||||
EventHandler::Instance().RenderTexture();
|
||||
|
||||
std::wstring number;
|
||||
wchar_t temp[10];
|
||||
_itow_s(privData->testNumber, temp, 10);
|
||||
number = temp;
|
||||
|
||||
Oyster::Graphics::API::StartTextRender();
|
||||
EventHandler::Instance().RenderText();
|
||||
//Oyster::Graphics::API::RenderText(number, Oyster::Math::Float2(0.7f, 0.2f), Oyster::Math::Float2(0.1f, 0.1f*(1008.0f/730.0f)), Oyster::Math::Float3(1.0f, 0.0f, 0.0f));
|
||||
|
||||
Oyster::Graphics::API::EndFrame();
|
||||
return true;
|
||||
}
|
||||
bool LoginState::Release()
|
||||
{
|
||||
Oyster::Graphics::API::ClearLights();
|
||||
for (int i = 0; i < privData->modelCount; i++)
|
||||
{
|
||||
privData->object[i]->Release();
|
||||
|
@ -151,6 +270,8 @@ bool LoginState::Release()
|
|||
privData->object[i] = NULL;
|
||||
}
|
||||
|
||||
EventHandler::Instance().ReleaseCollection(&privData->collection);
|
||||
|
||||
delete privData;
|
||||
privData = NULL;
|
||||
return true;
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include "OysterMath.h"
|
||||
#include "NetworkClient.h"
|
||||
#include <string>
|
||||
#include "../Misc/EventHandler/EventButton.h"
|
||||
|
||||
namespace DanBias
|
||||
{
|
||||
namespace Client
|
||||
|
@ -24,7 +26,9 @@ namespace DanBias
|
|||
bool InitCamera(Oyster::Math::Float3 startPos);
|
||||
ClientState Update(float deltaTime, InputClass* KeyInput);
|
||||
|
||||
bool Render();
|
||||
static void ButtonCallback(Oyster::Event::ButtonEvent<LoginState*>& e);
|
||||
|
||||
bool Render(float dt);
|
||||
bool Release();
|
||||
void Protocol(ProtocolStruct* protocol)override;
|
||||
void PlayerJoinProtocol(PlayerName* name);
|
||||
|
|
|
@ -38,18 +38,14 @@ void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &usage,
|
|||
case WEAPON_FIRE::WEAPON_USE_PRIMARY_PRESS:
|
||||
ForcePush(usage,dt);
|
||||
break;
|
||||
case WEAPON_FIRE::WEAPON_USE_SECONDARY_PRESS:
|
||||
|
||||
if(hasObject)
|
||||
{
|
||||
//ForcePush(usage,dt);//WARNING THIS IS A CRAP TEST TO MAKE SURE YOU CAN SHOOT BOXES
|
||||
break;
|
||||
}
|
||||
case WEAPON_FIRE::WEAPON_USE_SECONDARY_PRESS:
|
||||
ForcePull(usage,dt);
|
||||
break;
|
||||
break;
|
||||
|
||||
case WEAPON_FIRE::WEAPON_USE_UTILLITY_PRESS:
|
||||
ForceZip(usage,dt);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,17 +56,18 @@ void AttatchmentMassDriver::Update(float dt)
|
|||
//update position of heldObject if there is an object being held
|
||||
if(hasObject)
|
||||
{
|
||||
Oyster::Physics::ICustomBody::State state;
|
||||
state = heldObject->GetState();
|
||||
//Oyster::Physics::ICustomBody::State state;
|
||||
//state = heldObject->GetState();
|
||||
Oyster::Math::Float3 ownerPos = owner->GetPosition();
|
||||
Oyster::Physics::ICustomBody::State ownerState = owner->GetRigidBody()->GetState();
|
||||
Oyster::Math::Float3 up = -ownerState.GetOrientation().v[2];
|
||||
up *= -0.3;
|
||||
Oyster::Math::Float3 pos = ownerPos + up + (owner->GetLookDir().GetNormalized()*5);
|
||||
up *= -0.3f;
|
||||
Oyster::Math::Float3 pos = ownerPos + (owner->GetLookDir().GetNormalized()*5);
|
||||
|
||||
state.centerPos = pos;
|
||||
//state.centerPos = pos;
|
||||
heldObject->SetPosition(pos);
|
||||
|
||||
heldObject->SetState(state);
|
||||
//heldObject->SetState(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,28 +83,29 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float
|
|||
if(hasObject)
|
||||
{
|
||||
Oyster::Physics::API::Instance().ReleaseFromLimbo(heldObject);
|
||||
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (700);
|
||||
Oyster::Physics::ICustomBody::State state = heldObject->GetState();
|
||||
//state.ApplyLinearImpulse((Oyster::Math::Float3)pushForce);
|
||||
heldObject->SetState(state);
|
||||
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (400);
|
||||
heldObject->ApplyImpulse((Oyster::Math::Float3)pushForce);
|
||||
|
||||
hasObject = false;
|
||||
heldObject = NULL;
|
||||
return;
|
||||
}
|
||||
Oyster::Math::Float3 up = owner->GetOrientation().v[1];
|
||||
Oyster::Math::Float3 look = owner->GetLookDir();
|
||||
Oyster::Math::Float3 pos = owner->GetPosition();
|
||||
|
||||
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (20000 * dt);
|
||||
Oyster::Math::Float4x4 aim = Oyster::Math3D::ViewMatrix_LookAtDirection(look, up, pos);
|
||||
Oyster::Math::Float radius = 4;
|
||||
Oyster::Math::Float3 look = owner->GetLookDir().GetNormalized();
|
||||
Oyster::Math::Float lenght = 10;
|
||||
Oyster::Math::Float3 pos = owner->GetRigidBody()->GetState().centerPos;
|
||||
|
||||
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (400);
|
||||
|
||||
Oyster::Collision3D::Cone *hitCone = new Oyster::Collision3D::Cone(lenght,pos,(Oyster::Math::Float4)owner->GetRigidBody()->GetState().quaternion,radius);
|
||||
|
||||
|
||||
|
||||
Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/8,1,1,50);
|
||||
Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace));
|
||||
forcePushData args;
|
||||
args.pushForce = pushForce;
|
||||
|
||||
Oyster::Physics::API::Instance().ApplyEffect(hitFrustum,&args,ForcePushAction);
|
||||
Oyster::Physics::API::Instance().ApplyEffect(hitCone,&args,ForcePushAction);
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
|
@ -115,12 +113,9 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float
|
|||
********************************************************/
|
||||
void AttatchmentMassDriver::ForceZip(const WEAPON_FIRE &usage, float dt)
|
||||
{
|
||||
Oyster::Physics::Struct::CustomBodyState state = this->owner->GetRigidBody()->GetState();
|
||||
Oyster::Math::Float3 force = Oyster::Math::Float4(this->owner->GetLookDir()) * (1000);
|
||||
|
||||
//do something with state
|
||||
//state.ApplyLinearImpulse(Oyster::Math::Float3(this->owner->GetLookDir()) * (500 * dt));
|
||||
|
||||
this->owner->GetRigidBody()->SetState(state);
|
||||
this->owner->GetRigidBody()->ApplyImpulse(force);
|
||||
}
|
||||
|
||||
|
||||
|
@ -134,27 +129,26 @@ void AttatchmentMassDriver::ForcePull(const WEAPON_FIRE &usage, float dt)
|
|||
|
||||
|
||||
//if no object has been picked up then suck objects towards you
|
||||
Oyster::Math::Float4 pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (100 * dt);
|
||||
Oyster::Math::Float4x4 aim = Oyster::Math3D::ViewMatrix_LookAtDirection(owner->GetLookDir(), owner->GetRigidBody()->GetState().GetOrientation().v[2].xyz, owner->GetPosition());
|
||||
Oyster::Math::Float radius = 4;
|
||||
Oyster::Math::Float3 look = owner->GetLookDir().GetNormalized();
|
||||
Oyster::Math::Float lenght = 10;
|
||||
Oyster::Math::Float3 pos = owner->GetRigidBody()->GetState().centerPos;
|
||||
|
||||
Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/4,1,1,20);
|
||||
Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace));
|
||||
Oyster::Math::Float4 pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (100);
|
||||
|
||||
Oyster::Collision3D::Cone *hitCone = new Oyster::Collision3D::Cone(lenght,pos,(Oyster::Math::Float4)owner->GetRigidBody()->GetState().quaternion,radius);
|
||||
forcePushData args;
|
||||
args.pushForce = -pushForce;
|
||||
|
||||
Oyster::Physics::API::Instance().ApplyEffect(hitFrustum,&args,ForcePushAction);
|
||||
Oyster::Physics::API::Instance().ApplyEffect(hitCone,&args,ForcePushAction);
|
||||
}
|
||||
|
||||
void AttatchmentMassDriver::PickUpObject(const WEAPON_FIRE &usage, float dt)
|
||||
{
|
||||
Oyster::Math::Float3 pos = owner->GetPosition() + owner->GetLookDir().GetNormalized()*5;
|
||||
Oyster::Collision3D::Sphere hitSphere = Oyster::Collision3D::Sphere(pos,20);
|
||||
/*Oyster::Math::Float4x4 aim = Oyster::Math3D::ViewMatrix_LookAtDirection(owner->GetLookDir(), owner->GetRigidBody()->GetGravityNormal(), owner->GetPosition());
|
||||
|
||||
Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/4,1,1,20);
|
||||
Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace));
|
||||
*/
|
||||
|
||||
Oyster::Collision3D::Sphere *hitSphere = new Oyster::Collision3D::Sphere(pos,10);
|
||||
|
||||
Oyster::Physics::API::Instance().ApplyEffect(hitSphere,this,AttemptPickUp);
|
||||
|
||||
delete hitSphere;
|
||||
}
|
||||
|
|
|
@ -7,13 +7,17 @@
|
|||
#include "Game.h"
|
||||
#include "CollisionManager.h"
|
||||
#include "JumpPad.h"
|
||||
#include "Portal.h"
|
||||
#include "ExplosiveCrate.h"
|
||||
|
||||
using namespace Oyster;
|
||||
|
||||
using namespace GameLogic;
|
||||
|
||||
void PlayerVObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
void PlayerVLethalObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss, Oyster::Math::Float ExtraDamage);
|
||||
void SendObjectFlying(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 force);
|
||||
void Teleport(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 target);
|
||||
|
||||
//Physics::ICustomBody::SubscriptMessage
|
||||
void Player::PlayerCollision(Oyster::Physics::ICustomBody *rigidBodyPlayer, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
|
@ -24,20 +28,26 @@ using namespace GameLogic;
|
|||
|
||||
switch (realObj->GetObjectType())
|
||||
{
|
||||
case OBJECT_TYPE::OBJECT_TYPE_GENERIC:
|
||||
case ObjectSpecialType::ObjectSpecialType_Generic:
|
||||
PlayerVObject(*player,*realObj, kineticEnergyLoss);
|
||||
//return Physics::ICustomBody::SubscriptMessage_none;
|
||||
break;
|
||||
|
||||
case OBJECT_TYPE::OBJECT_TYPE_BOX:
|
||||
case ObjectSpecialType::ObjectSpecialType_StandardBox:
|
||||
PlayerVObject(*player,*realObj, kineticEnergyLoss);
|
||||
//return Physics::ICustomBody::SubscriptMessage_none;
|
||||
break;
|
||||
case OBJECT_TYPE::OBJECT_TYPE_PLAYER:
|
||||
case ObjectSpecialType::ObjectSpecialType_Player:
|
||||
//return Physics::ICustomBody::SubscriptMessage_none;
|
||||
break;
|
||||
case OBJECT_TYPE::OBJECT_TYPE_WORLD:
|
||||
case ObjectSpecialType::ObjectSpecialType_World:
|
||||
PlayerVObject(*player,*realObj, kineticEnergyLoss);
|
||||
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
|
||||
break;
|
||||
|
||||
case ObjectSpecialType::ObjectSpecialType_CrystalFormation:
|
||||
PlayerVLethalObject(*player,*realObj, kineticEnergyLoss,realObj->getExtraDamageOnCollision());
|
||||
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -51,27 +61,75 @@ using namespace GameLogic;
|
|||
|
||||
switch (realObj->GetObjectType())
|
||||
{
|
||||
case OBJECT_TYPE::OBJECT_TYPE_GENERIC:
|
||||
case ObjectSpecialType::ObjectSpecialType_Generic:
|
||||
break;
|
||||
case OBJECT_TYPE::OBJECT_TYPE_BOX:
|
||||
break;
|
||||
case OBJECT_TYPE::OBJECT_TYPE_PLAYER:
|
||||
case ObjectSpecialType::ObjectSpecialType_StandardBox:
|
||||
SendObjectFlying(*obj, jumpPad->pushForce);
|
||||
break;
|
||||
case OBJECT_TYPE::OBJECT_TYPE_WORLD:
|
||||
case ObjectSpecialType::ObjectSpecialType_Player:
|
||||
SendObjectFlying(*obj, jumpPad->pushForce);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SendObjectFlying(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 force)
|
||||
{
|
||||
Oyster::Physics::ICustomBody::State state;
|
||||
|
||||
state = obj.GetState();
|
||||
//state.ApplyLinearImpulse(force);
|
||||
obj.SetState(state);
|
||||
obj.ApplyImpulse(force);
|
||||
}
|
||||
|
||||
void Portal::PortalActivated(Oyster::Physics::ICustomBody *rigidBodyPortal, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
Portal *portal = (Portal*)(rigidBodyPortal->GetCustomTag());
|
||||
|
||||
if(obj->GetState().mass == 0) return;
|
||||
|
||||
Teleport(*obj,portal->portalExit);
|
||||
}
|
||||
|
||||
void Teleport(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 target)
|
||||
{
|
||||
obj.SetPosition(target);
|
||||
}
|
||||
|
||||
void ExplosiveCrate::ExplosiveCrateCollision(Oyster::Physics::ICustomBody *rigidBodyCrate, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
int forceThreashHold = 200000; //how much force for the box to explode of the impact
|
||||
|
||||
|
||||
if(kineticEnergyLoss > forceThreashHold)
|
||||
{
|
||||
ExplosiveCrate* crate = ((ExplosiveCrate*)rigidBodyCrate->GetCustomTag());
|
||||
|
||||
|
||||
Oyster::Math::Float3 pos = rigidBodyCrate->GetState().centerPos;
|
||||
Oyster::Collision3D::Sphere *hitSphere = new Oyster::Collision3D::Sphere(pos,crate->ExplosionRadius);
|
||||
|
||||
Oyster::Physics::API::Instance().ApplyEffect(hitSphere,crate,Explode);
|
||||
|
||||
delete hitSphere;
|
||||
}
|
||||
}
|
||||
|
||||
void ExplosiveCrate::Explode(Oyster::Physics::ICustomBody *obj, void* args)
|
||||
{
|
||||
Object *realObj = (Object*)obj->GetCustomTag();
|
||||
ExplosiveCrate* ExplosionSource = ((ExplosiveCrate*)args);
|
||||
|
||||
Oyster::Math::Float3 explosionCenterPos = ExplosionSource->GetPosition();
|
||||
Oyster::Math::Float3 hitObjectPos = obj->GetState().centerPos;
|
||||
Oyster::Math::Float3 force = (((hitObjectPos- explosionCenterPos).GetNormalized()) * ExplosionSource->pushForceMagnitude);
|
||||
|
||||
if(realObj->GetObjectType() == ObjectSpecialType::ObjectSpecialType_Player)
|
||||
{
|
||||
Player *hitPlayer = (Player*)realObj;
|
||||
|
||||
hitPlayer->DamageLife(ExplosionSource->getExtraDamageOnCollision());
|
||||
//do shredding damage
|
||||
}
|
||||
|
||||
realObj->GetRigidBody()->ApplyImpulse(force);
|
||||
|
||||
}
|
||||
|
||||
void PlayerVObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
|
@ -88,28 +146,29 @@ using namespace GameLogic;
|
|||
}
|
||||
|
||||
}
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Object::DefaultCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj)
|
||||
|
||||
|
||||
void PlayerVLethalObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss, Oyster::Math::Float ExtraDamage)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_none;
|
||||
int damageDone = 0;
|
||||
int forceThreashHold = 200000;
|
||||
|
||||
if(kineticEnergyLoss > forceThreashHold) //should only take damage if the force is high enough
|
||||
{
|
||||
damageDone = (int)(kineticEnergyLoss * 0.10f);
|
||||
damageDone += ExtraDamage;
|
||||
//player.DamageLife(damageDone);
|
||||
}
|
||||
}
|
||||
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Object::DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_none;
|
||||
}
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Player::PlayerCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_player_collision_response;
|
||||
}
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Player::PlayerCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_none;
|
||||
}
|
||||
//Oyster::Physics::ICustomBody::SubscriptMessage
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Level::LevelCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_ignore_collision_response;
|
||||
}
|
||||
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage CollisionManager::IgnoreCollision(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody *obj)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_ignore_collision_response;
|
||||
|
@ -123,19 +182,20 @@ using namespace GameLogic;
|
|||
|
||||
void AttatchmentMassDriver::ForcePushAction(Oyster::Physics::ICustomBody *obj, void *args)
|
||||
{
|
||||
Oyster::Physics::ICustomBody::State state;
|
||||
if(obj->GetState().mass == 0) return;
|
||||
|
||||
Object *realObj = (Object*)obj->GetCustomTag();
|
||||
|
||||
if(realObj->GetObjectType() == OBJECT_TYPE_PLAYER || realObj->GetObjectType() == OBJECT_TYPE_WORLD)
|
||||
if(realObj->GetObjectType() == ObjectSpecialType::ObjectSpecialType_Player || realObj->GetObjectType() == ObjectSpecialType::ObjectSpecialType_World)
|
||||
return;
|
||||
|
||||
state = obj->GetState();
|
||||
//state.ApplyLinearImpulse(((forcePushData*)(args))->pushForce);
|
||||
obj->SetState(state);
|
||||
obj->ApplyImpulse(((forcePushData*)(args))->pushForce);
|
||||
}
|
||||
|
||||
void AttatchmentMassDriver::AttemptPickUp(Oyster::Physics::ICustomBody *obj, void* args)
|
||||
{
|
||||
if(obj->GetState().mass == 0) return;
|
||||
|
||||
AttatchmentMassDriver *weapon = ((AttatchmentMassDriver*)args);
|
||||
|
||||
if(weapon->hasObject)
|
||||
|
@ -149,9 +209,7 @@ using namespace GameLogic;
|
|||
|
||||
switch(realObj->GetObjectType())
|
||||
{
|
||||
case OBJECT_TYPE::OBJECT_TYPE_BOX:
|
||||
//move obj to limbo in physics to make sure it wont collide with anything
|
||||
Oyster::Physics::API::Instance().MoveToLimbo(obj);
|
||||
case ObjectSpecialType::ObjectSpecialType_StandardBox:
|
||||
weapon->heldObject = obj; //weapon now holds the object
|
||||
weapon->hasObject = true;
|
||||
|
||||
|
|
|
@ -9,33 +9,29 @@ DynamicObject::DynamicObject()
|
|||
{
|
||||
|
||||
}
|
||||
DynamicObject::DynamicObject(OBJECT_TYPE type)
|
||||
:Object(type)
|
||||
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
:Object(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
|
||||
}
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type)
|
||||
:Object(rigidBody,type)
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
:Object(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DynamicObject::DynamicObject(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
:Object(collisionFuncBefore,collisionFuncAfter,type)
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision)
|
||||
:Object(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
|
||||
}
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
:Object(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
{
|
||||
|
||||
}
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type)
|
||||
:Object(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
{
|
||||
|
||||
this->extraDamageOnCollision = extraDamageOnCollision;
|
||||
}
|
||||
|
||||
DynamicObject::DynamicObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision)
|
||||
:Object(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
this->extraDamageOnCollision = extraDamageOnCollision;
|
||||
}
|
||||
DynamicObject::~DynamicObject(void)
|
||||
{
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ namespace GameLogic
|
|||
|
||||
public:
|
||||
DynamicObject();
|
||||
DynamicObject(OBJECT_TYPE type);
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type);
|
||||
DynamicObject(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type);
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision);
|
||||
DynamicObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision);
|
||||
|
||||
~DynamicObject(void);
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#include "ExplosiveCrate.h"
|
||||
|
||||
using namespace GameLogic;
|
||||
|
||||
ExplosiveCrate::ExplosiveCrate(void)
|
||||
:DynamicObject()
|
||||
{
|
||||
this->pushForceMagnitude = 0;
|
||||
this->ExplosionRadius = 0;
|
||||
}
|
||||
|
||||
ExplosiveCrate::ExplosiveCrate(Oyster::Physics::ICustomBody *rigidBody,ObjectSpecialType type, int objectID,Oyster::Math::Float extraDamageOnCollision, Oyster::Math::Float pushForceMagnitude, Oyster::Math::Float ExplosionRadius)
|
||||
:DynamicObject(rigidBody,ExplosiveCrate::ExplosiveCrateCollision, type, objectID)
|
||||
{
|
||||
this->extraDamageOnCollision = extraDamageOnCollision;
|
||||
this->pushForceMagnitude = pushForceMagnitude;
|
||||
this->ExplosionRadius = ExplosionRadius;
|
||||
}
|
||||
|
||||
ExplosiveCrate::~ExplosiveCrate(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef EXPLOSIVECRATE_H
|
||||
#define EXPLOSIVECRATE_H
|
||||
#include "DynamicObject.h"
|
||||
namespace GameLogic
|
||||
{
|
||||
class ExplosiveCrate : public DynamicObject
|
||||
{
|
||||
public:
|
||||
ExplosiveCrate(void);
|
||||
|
||||
ExplosiveCrate(Oyster::Physics::ICustomBody *rigidBody,ObjectSpecialType type,int objectID,Oyster::Math::Float extraDamageOnCollision, Oyster::Math::Float pushForceMagnitude, Oyster::Math::Float ExplosionRadius);
|
||||
|
||||
~ExplosiveCrate(void);
|
||||
|
||||
static void ExplosiveCrateCollision(Oyster::Physics::ICustomBody *rigidBodyCrate, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
static void Explode(Oyster::Physics::ICustomBody *obj, void* args);
|
||||
|
||||
private:
|
||||
Oyster::Math::Float pushForceMagnitude;
|
||||
Oyster::Math::Float ExplosionRadius;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
#endif
|
|
@ -81,8 +81,9 @@ Game::LevelData* Game::CreateLevel()
|
|||
if(this->level) return this->level;
|
||||
|
||||
this->level = new LevelData();
|
||||
this->level->level->InitiateLevel(1000);
|
||||
//this->level->level->InitiateLevel("3bana.bias");
|
||||
//this->level->level->InitiateLevel(1000);
|
||||
this->level->level->InitiateLevel("../Content/Worlds/ccc.bias");
|
||||
|
||||
|
||||
return this->level;
|
||||
}
|
||||
|
|
|
@ -40,8 +40,10 @@ namespace GameLogic
|
|||
Oyster::Math::Float3 GetScale() override;
|
||||
Oyster::Math::Float4x4 GetOrientation() override;
|
||||
int GetID() const override;
|
||||
OBJECT_TYPE GetObjectType() const override;
|
||||
void Rotate(const Oyster::Math3D::Float4 lookDir) override;
|
||||
void Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right) override;
|
||||
ObjectSpecialType GetObjectType() const override;
|
||||
|
||||
|
||||
|
||||
Player *player;
|
||||
};
|
||||
|
@ -56,7 +58,7 @@ namespace GameLogic
|
|||
Oyster::Math::Float3 GetScale() override;
|
||||
Oyster::Math::Float4x4 GetOrientation() override;
|
||||
int GetID() const override;
|
||||
OBJECT_TYPE GetObjectType() const override;
|
||||
ObjectSpecialType GetObjectType() const override;
|
||||
int getNrOfDynamicObj()const override;
|
||||
IObjectData* GetObjectAt(int ID) const override;
|
||||
Level *level;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "GameLogicDef.h"
|
||||
#include "GameLogicStates.h"
|
||||
#include <OysterMath.h>
|
||||
#include "LevelLoader\ObjectDefines.h"
|
||||
|
||||
|
||||
namespace GameLogic
|
||||
|
@ -66,7 +67,7 @@ namespace GameLogic
|
|||
/** Get the type of the object
|
||||
* @return The OBJECT_TYPE of the object is returned
|
||||
*/
|
||||
virtual OBJECT_TYPE GetObjectType() const = 0;
|
||||
virtual ObjectSpecialType GetObjectType() const = 0;
|
||||
};
|
||||
|
||||
class IPlayerData :public IObjectData
|
||||
|
@ -83,7 +84,7 @@ namespace GameLogic
|
|||
* @param x: The relative x axis
|
||||
* @param y: The relative y axis
|
||||
**/
|
||||
virtual void Rotate(const Oyster::Math3D::Float4 lookDir) = 0;
|
||||
virtual void Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right) = 0;
|
||||
|
||||
/********************************************************
|
||||
* Uses the chosen players weapon based on input
|
||||
|
|
|
@ -177,6 +177,7 @@
|
|||
<ClInclude Include="AttatchmentSocket.h" />
|
||||
<ClInclude Include="CollisionManager.h" />
|
||||
<ClInclude Include="DynamicObject.h" />
|
||||
<ClInclude Include="ExplosiveCrate.h" />
|
||||
<ClInclude Include="Game.h" />
|
||||
<ClInclude Include="GameAPI.h" />
|
||||
<ClInclude Include="GameLogicDef.h" />
|
||||
|
@ -192,6 +193,7 @@
|
|||
<ClInclude Include="LevelLoader\LevelParser.h" />
|
||||
<ClInclude Include="LevelLoader\ParseFunctions.h" />
|
||||
<ClInclude Include="Player.h" />
|
||||
<ClInclude Include="Portal.h" />
|
||||
<ClInclude Include="StaticObject.h" />
|
||||
<ClInclude Include="Team.h" />
|
||||
<ClInclude Include="TeamManager.h" />
|
||||
|
@ -202,6 +204,7 @@
|
|||
<ClCompile Include="AttatchmentSocket.cpp" />
|
||||
<ClCompile Include="CollisionManager.cpp" />
|
||||
<ClCompile Include="DynamicObject.cpp" />
|
||||
<ClCompile Include="ExplosiveCrate.cpp" />
|
||||
<ClCompile Include="Game.cpp" />
|
||||
<ClCompile Include="GameModeType.cpp" />
|
||||
<ClCompile Include="Game_LevelData.cpp" />
|
||||
|
@ -215,6 +218,7 @@
|
|||
<ClCompile Include="Object.cpp" />
|
||||
<ClCompile Include="LevelLoader\ParseFunctions.cpp" />
|
||||
<ClCompile Include="Player.cpp" />
|
||||
<ClCompile Include="Portal.cpp" />
|
||||
<ClCompile Include="StaticObject.cpp" />
|
||||
<ClCompile Include="Team.cpp" />
|
||||
<ClCompile Include="TeamManager.cpp" />
|
||||
|
|
|
@ -21,15 +21,6 @@ namespace GameLogic
|
|||
PLAYER_STATE_INVALID = 8,
|
||||
};
|
||||
|
||||
enum OBJECT_TYPE
|
||||
{
|
||||
OBJECT_TYPE_PLAYER = 0,
|
||||
OBJECT_TYPE_BOX = 1,
|
||||
OBJECT_TYPE_WORLD = 2,
|
||||
OBJECT_TYPE_GENERIC = 4,
|
||||
OBJECT_TYPE_UNKNOWN = -1,
|
||||
};
|
||||
|
||||
enum WEAPON_FIRE
|
||||
{
|
||||
WEAPON_USE_PRIMARY_PRESS = 0,
|
||||
|
|
|
@ -38,7 +38,7 @@ int Game::LevelData::GetID() const
|
|||
{
|
||||
return ((IObjectData*)this->level)->GetID();
|
||||
}
|
||||
OBJECT_TYPE Game::LevelData::GetObjectType() const
|
||||
ObjectSpecialType Game::LevelData::GetObjectType() const
|
||||
{
|
||||
return ((IObjectData*)this->level)->GetObjectType();
|
||||
//return OBJECT_TYPE_UNKNOWN;
|
||||
|
|
|
@ -6,30 +6,30 @@ using namespace GameLogic;
|
|||
Game::PlayerData::PlayerData()
|
||||
{
|
||||
//set some stats that are appropriate to a player
|
||||
Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(0,628,-25);
|
||||
Oyster::Math::Float3 size = Oyster::Math::Float3(0.25f,1.0f,0.5f);
|
||||
|
||||
Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(50,130,0);
|
||||
|
||||
Oyster::Math::Float3 size = Oyster::Math::Float3(0.25f,2.0f,0.5f);
|
||||
Oyster::Math::Float mass = 60;
|
||||
Oyster::Math::Float restitutionCoeff = 0.5;
|
||||
Oyster::Math::Float frictionCoeff_Static = 0.4;
|
||||
Oyster::Math::Float frictionCoeff_Dynamic = 0.3;
|
||||
Oyster::Math::Float restitutionCoeff = 0.5f;
|
||||
Oyster::Math::Float frictionCoeff_Static = 0.4f;
|
||||
Oyster::Math::Float frictionCoeff_Dynamic = 0.3f;
|
||||
//sbDesc.quaternion = Oyster::Math::Float3(0, Oyster::Math::pi, 0);
|
||||
|
||||
//create rigid body
|
||||
Oyster::Physics::ICustomBody* rigidBody = Oyster::Physics::API::Instance().AddCollisionBox(size, Oyster::Math::Float4(0, 0, 0, 1), centerPosition, mass, 0.5f, 0.8f, 0.6f );
|
||||
|
||||
Oyster::Physics::ICustomBody* rigidBody = Oyster::Physics::API::Instance().AddCharacter(2.0f, 0.5f, Oyster::Math::Float4(0, 0, 0, 1), centerPosition, mass, 0.5f, 0.8f, 0.6f );
|
||||
rigidBody->SetAngularFactor(0.0f);
|
||||
//create player with this rigid body
|
||||
this->player = new Player(rigidBody,Level::LevelCollisionBefore, Player::PlayerCollision, OBJECT_TYPE::OBJECT_TYPE_PLAYER);
|
||||
this->player->GetRigidBody()->SetCustomTag(this);
|
||||
this->player = new Player(rigidBody, Player::PlayerCollision, ObjectSpecialType_Player,0,0);
|
||||
|
||||
//Oyster::Physics::ICustomBody::State state;
|
||||
//this->player->GetRigidBody()->GetState(state);
|
||||
////state.SetRotation(Oyster::Math::Float3(0, Oyster::Math::pi, 0));
|
||||
//this->player->GetRigidBody()->SetState(state);
|
||||
this->player->GetRigidBody()->SetCustomTag(this);
|
||||
player->EndFrame();
|
||||
}
|
||||
Game::PlayerData::PlayerData(int playerID,int teamID)
|
||||
{
|
||||
Oyster::Physics::ICustomBody* rigidBody;
|
||||
this->player = new Player();
|
||||
|
||||
}
|
||||
Game::PlayerData::~PlayerData()
|
||||
{
|
||||
|
@ -73,11 +73,11 @@ int Game::PlayerData::GetTeamID() const
|
|||
return this->player->GetTeamID();
|
||||
}
|
||||
|
||||
OBJECT_TYPE Game::PlayerData::GetObjectType() const
|
||||
ObjectSpecialType Game::PlayerData::GetObjectType() const
|
||||
{
|
||||
return this->player->GetObjectType();
|
||||
}
|
||||
void Game::PlayerData::Rotate(const Oyster::Math3D::Float4 lookDir)
|
||||
void Game::PlayerData::Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right)
|
||||
{
|
||||
this->player->Rotate(lookDir);
|
||||
this->player->Rotate(lookDir, right);
|
||||
}
|
|
@ -8,10 +8,10 @@ JumpPad::JumpPad(void)
|
|||
{
|
||||
}
|
||||
|
||||
JumpPad::JumpPad(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type, Oyster::Math::Float3 pushForce)
|
||||
:StaticObject(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
JumpPad::JumpPad(Oyster::Physics::ICustomBody *rigidBody, ObjectSpecialType type,int objectID ,Oyster::Math::Float3 pushForce)
|
||||
:StaticObject(rigidBody, JumpPad::JumpPadActivated, type, objectID)
|
||||
{
|
||||
|
||||
this->pushForce = pushForce;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,9 +9,8 @@ namespace GameLogic
|
|||
JumpPad(void);
|
||||
|
||||
JumpPad(Oyster::Physics::ICustomBody *rigidBody
|
||||
,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter)
|
||||
,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss)
|
||||
,OBJECT_TYPE type, Oyster::Math::Float3 pushForce);
|
||||
,ObjectSpecialType type, int objectID,Oyster::Math::Float3 pushForce);
|
||||
|
||||
|
||||
~JumpPad(void);
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#include "Level.h"
|
||||
#include "CollisionManager.h"
|
||||
#include "Game.h"
|
||||
|
||||
#include "JumpPad.h"
|
||||
#include "ExplosiveCrate.h"
|
||||
#include "Portal.h"
|
||||
using namespace GameLogic;
|
||||
using namespace Utility::DynamicMemory;
|
||||
using namespace Oyster::Physics;
|
||||
|
@ -9,50 +11,203 @@ using namespace Oyster::Physics;
|
|||
|
||||
Level::Level(void)
|
||||
{
|
||||
|
||||
objID = 100;
|
||||
}
|
||||
Level::~Level(void)
|
||||
{
|
||||
delete this->levelObj;
|
||||
this->levelObj = NULL;
|
||||
}
|
||||
void Level::parseObjectType(ObjectTypeHeader* obj)
|
||||
Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
||||
{
|
||||
/*switch (obj->objectTypeID)
|
||||
{
|
||||
case skySphere:
|
||||
// save the skysphere to be able to rotate it
|
||||
break;
|
||||
case jumppad:
|
||||
// save direction
|
||||
break;
|
||||
case portal:
|
||||
// save portal destination
|
||||
break;
|
||||
case world:
|
||||
// add gravitation well here
|
||||
// add outer limit of the world
|
||||
case spawn:
|
||||
// save spawnpoint pos
|
||||
break;
|
||||
Object* gameObj = NULL;
|
||||
|
||||
default:
|
||||
switch ((ObjectSpecialType)obj->specialTypeID)
|
||||
{
|
||||
case ObjectSpecialType_None:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
case ObjectSpecialType_Sky:
|
||||
{
|
||||
float skySize = ((SkyAttributes*)obj)->skySize;
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_World:
|
||||
{
|
||||
API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0));
|
||||
API::Instance().SetGravity(200); // could balance gravitation with the world size
|
||||
|
||||
float worldSize = ((WorldAttributes*)obj)->worldSize;
|
||||
float atmosphereSize = ((WorldAttributes*)obj)->atmoSphereSize;
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Building:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
case ObjectSpecialType_Stone:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_StandardBox:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_RedExplosiveBox:
|
||||
{
|
||||
int dmg = 50;
|
||||
Oyster::Math::Float force = 50;
|
||||
int radie = 50;
|
||||
gameObj = new ExplosiveCrate(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++, dmg, force, radie);
|
||||
}
|
||||
break;
|
||||
//case ObjectSpecialType_BlueExplosiveBox:
|
||||
// int dmg = 70;
|
||||
// gameObj = new ExplosiveBox(rigidBody, ObjectSpecialType_BlueExplosiveBox);
|
||||
// break;
|
||||
case ObjectSpecialType_SpikeBox:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Spike:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_CrystalFormation:
|
||||
{
|
||||
int dmg = 50;
|
||||
//gameObj = new Crystal(rigidBody);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_CrystalShard:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_JumpPad:
|
||||
{
|
||||
float power = ((JumpPadAttributes*)obj)->power;
|
||||
Oyster::Math::Float3 dir = ((JumpPadAttributes*)obj)->direction;
|
||||
Oyster::Math::Float3 pushForce = dir * power;
|
||||
gameObj = new JumpPad(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++ , pushForce);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Portal:
|
||||
{
|
||||
Oyster::Math::Float3 destination = ((PortalAttributes*)obj)->destination;
|
||||
gameObj = new Portal(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++, destination);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_SpawnPoint:
|
||||
{
|
||||
// save
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Player:
|
||||
{
|
||||
// should not be read from the lvl format
|
||||
//gameObj = new Player(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Generic:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return gameObj;
|
||||
}
|
||||
void Level::parsePhysicsObj(LevelLoaderInternal::BoundingVolumeBase* obj)
|
||||
|
||||
ICustomBody* Level::InitRigidBodyCube( const ObjectHeader* obj)
|
||||
{
|
||||
// offset physObj med modelObj
|
||||
ICustomBody* rigidBody = NULL;
|
||||
Oyster::Math::Float3 rigidWorldPos;
|
||||
Oyster::Math::Float4 rigidWorldRotation;
|
||||
float rigidBodyMass;
|
||||
Oyster::Math::Float3 rigidBodySize;
|
||||
|
||||
//offset the rigidPosition from modelspace to worldspace;
|
||||
rigidWorldPos = (Oyster::Math::Float3)obj->position + (Oyster::Math::Float3)obj->boundingVolume.box.position;
|
||||
|
||||
//scales the position so the collision geomentry is in the right place
|
||||
rigidWorldPos = rigidWorldPos * obj->scale;
|
||||
|
||||
//offset the rigidRotation from modelspace to worldspace;
|
||||
Oyster::Math::Quaternion worldPosQuaternion = Oyster::Math::Quaternion(Oyster::Math::Float3(obj->rotation[0],obj->rotation[1],obj->rotation[2]), obj->rotation[3]);
|
||||
Oyster::Math::Quaternion physicsPosQuaternion = Oyster::Math::Quaternion(Oyster::Math::Float3(obj->boundingVolume.sphere.rotation[0],obj->boundingVolume.sphere.rotation[1],obj->boundingVolume.sphere.rotation[2]), obj->boundingVolume.sphere.rotation[3]);
|
||||
Oyster::Math::Quaternion rigidWorldQuaternion = worldPosQuaternion * physicsPosQuaternion;
|
||||
|
||||
rigidWorldRotation = Oyster::Math::Float4(rigidWorldQuaternion);
|
||||
|
||||
//mass scaled
|
||||
rigidBodyMass = obj->scale[0] * obj->scale[1] * obj->scale[2] * obj->boundingVolume.box.mass;
|
||||
|
||||
//size scaled
|
||||
rigidBodySize = (Oyster::Math::Float3)obj->boundingVolume.box.size * (Oyster::Math::Float3)obj->scale;
|
||||
|
||||
//create the rigid body
|
||||
rigidBody = API::Instance().AddCollisionBox(rigidBodySize , rigidWorldRotation , rigidWorldPos , rigidBodyMass, obj->boundingVolume.box.restitutionCoeff , obj->boundingVolume.box.frictionCoeffStatic , obj->boundingVolume.box.frictionCoeffDynamic);
|
||||
return rigidBody;
|
||||
}
|
||||
ICustomBody* Level::InitRigidBodySphere( const ObjectHeader* obj)
|
||||
{
|
||||
ICustomBody* rigidBody = NULL;
|
||||
Oyster::Math::Float3 rigidWorldPos;
|
||||
Oyster::Math::Float4 rigidWorldRotation;
|
||||
float rigidBodyMass;
|
||||
float rigidBodyRadius;
|
||||
|
||||
//offset the rigidPosition from modelspace to worldspace;
|
||||
rigidWorldPos = (Oyster::Math::Float3)obj->position + (Oyster::Math::Float3)obj->boundingVolume.sphere.position;
|
||||
//scales the position so the collision geomentry is in the right place
|
||||
rigidWorldPos = rigidWorldPos * obj->scale;
|
||||
|
||||
//offset the rigidRotation from modelspace to worldspace;
|
||||
Oyster::Math::Quaternion worldPosQuaternion = Oyster::Math::Quaternion(Oyster::Math::Float3(obj->rotation[0],obj->rotation[1],obj->rotation[2]), obj->rotation[3]);
|
||||
Oyster::Math::Quaternion physicsPosQuaternion = Oyster::Math::Quaternion(Oyster::Math::Float3(obj->boundingVolume.sphere.rotation[0],obj->boundingVolume.sphere.rotation[1],obj->boundingVolume.sphere.rotation[2]), obj->boundingVolume.sphere.rotation[3]);
|
||||
Oyster::Math::Quaternion rigidWorldQuaternion = worldPosQuaternion * physicsPosQuaternion;
|
||||
|
||||
rigidWorldRotation = Oyster::Math::Float4(rigidWorldQuaternion);
|
||||
|
||||
|
||||
//mass scaled
|
||||
rigidBodyMass = obj->scale[0] * obj->scale[1] * obj->scale[2] * obj->boundingVolume.sphere.mass;
|
||||
|
||||
//Radius scaled
|
||||
//rigidBodyRadius = (staticObjData->scale[0] + staticObjData->scale[1] + staticObjData->scale[2] / 3) * staticObjData->boundingVolume.sphere.radius;
|
||||
rigidBodyRadius = (obj->scale[0] * obj->scale[1] * obj->scale[2]) * obj->boundingVolume.sphere.radius;
|
||||
|
||||
//create the rigid body
|
||||
rigidBody = API::Instance().AddCollisionSphere( rigidBodyRadius , rigidWorldRotation , rigidWorldPos , rigidBodyMass, obj->boundingVolume.sphere.restitutionCoeff , obj->boundingVolume.sphere.frictionCoeffStatic , obj->boundingVolume.sphere.frictionCoeffDynamic);
|
||||
return rigidBody;
|
||||
}
|
||||
void Level::InitiateLevel(std::string levelPath)
|
||||
{
|
||||
LevelLoader ll;
|
||||
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> objects;
|
||||
objects = ll.LoadLevel(levelPath);
|
||||
|
||||
API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0));
|
||||
API::Instance().SetGravity(200);
|
||||
int objCount = objects.size();
|
||||
int modelCount = 0;
|
||||
int staticObjCount = 0;
|
||||
int dynamicObjCount = 0;
|
||||
int modelCount = 100;
|
||||
|
||||
for (int i = 0; i < objCount; i++)
|
||||
{
|
||||
ObjectTypeHeader* obj = objects.at(i);
|
||||
|
@ -70,36 +225,82 @@ void Level::InitiateLevel(std::string levelPath)
|
|||
{
|
||||
|
||||
ObjectHeader* staticObjData = ((ObjectHeader*)obj);
|
||||
//LevelLoaderInternal::BoundingVolumeBase* staticObjPhysicData = ((ObjectHeader*)obj);
|
||||
staticObjData->ModelFile;
|
||||
|
||||
ICustomBody* rigidBody_Static;
|
||||
ICustomBody* rigidBody_Static = NULL;
|
||||
|
||||
// collision shape
|
||||
// radius, rotation in world, position in world, mass, restitution, static and dynamic friction
|
||||
ICustomBody* rigidBody = API::Instance().AddCollisionSphere(599.2f, Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 0, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
if(staticObjData->boundingVolume.geoType == CollisionGeometryType_Sphere)
|
||||
{
|
||||
rigidBody_Static = InitRigidBodySphere(staticObjData);
|
||||
}
|
||||
|
||||
// add rigidbody to the logical obj
|
||||
// Object::DefaultCollisionBefore, Object::DefaultCollisionAfter for now, gamelogic will take care of this
|
||||
// set object_type to objID
|
||||
this->staticObjects.Push(new StaticObject(rigidBody,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
else if(staticObjData->boundingVolume.geoType == CollisionGeometryType_Box)
|
||||
{
|
||||
|
||||
rigidBody_Static = InitRigidBodyCube(staticObjData);
|
||||
}
|
||||
|
||||
else if(staticObjData->boundingVolume.geoType == CollisionGeometryType_Cylinder)
|
||||
{
|
||||
//rigidBody_Static = InitRigidBodyCylinder(staticObjData);
|
||||
}
|
||||
|
||||
if(rigidBody_Static != NULL)
|
||||
{
|
||||
|
||||
// create game object
|
||||
Object* staticGameObj = createGameObj(staticObjData, rigidBody_Static);
|
||||
//Object* staticGameObj = new StaticObject(rigidBody_Static, Object::DefaultCollisionAfter, (ObjectSpecialType)staticObjData->specialTypeID);
|
||||
if(staticGameObj != NULL)
|
||||
{
|
||||
this->staticObjects.Push((StaticObject*)staticGameObj);
|
||||
//this->staticObjects[this->staticObjects.Size()-1]->objectID = modelCount++;
|
||||
//rigidBody_Static->SetCustomTag(this->staticObjects[this->staticObjects.Size()-1]);
|
||||
}
|
||||
|
||||
//this->staticObjects.Push(new StaticObject(rigidBody_Static, Object::DefaultCollisionAfter, (ObjectSpecialType)staticObjData->specialTypeID, 0));
|
||||
//this->staticObjects[staticObjCount]->objectID = modelCount++;
|
||||
|
||||
}
|
||||
|
||||
this->staticObjects[staticObjCount]->objectID = modelCount++;
|
||||
rigidBody->SetCustomTag(this->staticObjects[staticObjCount]);
|
||||
}
|
||||
break;
|
||||
case ObjectType::ObjectType_Dynamic:
|
||||
{
|
||||
ObjectHeader* staticObjData = ((ObjectHeader*)obj);
|
||||
staticObjData->ModelFile;
|
||||
ObjectHeader* dynamicObjData = ((ObjectHeader*)obj);
|
||||
dynamicObjData->ModelFile;
|
||||
|
||||
ICustomBody* rigidBody_Dynamic;
|
||||
ICustomBody* rigidBody_Dynamic = NULL;
|
||||
|
||||
rigidBody_Dynamic = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 605 + i*5, 10), 5, 0.5f, 0.8f, 0.6f);
|
||||
// collision shape
|
||||
if(dynamicObjData->boundingVolume.geoType == CollisionGeometryType_Sphere)
|
||||
{
|
||||
rigidBody_Dynamic = InitRigidBodySphere(dynamicObjData);
|
||||
}
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_Dynamic,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
this->dynamicObjects[dynamicObjCount]->objectID = modelCount++;
|
||||
rigidBody_Dynamic->SetCustomTag(this->dynamicObjects[dynamicObjCount]);
|
||||
else if(dynamicObjData->boundingVolume.geoType == CollisionGeometryType_Box)
|
||||
{
|
||||
rigidBody_Dynamic = InitRigidBodyCube(dynamicObjData);
|
||||
}
|
||||
|
||||
else if(dynamicObjData->boundingVolume.geoType == CollisionGeometryType_Cylinder)
|
||||
{
|
||||
//rigidBody_Dynamic = InitRigidBodyCylinder(dynamicObjData);
|
||||
}
|
||||
|
||||
if(rigidBody_Dynamic != NULL)
|
||||
{
|
||||
// create game object
|
||||
Object* dynamicGameObj = createGameObj(dynamicObjData, rigidBody_Dynamic);
|
||||
//Object* dynamicGameObj =new DynamicObject(rigidBody_Dynamic, Object::DefaultCollisionAfter, (ObjectSpecialType)dynamicObjData->specialTypeID);
|
||||
if (dynamicGameObj != NULL)
|
||||
{
|
||||
this->dynamicObjects.Push((DynamicObject*)dynamicGameObj);
|
||||
//this->dynamicObjects[this->dynamicObjects.Size()-1]->objectID = modelCount++;
|
||||
//rigidBody_Dynamic->SetCustomTag(this->dynamicObjects[this->dynamicObjects.Size()-1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ObjectType::ObjectType_Light:
|
||||
|
@ -112,14 +313,18 @@ void Level::InitiateLevel(std::string levelPath)
|
|||
}
|
||||
void Level::InitiateLevel(float radius)
|
||||
{
|
||||
API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0));
|
||||
API::Instance().SetGravity(200);
|
||||
int idCount = 100;
|
||||
// add level sphere
|
||||
ICustomBody* rigidBody = API::Instance().AddCollisionSphere(599.2f, Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 0, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
levelObj = new StaticObject(rigidBody, LevelCollisionBefore, LevelCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_WORLD);
|
||||
this->levelObj->objectID = idCount++;
|
||||
|
||||
levelObj = new StaticObject(rigidBody, LevelCollisionAfter, ObjectSpecialType_World, idCount++);
|
||||
|
||||
//this->levelObj->objectID = idCount++;
|
||||
rigidBody->SetCustomTag(levelObj);
|
||||
|
||||
/*
|
||||
|
||||
ICustomBody* rigidBody_TestBox;
|
||||
|
||||
int nrOfBoxex = 5;
|
||||
|
@ -128,12 +333,12 @@ void Level::InitiateLevel(float radius)
|
|||
{
|
||||
rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 605 + i*5, 10), 5, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
this->dynamicObjects[i]->objectID = idCount++;
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox, Object::DefaultCollisionAfter, ObjectSpecialType_StandardBox, idCount++));
|
||||
|
||||
//this->dynamicObjects[i]->objectID = idCount++;
|
||||
rigidBody_TestBox->SetCustomTag(this->dynamicObjects[i]);
|
||||
}
|
||||
|
||||
offset += nrOfBoxex;
|
||||
/*offset += nrOfBoxex;
|
||||
for(int i =0; i< nrOfBoxex; i ++)
|
||||
{
|
||||
rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0,5, -605 -( i*5)), 5);
|
||||
|
@ -158,19 +363,33 @@ void Level::InitiateLevel(float radius)
|
|||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
rigidBody_TestBox->SetCustomTag(this->dynamicObjects[i]);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// add crystal
|
||||
ICustomBody* rigidBody_Crystal = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(10, 605, 0), 5, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
ICustomBody* rigidBody_Crystal = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(10, 605, 0), 5);
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_Crystal,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_Crystal, Object::DefaultCollisionAfter, ObjectSpecialType_StandardBox, idCount++));
|
||||
rigidBody_Crystal->SetCustomTag(this->dynamicObjects[nrOfBoxex]);
|
||||
//this->dynamicObjects[nrOfBoxex]->objectID = idCount++;
|
||||
|
||||
|
||||
|
||||
// add house
|
||||
ICustomBody* rigidBody_House =API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(10, 905, 0), 0);
|
||||
this->staticObjects.Push(new StaticObject(rigidBody_House,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_GENERIC));
|
||||
ICustomBody* rigidBody_House =API::Instance().AddCollisionBox(Oyster::Math::Float3(20, 20, 20), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(-50, 590, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultCollisionAfter, ObjectSpecialType_Generic, idCount++));
|
||||
rigidBody_House->SetCustomTag(this->staticObjects[0]);
|
||||
*/
|
||||
//this->staticObjects[0]->objectID = idCount++;
|
||||
|
||||
// add jumppad
|
||||
ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(1, 1, 1), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(4, 600.3, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, ObjectSpecialType_JumpPad,idCount++ ,Oyster::Math::Float3(0,2000,0)));
|
||||
rigidBody_Jumppad->SetCustomTag(this->staticObjects[1]);
|
||||
//this->staticObjects[1]->objectID = idCount++;
|
||||
}
|
||||
|
||||
void Level::AddPlayerToTeam(Player *player, int teamID)
|
||||
|
@ -194,7 +413,7 @@ int Level::getNrOfDynamicObj()
|
|||
}
|
||||
Object* Level::GetObj( int ID) const
|
||||
{
|
||||
for (int i = 0; i< this->dynamicObjects.Size(); i++)
|
||||
for (int i = 0; i < this->dynamicObjects.Size(); i++)
|
||||
{
|
||||
if(this->dynamicObjects[i]->GetID() == ID)
|
||||
return this->dynamicObjects[i];
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "StaticObject.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "GameModeType.h"
|
||||
|
||||
#include "Player.h"
|
||||
#include "PhysicsAPI.h"
|
||||
#include "TeamManager.h"
|
||||
|
@ -31,9 +32,10 @@ namespace GameLogic
|
|||
********************************************************/
|
||||
void InitiateLevel(std::string levelPath);
|
||||
void InitiateLevel(float radius);
|
||||
Oyster::Physics::ICustomBody* InitRigidBodyCube( const ObjectHeader* obj);
|
||||
Oyster::Physics::ICustomBody* InitRigidBodySphere( const ObjectHeader* obj);
|
||||
|
||||
void parseObjectType(ObjectTypeHeader* obj);
|
||||
void parsePhysicsObj(LevelLoaderInternal::BoundingVolumeBase* obj);
|
||||
Object* createGameObj(ObjectHeader* obj, Oyster::Physics::ICustomBody* rigidBody);
|
||||
/********************************************************
|
||||
* Creates a team in the level
|
||||
* @param teamSize: The size of the team you want to create
|
||||
|
@ -60,7 +62,6 @@ namespace GameLogic
|
|||
* @param rigidBodyLevel: physics object of the level
|
||||
* @param obj: physics object for the object that collided with the level
|
||||
********************************************************/
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage LevelCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj);
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage LevelCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
int getNrOfDynamicObj();
|
||||
|
@ -75,6 +76,7 @@ namespace GameLogic
|
|||
GameModeType gameMode;
|
||||
Utility::DynamicMemory::SmartPointer<Oyster::Physics::ICustomBody> rigidBodyLevel;
|
||||
StaticObject *levelObj;
|
||||
int objID;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
{
|
||||
int bufferSize = 0;
|
||||
int counter = 0;
|
||||
bool loadCgf;
|
||||
|
||||
std::vector<SmartPointer<ObjectTypeHeader>> objects;
|
||||
|
||||
|
@ -38,14 +39,13 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
counter += sizeof(levelFormatVersion);
|
||||
if(this->formatVersion != levelFormatVersion)
|
||||
{
|
||||
//Do something if it's not the same version
|
||||
|
||||
//Returns an empty vector, because it will most likely fail to read the level format.
|
||||
return objects;
|
||||
}
|
||||
|
||||
while(counter < bufferSize)
|
||||
{
|
||||
loadCgf = true;
|
||||
//Get typeID
|
||||
ObjectType typeID;
|
||||
ParseObject(&buffer[counter], &typeID, sizeof(typeID));
|
||||
|
@ -69,45 +69,43 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
|
||||
switch(specialType)
|
||||
{
|
||||
//These three does not have any specail variables at this time.
|
||||
//There for they are using the same 'parser'.
|
||||
//there is no difference when parsing these specialTypes.
|
||||
case ObjectSpecialType_CrystalShard:
|
||||
case ObjectSpecialType_CrystalFormation:
|
||||
case ObjectSpecialType_Spike:
|
||||
case ObjectSpecialType_SpikeBox:
|
||||
case ObjectSpecialType_RedExplosiveBox:
|
||||
case ObjectSpecialType_StandardBox:
|
||||
case ObjectSpecialType_Stone:
|
||||
case ObjectSpecialType_Building:
|
||||
case ObjectSpecialType_Damaging:
|
||||
case ObjectSpecialType_Explosive:
|
||||
{
|
||||
ObjectHeader* header = new ObjectHeader;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_JumpPad:
|
||||
{
|
||||
JumpPadAttributes* header = new JumpPadAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
//Read the spec
|
||||
ParseObject(&buffer[counter], header->direction, 16);
|
||||
counter += 16;
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
}
|
||||
case ObjectSpecialType_BoostPad:
|
||||
{
|
||||
JumpPadAttributes* header = new JumpPadAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
|
||||
ParseObject(&buffer[counter], header->direction, 16);
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
}
|
||||
case ObjectSpecialType_Portal:
|
||||
{
|
||||
PortalAttributes* header = new PortalAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
ParseObject(&buffer[counter], header->destination, 12);
|
||||
counter += 12;
|
||||
objects.push_back(header);
|
||||
|
||||
break;
|
||||
|
@ -116,22 +114,33 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
|
|||
case ObjectSpecialType_World:
|
||||
{
|
||||
WorldAttributes* header = new WorldAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
ParseObject(&buffer[counter], &header->worldSize, 8);
|
||||
counter += 8;
|
||||
objects.push_back(header);
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_Sky:
|
||||
{
|
||||
loadCgf = false;
|
||||
SkyAttributes* header = new SkyAttributes;
|
||||
ParseObject(&buffer[counter], *header, counter);
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
|
||||
ParseObject(&buffer[counter], &header->skySize, 4);
|
||||
counter += 4;
|
||||
objects.push_back(header);
|
||||
break;
|
||||
}
|
||||
|
||||
case ObjectSpecialType_SpawnPoint:
|
||||
{
|
||||
loadCgf = false;
|
||||
ObjectHeader* header = new ObjectHeader;
|
||||
ParseObject(&buffer[counter], *header, counter, loadCgf);
|
||||
}
|
||||
|
||||
default:
|
||||
//Couldn't find specialType
|
||||
break;
|
||||
|
@ -235,16 +244,13 @@ LevelMetaData LevelParser::ParseHeader(std::string filename)
|
|||
case ObjectType_Static: case ObjectType_Dynamic:
|
||||
{
|
||||
ObjectHeader header;
|
||||
ParseObject(&buffer[counter], header, counter);
|
||||
ParseObject(&buffer[counter], &header, counter);
|
||||
|
||||
switch(header.specialTypeID)
|
||||
{
|
||||
case ObjectSpecialType_JumpPad:
|
||||
counter += sizeof(16);
|
||||
break;
|
||||
case ObjectSpecialType_BoostPad:
|
||||
counter += sizeof(16);
|
||||
break;
|
||||
case ObjectSpecialType_Portal:
|
||||
counter += sizeof(12);
|
||||
break;
|
||||
|
|
|
@ -25,30 +25,28 @@ namespace GameLogic
|
|||
|
||||
enum ObjectSpecialType
|
||||
{
|
||||
ObjectSpecialType_None,
|
||||
ObjectSpecialType_Sky,
|
||||
ObjectSpecialType_World, //Always the main celestial body
|
||||
ObjectSpecialType_Building,
|
||||
ObjectSpecialType_Damaging,
|
||||
ObjectSpecialType_Explosive,
|
||||
ObjectSpecialType_Stone,
|
||||
ObjectSpecialType_StandardBox,
|
||||
ObjectSpecialType_RedExplosiveBox,
|
||||
ObjectSpecialType_SpikeBox,
|
||||
ObjectSpecialType_Spike,
|
||||
ObjectSpecialType_CrystalFormation,
|
||||
ObjectSpecialType_CrystalShard,
|
||||
ObjectSpecialType_JumpPad,
|
||||
ObjectSpecialType_BoostPad,
|
||||
ObjectSpecialType_Portal,
|
||||
ObjectSpecialType_Sky,
|
||||
ObjectSpecialType_SpawnPoint,
|
||||
ObjectSpecialType_Player,
|
||||
ObjectSpecialType_Generic,
|
||||
|
||||
|
||||
ObjectSpecialType_Count,
|
||||
ObjectSpecialType_Unknown = -1
|
||||
};
|
||||
|
||||
enum UsePhysics
|
||||
{
|
||||
UsePhysics_UseFullPhysics,
|
||||
UsePhysics_IgnoreGravity,
|
||||
UsePhysics_IgnorePhysics,
|
||||
UsePhysics_IgnoreCollision,
|
||||
|
||||
UsePhysics_Count,
|
||||
UsePhysics_Unknown = -1
|
||||
};
|
||||
|
||||
enum CollisionGeometryType
|
||||
{
|
||||
CollisionGeometryType_Box,
|
||||
|
|
|
@ -16,13 +16,13 @@ namespace GameLogic
|
|||
{
|
||||
namespace LevelFileLoader
|
||||
{
|
||||
//can parse any struct without strings or char[]
|
||||
//can parse any struct if the struct doesnt contain strings or char[]
|
||||
void ParseObject(char* buffer, void *header, int size)
|
||||
{
|
||||
memcpy(header, buffer, size);
|
||||
}
|
||||
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size)
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size, bool loadCgf)
|
||||
{
|
||||
char tempName[128];
|
||||
unsigned int tempSize = 0;
|
||||
|
@ -46,8 +46,24 @@ namespace GameLogic
|
|||
memcpy(&header.position, &buffer[start], 40);
|
||||
start += 40;
|
||||
|
||||
//Read path for bounding volume
|
||||
ParseBoundingVolume(&buffer[start], header.boundingVolume, start);
|
||||
//if loadCgf : Read path for bounding volume
|
||||
if(loadCgf)
|
||||
{
|
||||
ParseBoundingVolume(&buffer[start], header.boundingVolume, start);
|
||||
}
|
||||
|
||||
//else make sure the counter counts the name so we can jump over the string in the buffer.
|
||||
else
|
||||
{
|
||||
memcpy(&tempSize, &buffer[start], 4);
|
||||
start += 4;
|
||||
|
||||
memcpy(&tempName, &buffer[start], tempSize);
|
||||
|
||||
string fileName;
|
||||
fileName.assign(&tempName[0], &tempName[tempSize]);
|
||||
start += tempSize;
|
||||
}
|
||||
|
||||
size += start;
|
||||
}
|
||||
|
@ -133,15 +149,14 @@ namespace GameLogic
|
|||
//Läs in filen.
|
||||
int fileLength = 0;
|
||||
Loader loader;
|
||||
char* buf = loader.LoadFile("E:\\Dropbox\\Programming\\Github\\Danbias\\Bin\\Content\\Worlds\\cgf\\"+ fileName, fileLength);
|
||||
char* buf = loader.LoadFile("../Content/Worlds/cgf/"+ fileName, fileLength);
|
||||
|
||||
start = 0;
|
||||
LevelLoaderInternal::FormatVersion version;
|
||||
memcpy(&version, &buf[0], sizeof(version));
|
||||
start += 4;
|
||||
start += 8;
|
||||
|
||||
memcpy(&volume.geoType, &buf[start], sizeof(volume.geoType));
|
||||
start += sizeof(volume.geoType);
|
||||
|
||||
switch(volume.geoType)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,8 @@ namespace GameLogic
|
|||
Or the current index that is being used to parse the entire file (if it is sent by reference) this means you have to increase size with the appropiate size after you have copied.
|
||||
|
||||
*/
|
||||
|
||||
void ParseObject(char* buffer, void *header, int size);
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size);
|
||||
void ParseObject(char* buffer, ObjectHeader& header, int& size , bool loadCgf);
|
||||
void ParseLevelMetaData(char* buffer, LevelMetaData &header, int &size);
|
||||
void ParseBoundingVolume(char* buffer, LevelLoaderInternal::BoundingVolume& volume, int &size);
|
||||
}
|
||||
|
|
|
@ -18,60 +18,37 @@ Object::Object()
|
|||
|
||||
this->rigidBody = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.0f, 0.0f, 0.0f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 0, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
this->type = OBJECT_TYPE::OBJECT_TYPE_UNKNOWN;
|
||||
this->objectID = GID();
|
||||
this->type = ObjectSpecialType_Unknown;
|
||||
this->objectID = -1;
|
||||
}
|
||||
|
||||
Object::Object(OBJECT_TYPE type)
|
||||
{
|
||||
this->rigidBody = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.0f, 0.0f, 0.0f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 0, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
this->type = type;
|
||||
this->objectID = GID();
|
||||
}
|
||||
|
||||
Object::Object(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type)
|
||||
Object::Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
{
|
||||
this->rigidBody = rigidBody;
|
||||
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)(collisionFuncAfter));
|
||||
this->type = type;
|
||||
this->objectID = GID();
|
||||
this->objectID = objectID;
|
||||
this->extraDamageOnCollision = 0;
|
||||
this->rigidBody->SetCustomTag(this);
|
||||
}
|
||||
|
||||
Object::Object(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
{
|
||||
this->rigidBody = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.0f, 0.0f, 0.0f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 0, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
this->type = type;
|
||||
this->objectID = GID();
|
||||
}
|
||||
|
||||
Object::Object(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
Object::Object(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
{
|
||||
this->rigidBody = rigidBody;
|
||||
|
||||
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)(collisionFuncAfter));
|
||||
this->type = type;
|
||||
this->objectID = GID();
|
||||
this->objectID = objectID;
|
||||
this->extraDamageOnCollision = 0;
|
||||
this->rigidBody->SetCustomTag(this);
|
||||
}
|
||||
|
||||
Object::Object(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type)
|
||||
{
|
||||
this->rigidBody = rigidBody;
|
||||
|
||||
this->type = type;
|
||||
this->objectID = GID();
|
||||
}
|
||||
|
||||
void Object::ApplyLinearImpulse(Oyster::Math::Float3 force)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
Object::~Object(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
OBJECT_TYPE Object::GetObjectType() const
|
||||
ObjectSpecialType Object::GetObjectType() const
|
||||
{
|
||||
return this->type;
|
||||
}
|
||||
|
@ -129,3 +106,9 @@ Oyster::Math::Float4x4 Object::GetOrientation()
|
|||
state = this->rigidBody->GetState();
|
||||
return state.GetOrientation();
|
||||
}
|
||||
|
||||
|
||||
Oyster::Math::Float Object::getExtraDamageOnCollision()
|
||||
{
|
||||
return this->extraDamageOnCollision;
|
||||
}
|
|
@ -18,24 +18,26 @@ namespace GameLogic
|
|||
{
|
||||
public:
|
||||
Object();
|
||||
Object(OBJECT_TYPE type);
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type);
|
||||
Object(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type);
|
||||
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
~Object(void);
|
||||
|
||||
OBJECT_TYPE GetObjectType() const override;
|
||||
int GetID() const override;
|
||||
ObjectSpecialType GetObjectType() const override;
|
||||
int GetID() const override;
|
||||
void setID(int id);
|
||||
Oyster::Math::Float3 GetPosition() override;
|
||||
Oyster::Math::Quaternion GetRotation() override;
|
||||
Oyster::Math::Float3 GetScale() override;
|
||||
Oyster::Math::Float4x4 GetOrientation() override;
|
||||
|
||||
void setID(int id);
|
||||
Oyster::Math::Float getExtraDamageOnCollision();
|
||||
|
||||
// API overrides
|
||||
|
||||
|
||||
|
||||
Oyster::Physics::ICustomBody* GetRigidBody();
|
||||
void ApplyLinearImpulse(Oyster::Math::Float3 force);
|
||||
|
||||
virtual void BeginFrame();
|
||||
virtual void EndFrame();
|
||||
|
@ -43,12 +45,11 @@ namespace GameLogic
|
|||
void setBeforeCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter));
|
||||
void setAfterCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss));
|
||||
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj);
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
public: //HACK: This should be private when level is dynamic
|
||||
OBJECT_TYPE type;
|
||||
int objectID;
|
||||
|
||||
public: //TODO: Hax This should be private when level is dynamic
|
||||
|
||||
|
||||
protected:
|
||||
Oyster::Physics::ICustomBody *rigidBody;
|
||||
|
@ -56,6 +57,11 @@ namespace GameLogic
|
|||
static const Game* gameInstance;
|
||||
Oyster::Math::Float3 currLook;
|
||||
Oyster::Math::Float3 newLook;
|
||||
|
||||
ObjectSpecialType type;
|
||||
int objectID;
|
||||
|
||||
Oyster::Math::Float extraDamageOnCollision;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,47 +6,68 @@
|
|||
|
||||
using namespace GameLogic;
|
||||
using namespace Oyster::Physics;
|
||||
const int MOVE_FORCE = 500;
|
||||
const float MOVE_FORCE = 30;
|
||||
const float KEY_TIMER = 0.03f;
|
||||
Player::Player()
|
||||
:DynamicObject()
|
||||
{
|
||||
|
||||
}
|
||||
Player::Player(OBJECT_TYPE type)
|
||||
:DynamicObject(type)
|
||||
{
|
||||
InitPlayer();
|
||||
}
|
||||
Player::Player(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type)
|
||||
:DynamicObject(rigidBody,type)
|
||||
{
|
||||
InitPlayer();
|
||||
}
|
||||
|
||||
Player::Player(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
:DynamicObject(collisionFuncBefore,collisionFuncAfter,type)
|
||||
{
|
||||
InitPlayer();
|
||||
}
|
||||
Player::Player(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
:DynamicObject(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
{
|
||||
InitPlayer();
|
||||
}
|
||||
Player::Player(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type)
|
||||
:DynamicObject(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
{
|
||||
InitPlayer();
|
||||
}
|
||||
|
||||
void Player::InitPlayer()
|
||||
Player::Player(Oyster::Physics::ICustomBody *rigidBody, void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, int teamID)
|
||||
:DynamicObject(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
weapon = new Weapon(2,this);
|
||||
|
||||
this->life = 100;
|
||||
this->teamID = -1;
|
||||
this->playerState = PLAYER_STATE_IDLE;
|
||||
lookDir = Oyster::Math::Float4(0,0,-1,0);
|
||||
this->lookDir = Oyster::Math::Float3(0,0,-1);
|
||||
this->moveDir = Oyster::Math::Float3(0,0,0);
|
||||
key_forward = 0;
|
||||
key_backward = 0;
|
||||
key_strafeRight = 0;
|
||||
key_strafeLeft = 0;
|
||||
|
||||
this->previousPosition = Oyster::Math::Float3(0,0,0);
|
||||
this->moveDir = Oyster::Math::Float3(0,0,0);
|
||||
this->moveSpeed = 100;
|
||||
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
|
||||
}
|
||||
|
||||
Player::Player(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, int teamID)
|
||||
:DynamicObject(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
this->rigidBody = rigidBody;
|
||||
|
||||
Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(0,400,0);
|
||||
|
||||
Oyster::Math::Float3 size = Oyster::Math::Float3(0.25f,1.0f,0.5f);
|
||||
Oyster::Math::Float mass = 60;
|
||||
Oyster::Math::Float restitutionCoeff = 0.5;
|
||||
Oyster::Math::Float frictionCoeff_Static = 0.4;
|
||||
Oyster::Math::Float frictionCoeff_Dynamic = 0.3;
|
||||
|
||||
|
||||
this->rigidBody = Oyster::Physics::API::Instance().AddCollisionBox(size, Oyster::Math::Float4(0, 0, 0, 1), centerPosition, mass, 0.5f, 0.8f, 0.6f );
|
||||
this->rigidBody->SetAngularFactor(0.0f);
|
||||
|
||||
weapon = new Weapon(2,this);
|
||||
|
||||
this->life = 100;
|
||||
this->teamID = teamID;
|
||||
this->playerState = PLAYER_STATE_IDLE;
|
||||
this->lookDir = Oyster::Math::Float3(0,0,-1);
|
||||
key_forward = 0;
|
||||
key_backward = 0;
|
||||
key_strafeRight = 0;
|
||||
key_strafeLeft = 0;
|
||||
|
||||
this->previousPosition = Oyster::Math::Float3(0,0,0);
|
||||
this->moveDir = Oyster::Math::Float3(0,0,0);
|
||||
this->moveSpeed = 100;
|
||||
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
|
||||
|
||||
}
|
||||
|
||||
Player::~Player(void)
|
||||
|
@ -60,21 +81,82 @@ Player::~Player(void)
|
|||
|
||||
void Player::BeginFrame()
|
||||
{
|
||||
weapon->Update(0.002f);
|
||||
//weapon->Update(0.002f);
|
||||
Object::BeginFrame();
|
||||
|
||||
//Oyster::Math::Float3 previousFall = this->previousMoveSpeed*-this->rigidBody->GetState().centerPos.GetNormalized();
|
||||
//Oyster::Math::Float3 currentFall = this->rigidBody->GetLinearVelocity()*-this->rigidBody->GetState().centerPos.GetNormalized();
|
||||
|
||||
if(this->moveDir != Oyster::Math::Float3::null && this->playerState != PLAYER_STATE_JUMPING)
|
||||
{
|
||||
Oyster::Math::Float3 velocity = this->rigidBody->GetLinearVelocity();
|
||||
Oyster::Math::Float3 lostVelocity = (this->previousMoveSpeed - velocity).GetMagnitude()*this->moveDir;
|
||||
this->rigidBody->SetLinearVelocity(velocity + lostVelocity - this->moveDir*this->moveSpeed );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(this->rigidBody->GetLamda() == 1.0f)
|
||||
{
|
||||
this->playerState = PLAYER_STATE_WALKING;
|
||||
}
|
||||
|
||||
if(this->moveDir != Oyster::Math::Float3::null)
|
||||
{
|
||||
Oyster::Math::Float3 velocity = this->rigidBody->GetLinearVelocity();
|
||||
this->rigidBody->SetLinearVelocity(velocity - this->moveDir*this->moveSpeed );
|
||||
}
|
||||
}
|
||||
|
||||
this->moveDir = Oyster::Math::Float3::null;
|
||||
|
||||
if (key_forward > 0.001)
|
||||
{
|
||||
key_forward -= gameInstance->GetFrameTime(); // fixed timer
|
||||
this->moveDir += this->rigidBody->GetState().GetOrientation().v[2].GetNormalized().xyz;
|
||||
}
|
||||
if (key_backward > 0.001)
|
||||
{
|
||||
key_backward -= gameInstance->GetFrameTime();
|
||||
this->moveDir -= this->rigidBody->GetState().GetOrientation().v[2].GetNormalized().xyz;
|
||||
}
|
||||
if (key_strafeRight > 0.001)
|
||||
{
|
||||
key_strafeRight -= gameInstance->GetFrameTime();
|
||||
Oyster::Math::Float3 forward = this->rigidBody->GetState().GetOrientation().v[2];
|
||||
Oyster::Math::Float3 up = this->rigidBody->GetState().centerPos;
|
||||
this->moveDir -= (up).Cross(forward).GetNormalized();
|
||||
}
|
||||
if (key_strafeLeft > 0.001)
|
||||
{
|
||||
key_strafeLeft -= gameInstance->GetFrameTime();
|
||||
Oyster::Math::Float3 forward = this->rigidBody->GetState().GetOrientation().v[2];
|
||||
Oyster::Math::Float3 up = this->rigidBody->GetState().centerPos;
|
||||
this->moveDir += (up).Cross(forward).GetNormalized();
|
||||
}
|
||||
|
||||
if(this->moveDir != Oyster::Math::Float3::null)
|
||||
{
|
||||
this->moveDir.Normalize();
|
||||
this->rigidBody->SetLinearVelocity(this->moveDir*this->moveSpeed + this->rigidBody->GetLinearVelocity());
|
||||
}
|
||||
|
||||
this->previousMoveSpeed = this->rigidBody->GetLinearVelocity();
|
||||
this->previousPosition = this->rigidBody->GetState().centerPos;
|
||||
|
||||
|
||||
this->weapon->Update(0.01f);
|
||||
}
|
||||
|
||||
void Player::EndFrame()
|
||||
{
|
||||
// snap to axis
|
||||
Oyster::Math::Float4 rotation;
|
||||
|
||||
this->rigidBody->SetUp(this->rigidBody->GetState().centerPos.GetNormalized());
|
||||
|
||||
|
||||
Object::EndFrame();
|
||||
// rotate
|
||||
|
||||
//Oyster::Math::Float3 up = currPhysicsState.GetOrientation().v[1];
|
||||
//Oyster::Math::Float3 deltaAxis = up * (-dx * 0.02) ;
|
||||
|
||||
//currPhysicsState.AddRotation(deltaAxis);
|
||||
|
||||
}
|
||||
|
||||
void Player::Move(const PLAYER_MOVEMENT &movement)
|
||||
|
@ -105,32 +187,19 @@ void Player::Move(const PLAYER_MOVEMENT &movement)
|
|||
|
||||
void Player::MoveForward()
|
||||
{
|
||||
Oyster::Math::Float3 forward = this->rigidBody->GetState().GetOrientation().v[2];
|
||||
//Oyster::Math::Float3 forward = lookDir;
|
||||
rigidBody->SetLinearVelocity( 10 * forward.GetNormalized() );
|
||||
key_forward = KEY_TIMER;
|
||||
}
|
||||
void Player::MoveBackwards()
|
||||
{
|
||||
Oyster::Math::Float3 forward = this->rigidBody->GetState().GetOrientation().v[2];
|
||||
//Oyster::Math::Float3 forward = lookDir;
|
||||
rigidBody->SetLinearVelocity( 10 * -forward.GetNormalized() );
|
||||
key_backward = KEY_TIMER;
|
||||
}
|
||||
void Player::MoveRight()
|
||||
{
|
||||
//Do cross product with forward vector and negative gravity vector
|
||||
Oyster::Math::Float3 forward = this->rigidBody->GetState().GetOrientation().v[2];
|
||||
|
||||
//Oyster::Math::Float3 forward = lookDir;
|
||||
Oyster::Math::Float3 r = (-this->rigidBody->GetState().centerPos.Normalize()).Cross(forward);
|
||||
rigidBody->SetLinearVelocity(r * 10);
|
||||
key_strafeRight = KEY_TIMER;
|
||||
}
|
||||
void Player::MoveLeft()
|
||||
{
|
||||
//Do cross product with forward vector and negative gravity vector
|
||||
Oyster::Math::Float3 forward = this->rigidBody->GetState().GetOrientation().v[2];
|
||||
//Oyster::Math::Float3 forward = lookDir;
|
||||
Oyster::Math::Float3 r = (-this->rigidBody->GetState().centerPos.Normalize()).Cross(forward);
|
||||
rigidBody->SetLinearVelocity(-r * 10);
|
||||
key_strafeLeft = KEY_TIMER;
|
||||
}
|
||||
|
||||
void Player::UseWeapon(const WEAPON_FIRE &usage)
|
||||
|
@ -143,25 +212,26 @@ void Player::Respawn(Oyster::Math::Float3 spawnPoint)
|
|||
this->life = 100;
|
||||
this->playerState = PLAYER_STATE::PLAYER_STATE_IDLE;
|
||||
this->lookDir = Oyster::Math::Float4(1,0,0);
|
||||
//this->newPhysicsState.centerPos = spawnPoint;
|
||||
this->rigidBody->SetPosition(spawnPoint);
|
||||
}
|
||||
|
||||
void Player::Rotate(const Oyster::Math3D::Float4 lookDir)
|
||||
void Player::Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right)
|
||||
{
|
||||
Oyster::Math::Float dx = lookDir.w;
|
||||
if(dx > 0.0f)
|
||||
{
|
||||
int i =0 ;
|
||||
}
|
||||
// this is the camera right vector
|
||||
this->lookDir = lookDir;
|
||||
|
||||
this->lookDir = lookDir.xyz;
|
||||
this->dx = lookDir.w;
|
||||
//Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1];
|
||||
//this->rigidBody->SetUpAndRight(up, right);
|
||||
}
|
||||
|
||||
void Player::Jump()
|
||||
{
|
||||
Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1];
|
||||
//newPhysicsState.ApplyLinearImpulse(up * MOVE_FORCE * this->gameInstance->GetFrameTime());
|
||||
if(this->rigidBody->GetLamda() < 1.0f)
|
||||
{
|
||||
Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1].GetNormalized();
|
||||
this->rigidBody->ApplyImpulse(up *1500);
|
||||
this->playerState = PLAYER_STATE::PLAYER_STATE_JUMPING;
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::IsWalking()
|
||||
|
@ -210,4 +280,3 @@ void Player::DamageLife(int damage)
|
|||
this->gameInstance->onDisableFnc(this, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,13 +16,11 @@ namespace GameLogic
|
|||
{
|
||||
public:
|
||||
Player(void);
|
||||
Player(OBJECT_TYPE type);
|
||||
Player(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type);
|
||||
Player(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
Player(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
Player(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type);
|
||||
|
||||
Player(Oyster::Physics::ICustomBody *rigidBody, void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, int teamID);
|
||||
Player(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, int teamID);
|
||||
|
||||
~Player(void);
|
||||
void InitPlayer();
|
||||
|
||||
/********************************************************
|
||||
* Moves the player based on input
|
||||
|
@ -48,7 +46,7 @@ namespace GameLogic
|
|||
void Respawn(Oyster::Math::Float3 spawnPoint);
|
||||
|
||||
|
||||
void Rotate(const Oyster::Math3D::Float4 lookDir);
|
||||
void Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right);
|
||||
|
||||
/********************************************************
|
||||
* Collision function for player, this is to be sent to physics through the subscribe function with the rigidbody
|
||||
|
@ -73,24 +71,32 @@ namespace GameLogic
|
|||
|
||||
void BeginFrame();
|
||||
void EndFrame();
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage PlayerCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj);
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage PlayerCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
|
||||
private:
|
||||
void Jump();
|
||||
|
||||
private:
|
||||
int life;
|
||||
Oyster::Math::Float life;
|
||||
int teamID;
|
||||
Weapon *weapon;
|
||||
PLAYER_STATE playerState;
|
||||
Oyster::Math::Float3 lookDir; //Duplicate in Object.h?
|
||||
Oyster::Math::Float dx; //dx of what?
|
||||
Oyster::Math::Float3 lookDir;
|
||||
float key_forward;
|
||||
float key_backward;
|
||||
float key_strafeRight;
|
||||
float key_strafeLeft;
|
||||
float key_jump;
|
||||
|
||||
|
||||
Oyster::Math::Float3 previousPosition;
|
||||
Oyster::Math::Float3 moveDir;
|
||||
Oyster::Math::Float moveSpeed;
|
||||
Oyster::Math::Float3 previousMoveSpeed;
|
||||
|
||||
|
||||
bool hasTakenDamage;
|
||||
float invincibleCooldown;
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,23 @@
|
|||
#include "Portal.h"
|
||||
|
||||
using namespace GameLogic;
|
||||
using namespace Oyster::Math;
|
||||
|
||||
Portal::Portal(void)
|
||||
:StaticObject()
|
||||
{
|
||||
this->portalExit = Float3(0,0,0);
|
||||
}
|
||||
|
||||
|
||||
Portal::Portal(Oyster::Physics::ICustomBody *rigidBody, ObjectSpecialType type,int objectID ,Oyster::Math::Float3 portalExit)
|
||||
:StaticObject(rigidBody, Portal::PortalActivated, type, objectID)
|
||||
{
|
||||
this->portalExit = portalExit;
|
||||
}
|
||||
|
||||
Portal::~Portal(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef PORTAL_H
|
||||
#define PORTAL_H
|
||||
#include "StaticObject.h"
|
||||
namespace GameLogic
|
||||
{
|
||||
class Portal : public StaticObject
|
||||
{
|
||||
public:
|
||||
Portal(void);
|
||||
|
||||
Portal(Oyster::Physics::ICustomBody *rigidBody
|
||||
,ObjectSpecialType type,int objectID ,Oyster::Math::Float3 portalExit);
|
||||
|
||||
~Portal(void);
|
||||
|
||||
static void PortalActivated(Oyster::Physics::ICustomBody *rigidBodyPortal, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
private:
|
||||
Oyster::Math::Float3 portalExit;
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -10,34 +10,30 @@ StaticObject::StaticObject()
|
|||
{
|
||||
|
||||
}
|
||||
StaticObject::StaticObject(OBJECT_TYPE type)
|
||||
:Object(type)
|
||||
{
|
||||
|
||||
}
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type)
|
||||
:Object(rigidBody,type)
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
:Object(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
//this->rigidBody->SetGravity(true);
|
||||
//this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_BeforeCollisionResponse)(CollisionManager::IgnoreCollision));
|
||||
//use setMass(when it is made) and set the mass to 0 in order to ensure that the object is static
|
||||
}
|
||||
|
||||
StaticObject::StaticObject(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
:Object(collisionFuncBefore,collisionFuncAfter,type)
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
:Object(rigidBody, EventOnCollision, type, objectID)
|
||||
{
|
||||
|
||||
}
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
|
||||
:Object(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
{
|
||||
|
||||
}
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type)
|
||||
:Object(rigidBody, collisionFuncBefore, collisionFuncAfter, type)
|
||||
{
|
||||
|
||||
//use setMass(when it is made) and set the mass to 0 in order to ensure that the object is static
|
||||
}
|
||||
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision)
|
||||
{
|
||||
this->extraDamageOnCollision = extraDamageOnCollision;
|
||||
//use setMass(when it is made) and set the mass to 0 in order to ensure that the object is static
|
||||
}
|
||||
|
||||
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision)
|
||||
{
|
||||
this->extraDamageOnCollision = extraDamageOnCollision;
|
||||
//use setMass(when it is made) and set the mass to 0 in order to ensure that the object is static
|
||||
}
|
||||
StaticObject::~StaticObject(void)
|
||||
{
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "Object.h"
|
||||
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
|
@ -16,11 +17,12 @@ namespace GameLogic
|
|||
|
||||
public:
|
||||
StaticObject();
|
||||
StaticObject(OBJECT_TYPE type);
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type);
|
||||
StaticObject(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type);
|
||||
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody , void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision);
|
||||
StaticObject(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, Oyster::Math::Float extraDamageOnCollision);
|
||||
|
||||
~StaticObject(void);
|
||||
|
||||
|
|
|
@ -18,17 +18,13 @@ Weapon::Weapon()
|
|||
|
||||
Weapon::Weapon(int MaxNrOfSockets,Player *owner)
|
||||
{
|
||||
if(MaxNrOfSockets > 1) return;
|
||||
|
||||
|
||||
attatchmentSockets.Resize(MaxNrOfSockets);
|
||||
attatchmentSockets[0] = new AttatchmentSocket();
|
||||
|
||||
for (int i = 0; i < MaxNrOfSockets; i++)
|
||||
for(int i = 0; i < MaxNrOfSockets; i++)
|
||||
{
|
||||
this->attatchmentSockets[i] = 0;
|
||||
attatchmentSockets[i] = new AttatchmentSocket();
|
||||
}
|
||||
|
||||
|
||||
weaponState = WEAPON_STATE_IDLE;
|
||||
currentNrOfAttatchments = 0;
|
||||
selectedAttatchment = 0;
|
||||
|
@ -46,8 +42,12 @@ Weapon::~Weapon(void)
|
|||
{
|
||||
for (unsigned int i = 0; i < this->attatchmentSockets.Size(); i++)
|
||||
{
|
||||
delete this->attatchmentSockets[i];
|
||||
this->attatchmentSockets[i] = 0;
|
||||
if(this->attatchmentSockets[i])
|
||||
{
|
||||
delete this->attatchmentSockets[i];
|
||||
this->attatchmentSockets[i] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ namespace GameLogic
|
|||
{
|
||||
short object_ID;
|
||||
float position[3];
|
||||
float rotation[3];
|
||||
float rotation[4];
|
||||
|
||||
Protocol_ObjectPositionRotation()
|
||||
{
|
||||
|
@ -307,10 +307,11 @@ namespace GameLogic
|
|||
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[7].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[8].type = Oyster::Network::NetAttributeType_Float;
|
||||
|
||||
this->object_ID = 0;
|
||||
memset(&this->position[0], 0, sizeof(float) * 3);
|
||||
memset(&this->rotation[0], 0, sizeof(float) * 3);
|
||||
memset(&this->rotation[0], 0, sizeof(float) * 4);
|
||||
}
|
||||
Protocol_ObjectPositionRotation(Oyster::Network::CustomNetProtocol& p)
|
||||
{
|
||||
|
@ -323,8 +324,9 @@ namespace GameLogic
|
|||
this->rotation[0] = p[5].value.netFloat;
|
||||
this->rotation[1] = p[6].value.netFloat;
|
||||
this->rotation[2] = p[7].value.netFloat;
|
||||
this->rotation[3] = p[8].value.netFloat;
|
||||
}
|
||||
Protocol_ObjectPositionRotation(float p[3], float r[3], int id)
|
||||
Protocol_ObjectPositionRotation(float p[3], float r[4], int id)
|
||||
{
|
||||
this->protocol[0].value = protocol_Gameplay_ObjectPositionRotation;
|
||||
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
|
||||
|
@ -337,10 +339,11 @@ namespace GameLogic
|
|||
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[7].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[8].type = Oyster::Network::NetAttributeType_Float;
|
||||
|
||||
object_ID = id;
|
||||
memcpy(&this->position[0], &p[0], sizeof(float) * 3);
|
||||
memcpy(&this->rotation[0], &r[0], sizeof(float) * 3);
|
||||
memcpy(&this->rotation[0], &r[0], sizeof(float) * 4);
|
||||
}
|
||||
Oyster::Network::CustomNetProtocol GetProtocol() override
|
||||
{
|
||||
|
@ -351,6 +354,7 @@ namespace GameLogic
|
|||
this->protocol[5].value = this->rotation[0];
|
||||
this->protocol[6].value = this->rotation[1];
|
||||
this->protocol[7].value = this->rotation[2];
|
||||
this->protocol[8].value = this->rotation[3];
|
||||
return protocol;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,12 +76,37 @@ namespace GameLogic
|
|||
|
||||
struct Protocol_PlayerLook :public Oyster::Network::CustomProtocolObject
|
||||
{
|
||||
float lookDirX;
|
||||
float lookDirY;
|
||||
float lookDirZ;
|
||||
float deltaX;
|
||||
// can be swapped to a quaternion later
|
||||
float lookDir[3];
|
||||
float right[3];
|
||||
|
||||
Protocol_PlayerLook()
|
||||
{
|
||||
this->protocol[0].value = protocol_Gameplay_PlayerLookDir;
|
||||
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
|
||||
// LookDir
|
||||
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
|
||||
// Right
|
||||
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
|
||||
|
||||
memset(&this->lookDir[0], 0, sizeof(float) * 3);
|
||||
memset(&this->right[0], 0, sizeof(float) * 3);
|
||||
}
|
||||
Protocol_PlayerLook(Oyster::Network::CustomNetProtocol& p)
|
||||
{
|
||||
this->lookDir[0] = p[1].value.netFloat;
|
||||
this->lookDir[1] = p[2].value.netFloat;
|
||||
this->lookDir[2] = p[3].value.netFloat;
|
||||
|
||||
this->right[0] = p[4].value.netFloat;
|
||||
this->right[1] = p[5].value.netFloat;
|
||||
this->right[2] = p[6].value.netFloat;
|
||||
}
|
||||
Protocol_PlayerLook(float l[3], float r[3])
|
||||
{
|
||||
this->protocol[0].value = protocol_Gameplay_PlayerLookDir;
|
||||
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
|
||||
|
@ -89,32 +114,23 @@ namespace GameLogic
|
|||
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
|
||||
|
||||
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
|
||||
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
|
||||
|
||||
memcpy(&this->lookDir[0], &l[0], sizeof(float) * 3);
|
||||
memcpy(&this->right[0], &r[0], sizeof(float) * 3);
|
||||
}
|
||||
Protocol_PlayerLook(Oyster::Network::CustomNetProtocol& p)
|
||||
{
|
||||
lookDirX = p[1].value.netFloat;
|
||||
lookDirY = p[2].value.netFloat;
|
||||
lookDirZ = p[3].value.netFloat;
|
||||
deltaX = p[4].value.netFloat;
|
||||
}
|
||||
const Protocol_PlayerLook& operator=(Oyster::Network::CustomNetProtocol& val)
|
||||
{
|
||||
lookDirX = val[1].value.netFloat;
|
||||
lookDirY = val[2].value.netFloat;
|
||||
lookDirZ = val[3].value.netFloat;
|
||||
deltaX = val[4].value.netFloat;
|
||||
|
||||
return *this;
|
||||
}
|
||||
Oyster::Network::CustomNetProtocol GetProtocol() override
|
||||
{
|
||||
this->protocol[1].value = lookDirX;
|
||||
this->protocol[2].value = lookDirY;
|
||||
this->protocol[3].value = lookDirZ;
|
||||
this->protocol[4].value = deltaX;
|
||||
|
||||
this->protocol[1].value = this->lookDir[0];
|
||||
this->protocol[2].value = this->lookDir[1];
|
||||
this->protocol[3].value = this->lookDir[2];
|
||||
this->protocol[4].value = this->right[0];
|
||||
this->protocol[5].value = this->right[1];
|
||||
this->protocol[6].value = this->right[2];
|
||||
|
||||
return protocol;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,6 @@ namespace DanBias
|
|||
Protocol_ObjectPositionRotation p(movedObject->GetPosition(), movedObject->GetRotation(), id);
|
||||
GameSession::gameSession->Send(p.GetProtocol());
|
||||
//}
|
||||
|
||||
}
|
||||
void GameSession::ObjectDisabled( GameLogic::IObjectData* movedObject, float seconds )
|
||||
{
|
||||
|
@ -176,12 +175,10 @@ namespace DanBias
|
|||
}
|
||||
void GameSession::Gameplay_PlayerLookDir ( Protocol_PlayerLook& p, DanBias::GameClient* c )
|
||||
{
|
||||
Oyster::Math3D::Float4 lookDir;
|
||||
lookDir.x = p.lookDirX;
|
||||
lookDir.y = p.lookDirY;
|
||||
lookDir.z = p.lookDirZ;
|
||||
lookDir.w = p.deltaX;
|
||||
c->GetPlayer()->Rotate(lookDir);
|
||||
Oyster::Math3D::Float3 lookDir = p.lookDir;
|
||||
Oyster::Math3D::Float3 right = p.right;
|
||||
|
||||
c->GetPlayer()->Rotate(lookDir, right);
|
||||
}
|
||||
void GameSession::Gameplay_PlayerChangeWeapon ( Protocol_PlayerChangeWeapon& p, DanBias::GameClient* c )
|
||||
{
|
||||
|
|
|
@ -161,8 +161,7 @@ namespace DanBias
|
|||
{
|
||||
if((this->clients[k] && readyList[i]) && readyList[i]->GetClient()->GetID() != this->clients[k]->GetClient()->GetID())
|
||||
{
|
||||
//Protocol_ObjectCreatePlayer
|
||||
Protocol_ObjectCreate p(this->clients[k]->GetPlayer()->GetOrientation(), this->clients[k]->GetPlayer()->GetID(), "char_white.dan"); //The model name will be custom later..
|
||||
Protocol_ObjectCreate p(this->clients[k]->GetPlayer()->GetOrientation(), this->clients[k]->GetPlayer()->GetID(), "char_temporary.dan"); //The model name will be custom later..
|
||||
readyList[i]->GetClient()->Send(p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,6 +112,7 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>
|
||||
</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>$(SolutionDir)Physics/lib/debug/BulletCollision_Debugx64.lib;$(SolutionDir)Physics/lib/debug/BulletDynamics_Debugx64.lib;$(SolutionDir)Physics/lib/debug/LinearMath_Debugx64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
@ -130,6 +131,7 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>
|
||||
</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>$(SolutionDir)Physics/lib/release/BulletCollision.lib;$(SolutionDir)Physics/lib/release/BulletDynamics.lib;$(SolutionDir)Physics/lib/release/LinearMath.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -148,6 +150,7 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>
|
||||
</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>$(SolutionDir)Physics/lib/release/BulletCollisionx64.lib;$(SolutionDir)Physics/lib/release/BulletDynamicsx64.lib;$(SolutionDir)Physics/lib/release/LinearMathx64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
@ -162,22 +165,16 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Implementation\Octree.h" />
|
||||
<ClInclude Include="Implementation\PhysicsAPI_Impl.h" />
|
||||
<ClInclude Include="Implementation\SimpleRigidBody.h" />
|
||||
<ClInclude Include="Implementation\SphericalRigidBody.h" />
|
||||
<ClInclude Include="PhysicsAPI.h" />
|
||||
<ClInclude Include="PhysicsFormula-Impl.h" />
|
||||
<ClInclude Include="PhysicsFormula.h" />
|
||||
<ClInclude Include="PhysicsStructs-Impl.h" />
|
||||
<ClInclude Include="PhysicsStructs.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Implementation\Octree.cpp" />
|
||||
<ClCompile Include="Implementation\DLLMain.cpp" />
|
||||
<ClCompile Include="Implementation\PhysicsAPI_Impl.cpp" />
|
||||
<ClCompile Include="Implementation\SimpleRigidBody.cpp" />
|
||||
<ClCompile Include="Implementation\SphericalRigidBody.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -30,24 +30,12 @@
|
|||
<ClInclude Include="Implementation\SimpleRigidBody.h">
|
||||
<Filter>Header Files\Implementation</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Implementation\SphericalRigidBody.h">
|
||||
<Filter>Header Files\Implementation</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Implementation\Octree.h">
|
||||
<Filter>Header Files\Implementation</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PhysicsStructs.h">
|
||||
<Filter>Header Files\Include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PhysicsStructs-Impl.h">
|
||||
<Filter>Header Files\Include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PhysicsFormula.h">
|
||||
<Filter>Header Files\Include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PhysicsFormula-Impl.h">
|
||||
<Filter>Header Files\Include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Implementation\PhysicsAPI_Impl.cpp">
|
||||
|
@ -59,11 +47,5 @@
|
|||
<ClCompile Include="Implementation\DLLMain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Implementation\SphericalRigidBody.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Implementation\Octree.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,226 +0,0 @@
|
|||
#include "Octree.h"
|
||||
|
||||
using namespace Oyster;
|
||||
using namespace Physics;
|
||||
using namespace ::Utility::DynamicMemory;
|
||||
|
||||
const unsigned int Octree::invalid_ref = ::Utility::Value::numeric_limits<unsigned int>::max();
|
||||
|
||||
Octree::Octree(unsigned int bufferSize, unsigned char numLayers, Math::Float3 worldSize)
|
||||
{
|
||||
this->worldNode.dataPtr = NULL;
|
||||
|
||||
this->worldNode.container.maxVertex = worldSize*0.5f;
|
||||
this->worldNode.container.minVertex = -worldSize*0.5f;
|
||||
}
|
||||
|
||||
Octree::~Octree()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Octree& Octree::operator=(const Octree& orig)
|
||||
{
|
||||
this->leafData = orig.leafData;
|
||||
this->updateQueue = orig.updateQueue;
|
||||
this->worldNode = orig.worldNode;
|
||||
this->mapReferences = orig.mapReferences;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Octree::AddObject(UniquePointer< ICustomBody > customBodyRef)
|
||||
{
|
||||
//customBodyRef->SetScene( this );
|
||||
Data data;
|
||||
//Data* tempPtr = this->worldNode.dataPtr;
|
||||
|
||||
//data.container = customBodyRef->GetBoundingSphere();
|
||||
data.queueRef = -1;
|
||||
data.next = NULL;
|
||||
data.prev = NULL;
|
||||
data.customBodyRef = customBodyRef;
|
||||
data.limbo = false;
|
||||
this->mapReferences.insert(std::pair <ICustomBody*, unsigned int> (data.customBodyRef, this->leafData.size()));
|
||||
this->leafData.push_back(data);
|
||||
|
||||
/*if(tempPtr != NULL)
|
||||
{
|
||||
tempPtr->prev->next = &this->leafData[this->leafData.size() - 1];
|
||||
this->leafData[this->leafData.size() - 1].prev = tempPtr->prev;
|
||||
tempPtr->prev = &this->leafData[this->leafData.size() - 1];
|
||||
this->leafData[this->leafData.size() - 1].next = tempPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->worldNode.dataPtr = &this->leafData[this->leafData.size() - 1];
|
||||
this->worldNode.dataPtr->next = this->worldNode.dataPtr;
|
||||
this->worldNode.dataPtr->prev = this->worldNode.dataPtr;
|
||||
}*/
|
||||
}
|
||||
|
||||
void Octree::MoveToUpdateQueue(UniquePointer< ICustomBody > customBodyRef)
|
||||
{
|
||||
/*this->leafData[this->mapReferences[customBodyRef]].queueRef = this->updateQueue.size();
|
||||
this->updateQueue.push_back(&this->leafData[this->mapReferences[customBodyRef]]);*/
|
||||
}
|
||||
|
||||
void Octree::MoveToLimbo(const ICustomBody* customBodyRef)
|
||||
{
|
||||
auto object = this->mapReferences.find(customBodyRef);
|
||||
|
||||
unsigned int tempRef = object->second;
|
||||
|
||||
this->leafData[tempRef].limbo = true;
|
||||
}
|
||||
|
||||
bool Octree::IsInLimbo(const ICustomBody* customBodyRef)
|
||||
{
|
||||
auto object = this->mapReferences.find(customBodyRef);
|
||||
|
||||
unsigned int tempRef = object->second;
|
||||
|
||||
return this->leafData[tempRef].limbo;
|
||||
}
|
||||
|
||||
void Octree::ReleaseFromLimbo(const ICustomBody* customBodyRef)
|
||||
{
|
||||
auto object = this->mapReferences.find(customBodyRef);
|
||||
|
||||
unsigned int tempRef = object->second;
|
||||
|
||||
this->leafData[tempRef].limbo = false;
|
||||
}
|
||||
|
||||
void Octree::DestroyObject(UniquePointer< ICustomBody > customBodyRef)
|
||||
{
|
||||
std::map<const ICustomBody*, unsigned int>::iterator it = this->mapReferences.find(customBodyRef);
|
||||
|
||||
this->mapReferences.erase(it);
|
||||
|
||||
this->leafData.erase(this->leafData.begin() + this->leafData[this->mapReferences[customBodyRef]].queueRef);
|
||||
}
|
||||
|
||||
std::vector<ICustomBody*>& Octree::Sample(ICustomBody* customBodyRef, std::vector<ICustomBody*>& updateList)
|
||||
{
|
||||
auto object = this->mapReferences.find(customBodyRef);
|
||||
|
||||
if(object == this->mapReferences.end())
|
||||
{
|
||||
return updateList;
|
||||
}
|
||||
|
||||
unsigned int tempRef = object->second;
|
||||
|
||||
for(unsigned int i = 0; i<this->leafData.size(); i++)
|
||||
{
|
||||
if(tempRef != i && !this->leafData[i].limbo) if(this->leafData[tempRef].container.Intersects(this->leafData[i].container))
|
||||
{
|
||||
updateList.push_back(this->leafData[i].customBodyRef);
|
||||
}
|
||||
}
|
||||
|
||||
return updateList;
|
||||
}
|
||||
|
||||
std::vector<ICustomBody*>& Octree::Sample(const Oyster::Collision3D::ICollideable& collideable, std::vector<ICustomBody*>& updateList)
|
||||
{
|
||||
for(unsigned int i = 0; i<this->leafData.size(); i++)
|
||||
{
|
||||
if(!this->leafData[i].limbo && this->leafData[i].container.Intersects(collideable))
|
||||
{
|
||||
updateList.push_back(this->leafData[i].customBodyRef);
|
||||
}
|
||||
}
|
||||
|
||||
return updateList;
|
||||
}
|
||||
|
||||
void Octree::Visit(ICustomBody* customBodyRef, VisitorAction hitAction )
|
||||
{
|
||||
auto object = this->mapReferences.find(customBodyRef);
|
||||
|
||||
// If rigid body is not found
|
||||
if(object == this->mapReferences.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int tempRef = object->second;
|
||||
|
||||
// Go through all object and test for intersection
|
||||
for(unsigned int i = 0; i<this->leafData.size(); i++)
|
||||
{
|
||||
// If objects intersect call collision response function
|
||||
if(tempRef != i && !this->leafData[i].limbo) if(this->leafData[tempRef].container.Intersects(this->leafData[i].container))
|
||||
{
|
||||
hitAction(*this, tempRef, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Octree::Visit(const Oyster::Collision3D::ICollideable& collideable, void* args, VisitorActionCollideable hitAction)
|
||||
{
|
||||
for(unsigned int i = 0; i<this->leafData.size(); i++)
|
||||
{
|
||||
if(!this->leafData[i].limbo && collideable.Intersects(this->leafData[i].container))
|
||||
{
|
||||
hitAction( this->GetCustomBody(i), args );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ICustomBody* Octree::GetCustomBody(const unsigned int tempRef)
|
||||
{
|
||||
return this->leafData[tempRef].customBodyRef;
|
||||
}
|
||||
|
||||
UniquePointer<ICustomBody> Octree::Extract( const ICustomBody* objRef )
|
||||
{ // Dan Andersson
|
||||
auto iter = this->mapReferences.find( objRef );
|
||||
if( iter != this->mapReferences.end() )
|
||||
{
|
||||
return this->Extract( iter->second );
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
UniquePointer<ICustomBody> Octree::Extract( unsigned int tempRef )
|
||||
{
|
||||
if( tempRef != Octree::invalid_ref )
|
||||
{
|
||||
//! @todo TODO: implement stub
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int Octree::GetTemporaryReferenceOf( const ICustomBody* objRef ) const
|
||||
{ // Dan Andersson
|
||||
auto iter = this->mapReferences.find( objRef );
|
||||
if( iter != this->mapReferences.end() )
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Octree::invalid_ref;
|
||||
}
|
||||
}
|
||||
|
||||
void Octree::SetAsAltered( unsigned int tempRef )
|
||||
{
|
||||
//this->leafData[tempRef].container = this->leafData[tempRef].customBodyRef->GetBoundingSphere();
|
||||
//! @todo TODO: implement stub
|
||||
}
|
||||
|
||||
void Octree::EvaluatePosition( unsigned int tempRef )
|
||||
{
|
||||
//! @todo TODO: implement stub
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
#ifndef OCTREE_H
|
||||
#define OCTREE_H
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "Sphere.h"
|
||||
#include "BoxAxisAligned.h"
|
||||
#include "Utilities.h"
|
||||
#include "../PhysicsAPI.h"
|
||||
|
||||
namespace Oyster
|
||||
{
|
||||
namespace Physics
|
||||
{
|
||||
class Octree
|
||||
{
|
||||
public:
|
||||
static const unsigned int invalid_ref;
|
||||
|
||||
typedef void(*VisitorAction)(Octree&, unsigned int, unsigned int);
|
||||
typedef void(*VisitorActionCollideable)(ICustomBody*, void*);
|
||||
|
||||
struct Data
|
||||
{
|
||||
Data* prev;
|
||||
Data* next;
|
||||
|
||||
Collision3D::Sphere container;
|
||||
|
||||
::Utility::DynamicMemory::UniquePointer< ICustomBody > customBodyRef;
|
||||
|
||||
bool limbo;
|
||||
|
||||
unsigned int queueRef;
|
||||
};
|
||||
|
||||
struct OctreeNode
|
||||
{
|
||||
OctreeNode* children[8];
|
||||
Data* dataPtr;
|
||||
Collision3D::BoxAxisAligned container;
|
||||
};
|
||||
|
||||
Octree(unsigned int bufferSize = 0, unsigned char numLayers = 0, Math::Float3 worldSize = Math::Float3::null);
|
||||
virtual ~Octree();
|
||||
|
||||
Octree& operator=(const Octree& orig);
|
||||
|
||||
void AddObject(::Utility::DynamicMemory::UniquePointer< ICustomBody > customBodyRef);
|
||||
|
||||
void MoveToUpdateQueue(::Utility::DynamicMemory::UniquePointer< ICustomBody > customBodyRef);
|
||||
|
||||
void MoveToLimbo(const ICustomBody* customBodyRef);
|
||||
bool IsInLimbo(const ICustomBody* customBodyRef);
|
||||
void ReleaseFromLimbo(const ICustomBody* customBodyRef);
|
||||
|
||||
void DestroyObject(::Utility::DynamicMemory::UniquePointer< ICustomBody > customBodyRef);
|
||||
|
||||
std::vector<ICustomBody*>& Sample(ICustomBody* customBodyRef, std::vector<ICustomBody*>& updateList);
|
||||
std::vector<ICustomBody*>& Sample(const Oyster::Collision3D::ICollideable& collideable, std::vector<ICustomBody*>& updateList);
|
||||
void Visit(ICustomBody* customBodyRef, VisitorAction hitAction );
|
||||
void Visit(const Oyster::Collision3D::ICollideable& collideable, void* args, VisitorActionCollideable hitAction );
|
||||
|
||||
ICustomBody* GetCustomBody(const unsigned int tempRef);
|
||||
|
||||
::Utility::DynamicMemory::UniquePointer<ICustomBody> Extract( const ICustomBody* objRef );
|
||||
::Utility::DynamicMemory::UniquePointer<ICustomBody> Extract( unsigned int tempRef ); // Dan vill ha
|
||||
unsigned int GetTemporaryReferenceOf( const ICustomBody* objRef ) const; // Dan vill ha
|
||||
void SetAsAltered( unsigned int tempRef ); // Dan vill ha
|
||||
void EvaluatePosition( unsigned int tempRef ); // Dan vill ha
|
||||
|
||||
private:
|
||||
std::vector < Data > leafData;
|
||||
std::vector < Data* > updateQueue;
|
||||
std::vector < Data* > limbo;
|
||||
|
||||
std::map< const ICustomBody*, unsigned int > mapReferences;
|
||||
|
||||
OctreeNode worldNode;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,7 +1,6 @@
|
|||
#include "PhysicsAPI_Impl.h"
|
||||
#include "OysterPhysics3D.h"
|
||||
#include "SimpleRigidBody.h"
|
||||
#include "SphericalRigidBody.h"
|
||||
|
||||
using namespace ::Oyster;
|
||||
using namespace ::Oyster::Physics;
|
||||
|
@ -12,6 +11,8 @@ using namespace ::Utility::Value;
|
|||
|
||||
API_Impl API_instance;
|
||||
|
||||
|
||||
|
||||
API & API::Instance()
|
||||
{
|
||||
return API_instance;
|
||||
|
@ -24,6 +25,11 @@ API_Impl::API_Impl()
|
|||
this->dispatcher = NULL;
|
||||
this->solver = NULL;
|
||||
this->dynamicsWorld = NULL;
|
||||
|
||||
this->timeStep = 1.0f/120.0f;
|
||||
|
||||
this->gravityPoint = Float3(0.0f, 0.0f, 0.0f);
|
||||
this->gravity = 10.0f;
|
||||
}
|
||||
|
||||
API_Impl::~API_Impl()
|
||||
|
@ -39,13 +45,23 @@ API_Impl::~API_Impl()
|
|||
delete this->broadphase;
|
||||
this->broadphase = NULL;
|
||||
|
||||
for(int i = 0; i < this->customBodies.size(); i++)
|
||||
for(unsigned int i = 0; i < this->customBodies.size(); i++)
|
||||
{
|
||||
delete this->customBodies[i];
|
||||
this->customBodies[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void API_Impl::SetGravityPoint(::Oyster::Math::Float3 gravityPoint)
|
||||
{
|
||||
this->gravityPoint = gravityPoint;
|
||||
}
|
||||
|
||||
void API_Impl::SetGravity(float gravity)
|
||||
{
|
||||
this->gravity = gravity;
|
||||
}
|
||||
|
||||
// Bullet physics
|
||||
ICustomBody* API_Impl::AddCollisionSphere(float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction)
|
||||
{
|
||||
|
@ -164,27 +180,81 @@ ICustomBody* API_Impl::AddCollisionCylinder(::Oyster::Math::Float3 halfSize, ::O
|
|||
return body;
|
||||
}
|
||||
|
||||
ICustomBody* API_Impl::AddCharacter(::Oyster::Math::Float height, ::Oyster::Math::Float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction)
|
||||
{
|
||||
SimpleRigidBody* body = new SimpleRigidBody;
|
||||
SimpleRigidBody::State state;
|
||||
|
||||
// Add collision shape
|
||||
btCapsuleShape* collisionShape = new btCapsuleShape(radius, height);
|
||||
body->SetCollisionShape(collisionShape);
|
||||
|
||||
// Add motion state
|
||||
btDefaultMotionState* motionState = new btDefaultMotionState(btTransform(btQuaternion(rotation.x, rotation.y, rotation.z, rotation.w),btVector3(position.x, position.y, position.z)));
|
||||
body->SetMotionState(motionState);
|
||||
|
||||
// Add rigid body
|
||||
btVector3 fallInertia(0, 0, 0);
|
||||
collisionShape->calculateLocalInertia(mass, fallInertia);
|
||||
btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia);
|
||||
btRigidBody* rigidBody = new btRigidBody(rigidBodyCI);
|
||||
rigidBody->setFriction(staticFriction);
|
||||
rigidBody->setRestitution(restitution);
|
||||
rigidBody->setUserPointer(body);
|
||||
rigidBody->setAngularFactor(0);
|
||||
rigidBody->setSleepingThresholds(0, 0);
|
||||
body->SetRigidBody(rigidBody);
|
||||
|
||||
// Add rigid body to world
|
||||
this->dynamicsWorld->addRigidBody(rigidBody);
|
||||
this->customBodies.push_back(body);
|
||||
|
||||
state.centerPos = position;
|
||||
state.reach = Float3(radius, height, radius);
|
||||
state.dynamicFrictionCoeff = 0.5f;
|
||||
state.staticFrictionCoeff = 0.5f;
|
||||
state.quaternion = Quaternion(Float3(rotation.xyz), rotation.w);
|
||||
state.mass = mass;
|
||||
|
||||
body->SetState(state);
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
void API_Impl::SetTimeStep(float timeStep)
|
||||
{
|
||||
this->timeStep = timeStep;
|
||||
}
|
||||
|
||||
void API_Impl::UpdateWorld()
|
||||
{
|
||||
this->dynamicsWorld->stepSimulation(1.0f/60.0f, 1.0f, 1.0f/60.0f);
|
||||
for(unsigned int i = 0; i < this->customBodies.size(); i++ )
|
||||
{
|
||||
SimpleRigidBody* simpleBody = dynamic_cast<SimpleRigidBody*>(this->customBodies[i]);
|
||||
this->customBodies[i]->SetGravity(-(this->customBodies[i]->GetState().centerPos - this->gravityPoint).GetNormalized()*this->gravity);
|
||||
simpleBody->PreStep(this->dynamicsWorld);
|
||||
}
|
||||
|
||||
this->dynamicsWorld->stepSimulation(this->timeStep, 1, this->timeStep);
|
||||
|
||||
ICustomBody::State state;
|
||||
|
||||
for(unsigned int i = 0; i < this->customBodies.size(); i++ )
|
||||
{
|
||||
SimpleRigidBody* simpleBody = dynamic_cast<SimpleRigidBody*>(this->customBodies[i]);
|
||||
btTransform trans;
|
||||
dynamic_cast<SimpleRigidBody*>(this->customBodies[i])->GetMotionState()->getWorldTransform(trans);
|
||||
trans = simpleBody->GetRigidBody()->getWorldTransform();
|
||||
this->customBodies[i]->SetPosition(Float3(trans.getOrigin().x(), trans.getOrigin().y(), trans.getOrigin().z()));
|
||||
this->customBodies[i]->SetRotation(Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w()));
|
||||
|
||||
if(dynamic_cast<SimpleRigidBody*>(this->customBodies[i])->GetRigidBody()->getActivationState() == ACTIVE_TAG)
|
||||
if(simpleBody->GetRigidBody()->getActivationState() == ACTIVE_TAG)
|
||||
{
|
||||
dynamic_cast<SimpleRigidBody*>(this->customBodies[i])->CallSubscription_Move();
|
||||
this->customBodies[i]->CallSubscription_Move();
|
||||
}
|
||||
}
|
||||
|
||||
int numManifolds = this->dynamicsWorld->getDispatcher()->getNumManifolds();
|
||||
for (int i=0;i<numManifolds;i++)
|
||||
for (int i = 0; i < numManifolds; i++)
|
||||
{
|
||||
btPersistentManifold* contactManifold = this->dynamicsWorld->getDispatcher()->getManifoldByIndexInternal(i);
|
||||
const btCollisionObject* obA = contactManifold->getBody0();
|
||||
|
@ -193,20 +263,8 @@ void API_Impl::UpdateWorld()
|
|||
ICustomBody* bodyA = (ICustomBody*)obA->getUserPointer();
|
||||
ICustomBody* bodyB = (ICustomBody*)obB->getUserPointer();
|
||||
|
||||
dynamic_cast<SimpleRigidBody*>(bodyA)->CallSubscription_AfterCollisionResponse(bodyA, bodyB, 0.0f);
|
||||
dynamic_cast<SimpleRigidBody*>(bodyB)->CallSubscription_AfterCollisionResponse(bodyB, bodyA, 0.0f);
|
||||
|
||||
int numContacts = contactManifold->getNumContacts();
|
||||
for (int j=0;j<numContacts;j++)
|
||||
{
|
||||
btManifoldPoint& pt = contactManifold->getContactPoint(j);
|
||||
if (pt.getDistance()<0.f)
|
||||
{
|
||||
const btVector3& ptA = pt.getPositionWorldOnA();
|
||||
const btVector3& ptB = pt.getPositionWorldOnB();
|
||||
const btVector3& normalOnB = pt.m_normalWorldOnB;
|
||||
}
|
||||
}
|
||||
bodyA->CallSubscription_AfterCollisionResponse(bodyA, bodyB, 0.0f);
|
||||
bodyB->CallSubscription_AfterCollisionResponse(bodyB, bodyA, 0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -237,9 +295,73 @@ void API_Impl::ReleaseFromLimbo( const ICustomBody* objRef )
|
|||
|
||||
}
|
||||
|
||||
void API_Impl::ApplyEffect( const Oyster::Collision3D::ICollideable& collideable, void* args, void(hitAction)(ICustomBody*, void*) )
|
||||
void API_Impl::ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void* args, EventAction_ApplyEffect effect)
|
||||
{
|
||||
btRigidBody* body;
|
||||
btCollisionShape* shape;
|
||||
btMotionState* state;
|
||||
btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(0, NULL, NULL);
|
||||
|
||||
Sphere* sphere;
|
||||
Box* box;
|
||||
Cone* cone;
|
||||
|
||||
switch(collideable->type)
|
||||
{
|
||||
case ICollideable::Type::Type_sphere:
|
||||
sphere = dynamic_cast<Sphere*>(collideable);
|
||||
// Add collision shape
|
||||
shape = new btSphereShape(sphere->radius);
|
||||
|
||||
// Add motion state
|
||||
state = new btDefaultMotionState(btTransform(btQuaternion(0.0f, 0.0f, 0.0f, 1.0f),btVector3(sphere->center.x, sphere->center.y, sphere->center.z)));
|
||||
|
||||
// Add rigid body
|
||||
rigidBodyCI = btRigidBody::btRigidBodyConstructionInfo(0, state, shape);
|
||||
body = new btRigidBody(rigidBodyCI);
|
||||
|
||||
break;
|
||||
|
||||
case ICollideable::Type::Type_box:
|
||||
box = dynamic_cast<Box*>(collideable);
|
||||
// Add collision shape
|
||||
shape = new btBoxShape(btVector3(box->boundingOffset.x, box->boundingOffset.y, box->boundingOffset.z));
|
||||
|
||||
// Add motion state
|
||||
state = new btDefaultMotionState(btTransform(btQuaternion(0.0f, 0.0f, 0.0f, 1.0f),btVector3(box->center.x, box->center.y, box->center.z)));
|
||||
|
||||
// Add rigid body
|
||||
rigidBodyCI = btRigidBody::btRigidBodyConstructionInfo(0, state, shape);
|
||||
body = new btRigidBody(rigidBodyCI);
|
||||
|
||||
break;
|
||||
|
||||
case ICollideable::Type::Type_cone:
|
||||
cone = dynamic_cast<Cone*>(collideable);
|
||||
// Add collision shape
|
||||
shape = new btConeShapeZ(cone->radius, cone->length);
|
||||
|
||||
// Add motion state
|
||||
state = new btDefaultMotionState(btTransform(btQuaternion(cone->quaternion.x, cone->quaternion.y, cone->quaternion.z, cone->quaternion.w),btVector3(cone->center.x, cone->center.y, cone->center.z)));
|
||||
|
||||
// Add rigid body
|
||||
rigidBodyCI = btRigidBody::btRigidBodyConstructionInfo (0, state, shape);
|
||||
body = new btRigidBody(rigidBodyCI);
|
||||
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
ContactSensorCallback callback(*body, effect, args);
|
||||
|
||||
this->dynamicsWorld->contactTest(body, callback);
|
||||
|
||||
delete state;
|
||||
state = NULL;
|
||||
delete shape;
|
||||
shape = NULL;
|
||||
delete body;
|
||||
body = NULL;
|
||||
}
|
||||
|
||||
namespace Oyster
|
||||
|
@ -257,9 +379,7 @@ namespace Oyster
|
|||
}
|
||||
|
||||
void EventAction_AfterCollisionResponse( const ::Oyster::Physics::ICustomBody *proto, const ::Oyster::Physics::ICustomBody *deuter, ::Oyster::Math::Float kineticEnergyLoss )
|
||||
{ /* Do nothing except returning business as usual. */
|
||||
|
||||
}
|
||||
{ /* Do nothing except returning business as usual. */ }
|
||||
|
||||
void EventAction_Move( const ::Oyster::Physics::ICustomBody *object )
|
||||
{ /* Do nothing. */ }
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define PHYSICS_API_IMPL_H
|
||||
|
||||
#include "../PhysicsAPI.h"
|
||||
#include "Octree.h"
|
||||
#include <btBulletDynamicsCommon.h>
|
||||
|
||||
namespace Oyster
|
||||
|
@ -12,6 +11,42 @@ namespace Oyster
|
|||
class API_Impl : public API
|
||||
{
|
||||
public:
|
||||
struct ContactSensorCallback : public btCollisionWorld::ContactResultCallback
|
||||
{
|
||||
ContactSensorCallback(btRigidBody& contactBody, EventAction_ApplyEffect effect, void* args)
|
||||
: btCollisionWorld::ContactResultCallback(), body(contactBody), func(effect), args(args) {}
|
||||
|
||||
btRigidBody& body;
|
||||
EventAction_ApplyEffect func;
|
||||
void* args;
|
||||
|
||||
virtual bool needsCollision(btBroadphaseProxy* proxy) const
|
||||
{
|
||||
if(!btCollisionWorld::ContactResultCallback::needsCollision(proxy))
|
||||
return false;
|
||||
|
||||
return body.checkCollideWithOverride(static_cast<btCollisionObject*>(proxy->m_clientObject));
|
||||
}
|
||||
|
||||
virtual btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObjectWrapper* colObj0, int partId0, int index0, const btCollisionObjectWrapper* colObj1, int partId1, int index1)
|
||||
{
|
||||
btVector3 pt;
|
||||
if(colObj0->m_collisionObject == &body)
|
||||
{
|
||||
pt = cp.m_localPointA;
|
||||
this->func((ICustomBody*)(colObj1->getCollisionObject()->getUserPointer()), this->args);
|
||||
}
|
||||
else
|
||||
{
|
||||
//assert(colObj1->m_collisionObject == &body && "Body does not match either collision object");
|
||||
pt = cp.m_localPointB;
|
||||
this->func((ICustomBody*)(colObj0->getCollisionObject()->getUserPointer()), this->args);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
API_Impl();
|
||||
virtual ~API_Impl();
|
||||
|
||||
|
@ -21,14 +56,21 @@ namespace Oyster
|
|||
void MoveToLimbo( const ICustomBody* objRef );
|
||||
void ReleaseFromLimbo( const ICustomBody* objRef );
|
||||
|
||||
void SetGravityPoint(::Oyster::Math::Float3 gravityPoint);
|
||||
void SetGravity(float gravity);
|
||||
|
||||
// Bullet physics
|
||||
ICustomBody* AddCollisionSphere(float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction);
|
||||
ICustomBody* AddCollisionBox(::Oyster::Math::Float3 halfSize, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction);
|
||||
ICustomBody* AddCollisionCylinder(::Oyster::Math::Float3 halfSize, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction);
|
||||
|
||||
ICustomBody* AddCharacter(::Oyster::Math::Float height, ::Oyster::Math::Float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction);
|
||||
|
||||
void SetTimeStep(float timeStep);
|
||||
|
||||
void UpdateWorld();
|
||||
|
||||
void ApplyEffect( const Oyster::Collision3D::ICollideable& collideable, void* args, void(hitAction)(ICustomBody*, void*) );
|
||||
void ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void* args, EventAction_ApplyEffect effect);
|
||||
|
||||
private:
|
||||
btBroadphaseInterface* broadphase;
|
||||
|
@ -37,6 +79,11 @@ namespace Oyster
|
|||
btSequentialImpulseConstraintSolver* solver;
|
||||
btDiscreteDynamicsWorld* dynamicsWorld;
|
||||
std::vector<ICustomBody*> customBodies;
|
||||
|
||||
float timeStep;
|
||||
|
||||
::Oyster::Math::Float3 gravityPoint;
|
||||
float gravity;
|
||||
};
|
||||
|
||||
namespace Default
|
||||
|
|
|
@ -67,6 +67,11 @@ void SimpleRigidBody::SetState( const SimpleRigidBody::State &state )
|
|||
this->state = state;
|
||||
}
|
||||
|
||||
void SimpleRigidBody::ApplyImpulse(Float3 impulse)
|
||||
{
|
||||
this->rigidBody->applyImpulse(btVector3(impulse.x, impulse.y, impulse.z), btVector3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetCollisionShape(btCollisionShape* shape)
|
||||
{
|
||||
this->collisionShape = shape;
|
||||
|
@ -101,43 +106,182 @@ void SimpleRigidBody::SetLinearVelocity(Float3 velocity)
|
|||
void SimpleRigidBody::SetPosition(::Oyster::Math::Float3 position)
|
||||
{
|
||||
btTransform trans;
|
||||
this->motionState->getWorldTransform(trans);
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setOrigin(btVector3(position.x, position.y, position.z));
|
||||
this->motionState->setWorldTransform(trans);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
this->state.centerPos = position;
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetRotation(Float4 quaternion)
|
||||
{
|
||||
btTransform trans;
|
||||
this->motionState->getWorldTransform(trans);
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setRotation(btQuaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w));
|
||||
this->motionState->setWorldTransform(trans);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
this->state.quaternion = Quaternion(quaternion.xyz, quaternion.w);
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetRotation(::Oyster::Math::Quaternion quaternion)
|
||||
{
|
||||
btTransform trans;
|
||||
this->motionState->getWorldTransform(trans);
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setRotation(btQuaternion(quaternion.imaginary.x, quaternion.imaginary.y, quaternion.imaginary.z, quaternion.real));
|
||||
this->motionState->setWorldTransform(trans);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
this->state.quaternion = quaternion;
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetRotation(Float3 eulerAngles)
|
||||
{
|
||||
btTransform trans;
|
||||
this->motionState->getWorldTransform(trans);
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setRotation(btQuaternion(eulerAngles.x, eulerAngles.y, eulerAngles.z));
|
||||
this->motionState->setWorldTransform(trans);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
this->state.quaternion = Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w());
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetRotation(::Oyster::Math::Float4x4 rotation)
|
||||
{
|
||||
btTransform trans;
|
||||
btMatrix3x3 newRotation;
|
||||
btVector3 rightVector(rotation.v[0].x, rotation.v[0].y, rotation.v[0].z);
|
||||
btVector3 upVector(rotation.v[1].x, rotation.v[1].y, rotation.v[1].z);
|
||||
btVector3 forwardVector(rotation.v[2].x, rotation.v[2].y, rotation.v[2].z);
|
||||
|
||||
|
||||
newRotation[0] = rightVector;
|
||||
newRotation[1] = upVector;
|
||||
newRotation[2] = forwardVector;
|
||||
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setBasis(newRotation);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
|
||||
btQuaternion quaternion;
|
||||
quaternion = trans.getRotation();
|
||||
this->state.quaternion = Quaternion(Float3(quaternion.x(), quaternion.y(), quaternion.z()), quaternion.w());
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetRotationAsAngularAxis(::Oyster::Math::Float4 angularAxis)
|
||||
{
|
||||
if(angularAxis.xyz.GetMagnitude() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
btTransform trans;
|
||||
btVector3 vector(angularAxis.x, angularAxis.y, angularAxis.z);
|
||||
btQuaternion quaternion(vector, angularAxis.w);
|
||||
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setRotation(quaternion);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
|
||||
this->state.quaternion = Quaternion(Float3(quaternion.x(), quaternion.y(), quaternion.z()), quaternion.w());
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetAngularFactor(Float factor)
|
||||
{
|
||||
this->rigidBody->setAngularFactor(factor);
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetMass(Float mass)
|
||||
{
|
||||
btVector3 fallInertia(0, 0, 0);
|
||||
collisionShape->calculateLocalInertia(mass, fallInertia);
|
||||
this->rigidBody->setMassProps(mass, fallInertia);
|
||||
this->state.mass = mass;
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetGravity(Float3 gravity)
|
||||
{
|
||||
this->rigidBody->setGravity(btVector3(gravity.x, gravity.y, gravity.z));
|
||||
this->gravity = gravity;
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetUpAndRight(::Oyster::Math::Float3 up, ::Oyster::Math::Float3 right)
|
||||
{
|
||||
btTransform trans;
|
||||
btMatrix3x3 rotation;
|
||||
btVector3 upVector(up.x, up.y, up.z);
|
||||
btVector3 rightVector(right.x, right.y, right.z);
|
||||
rotation[1] = upVector.normalized();
|
||||
rotation[0] = rightVector.normalized();
|
||||
rotation[2] = rightVector.cross(upVector).normalized();
|
||||
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setBasis(rotation);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
|
||||
btQuaternion quaternion;
|
||||
quaternion = trans.getRotation();
|
||||
this->state.quaternion = Quaternion(Float3(quaternion.x(), quaternion.y(), quaternion.z()), quaternion.w());
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetUpAndForward(::Oyster::Math::Float3 up, ::Oyster::Math::Float3 forward)
|
||||
{
|
||||
btTransform trans;
|
||||
btMatrix3x3 rotation;
|
||||
btVector3 upVector(up.x, up.y, up.z);
|
||||
btVector3 forwardVector(forward.x, forward.y, forward.z);
|
||||
rotation[1] = upVector.normalized();
|
||||
rotation[2] = forwardVector.normalized();
|
||||
rotation[0] = upVector.cross(forwardVector).normalized();
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setBasis(rotation);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
|
||||
btQuaternion quaternion;
|
||||
quaternion = trans.getRotation();
|
||||
this->state.quaternion = Quaternion(Float3(quaternion.x(), quaternion.y(), quaternion.z()), quaternion.w());
|
||||
}
|
||||
|
||||
void SimpleRigidBody::SetUp(::Oyster::Math::Float3 up)
|
||||
{
|
||||
Float3 vector = Float3(0, 1, 0).Cross(up);
|
||||
|
||||
if(vector == Float3::null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Float sine = vector.GetLength();
|
||||
Float cosine = acos(Float3(0, 1, 0).Dot(up));
|
||||
|
||||
btQuaternion quaternion(btVector3(vector.x, vector.y, vector.z),cosine);
|
||||
|
||||
btTransform trans;
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
trans.setRotation(quaternion);
|
||||
this->rigidBody->setWorldTransform(trans);
|
||||
this->state.quaternion = Quaternion(Float3(quaternion.x(), quaternion.y(), quaternion.z()), quaternion.w());
|
||||
}
|
||||
|
||||
Float4x4 SimpleRigidBody::GetRotation() const
|
||||
{
|
||||
return this->state.GetRotation();
|
||||
}
|
||||
Float4 SimpleRigidBody::GetRotationAsAngularAxis()
|
||||
{
|
||||
Float4 axis = Float4::null;
|
||||
Float s = sqrtf(1 - this->state.quaternion.real*this->state.quaternion.real);
|
||||
|
||||
axis.w = 2*acos(this->state.quaternion.real*this->state.quaternion.real);
|
||||
|
||||
if(1 - this->state.quaternion.real > 0.001f)
|
||||
{
|
||||
axis.x = this->state.quaternion.imaginary.x/s;
|
||||
axis.y = this->state.quaternion.imaginary.y/s;
|
||||
axis.z = this->state.quaternion.imaginary.z/s;
|
||||
}
|
||||
else
|
||||
{
|
||||
axis.x = this->state.quaternion.imaginary.x;
|
||||
axis.y = this->state.quaternion.imaginary.y;
|
||||
axis.z = this->state.quaternion.imaginary.z;
|
||||
}
|
||||
|
||||
return axis;
|
||||
}
|
||||
|
||||
Float4x4 SimpleRigidBody::GetOrientation() const
|
||||
{
|
||||
|
@ -154,6 +298,16 @@ Float4x4 SimpleRigidBody::GetView( const ::Oyster::Math::Float3 &offset ) const
|
|||
return this->state.GetView(offset);
|
||||
}
|
||||
|
||||
Float3 SimpleRigidBody::GetGravity() const
|
||||
{
|
||||
return this->rigidBody->getGravity();
|
||||
}
|
||||
Float3 SimpleRigidBody::GetLinearVelocity() const
|
||||
{
|
||||
return this->rigidBody->getLinearVelocity();
|
||||
}
|
||||
|
||||
|
||||
void SimpleRigidBody::CallSubscription_AfterCollisionResponse(ICustomBody* bodyA, ICustomBody* bodyB, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
if(this->afterCollision)
|
||||
|
@ -193,3 +347,58 @@ void SimpleRigidBody::SetCustomTag( void *ref )
|
|||
}
|
||||
|
||||
|
||||
void SimpleRigidBody::PreStep (const btCollisionWorld* collisionWorld)
|
||||
{
|
||||
btTransform xform;
|
||||
this->rigidBody->getMotionState()->getWorldTransform (xform);
|
||||
btVector3 down = -xform.getBasis()[1];
|
||||
btVector3 forward = xform.getBasis()[2];
|
||||
down.normalize ();
|
||||
forward.normalize();
|
||||
|
||||
this->raySource[0] = xform.getOrigin();
|
||||
this->raySource[1] = xform.getOrigin();
|
||||
|
||||
this->rayTarget[0] = this->raySource[0] + down * this->state.reach.y * btScalar(1.1);
|
||||
this->rayTarget[1] = this->raySource[1] + forward * this->state.reach.y * btScalar(1.1);
|
||||
|
||||
class ClosestNotMe : public btCollisionWorld::ClosestRayResultCallback
|
||||
{
|
||||
public:
|
||||
ClosestNotMe (btRigidBody* me) : btCollisionWorld::ClosestRayResultCallback(btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0))
|
||||
{
|
||||
m_me = me;
|
||||
}
|
||||
|
||||
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace)
|
||||
{
|
||||
if (rayResult.m_collisionObject == m_me)
|
||||
return 1.0;
|
||||
|
||||
return ClosestRayResultCallback::addSingleResult (rayResult, normalInWorldSpace);
|
||||
}
|
||||
protected:
|
||||
btRigidBody* m_me;
|
||||
};
|
||||
|
||||
ClosestNotMe rayCallback(this->rigidBody);
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
rayCallback.m_closestHitFraction = 1.0;
|
||||
if((this->raySource[i] - this->rayTarget[i]).length() != 0)
|
||||
collisionWorld->rayTest (this->raySource[i], this->rayTarget[i], rayCallback);
|
||||
if (rayCallback.hasHit())
|
||||
{
|
||||
this->rayLambda[i] = rayCallback.m_closestHitFraction;
|
||||
} else {
|
||||
this->rayLambda[i] = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float SimpleRigidBody::GetLamda() const
|
||||
{
|
||||
return this->rayLambda[0];
|
||||
}
|
|
@ -18,23 +18,35 @@ namespace Oyster
|
|||
State& GetState( State &targetMem ) const;
|
||||
void SetState( const State &state );
|
||||
|
||||
void SetCollisionShape(btCollisionShape* shape);
|
||||
void SetMotionState(btDefaultMotionState* motionState);
|
||||
void SetRigidBody(btRigidBody* rigidBody);
|
||||
void ApplyImpulse(Math::Float3 impulse);
|
||||
|
||||
void SetSubscription(EventAction_AfterCollisionResponse function);
|
||||
void SetSubscription(EventAction_Move function);
|
||||
|
||||
void SetLinearVelocity(Math::Float3 velocity);
|
||||
void SetPosition(::Oyster::Math::Float3 position);
|
||||
void SetPosition(Math::Float3 position);
|
||||
void SetRotation(Math::Float4 quaternion);
|
||||
void SetRotation(::Oyster::Math::Quaternion quaternion);
|
||||
void SetRotation(Math::Quaternion quaternion);
|
||||
void SetRotation(Math::Float3 eulerAngles);
|
||||
void SetRotation(::Oyster::Math::Float4x4 rotation);
|
||||
void SetRotationAsAngularAxis(Math::Float4 angularAxis);
|
||||
void SetAngularFactor(Math::Float factor);
|
||||
void SetMass(Math::Float mass);
|
||||
|
||||
void SetGravity(Math::Float3 gravity);
|
||||
|
||||
void SetUpAndRight(Math::Float3 up, Math::Float3 right);
|
||||
void SetUpAndForward(Math::Float3 up, Math::Float3 forward);
|
||||
void SetUp(Math::Float3 up);
|
||||
|
||||
Math::Float4x4 GetRotation() const;
|
||||
Math::Float4 GetRotationAsAngularAxis();
|
||||
Math::Float4x4 GetOrientation() const;
|
||||
Math::Float4x4 GetView() const;
|
||||
Math::Float4x4 GetView( const ::Oyster::Math::Float3 &offset ) const;
|
||||
Math::Float4x4 GetView( const Math::Float3 &offset ) const;
|
||||
|
||||
Math::Float3 GetGravity() const;
|
||||
::Oyster::Math::Float3 GetLinearVelocity() const;
|
||||
|
||||
void CallSubscription_AfterCollisionResponse(ICustomBody* bodyA, ICustomBody* bodyB, Math::Float kineticEnergyLoss);
|
||||
void CallSubscription_Move();
|
||||
|
@ -46,7 +58,19 @@ namespace Oyster
|
|||
void SetCustomTag( void *ref );
|
||||
void* GetCustomTag() const;
|
||||
|
||||
|
||||
|
||||
// Class specific
|
||||
void SetCollisionShape(btCollisionShape* shape);
|
||||
void SetMotionState(btDefaultMotionState* motionState);
|
||||
void SetRigidBody(btRigidBody* rigidBody);
|
||||
|
||||
void PreStep(const btCollisionWorld* collisionWorld);
|
||||
|
||||
float GetLamda() const;
|
||||
|
||||
private:
|
||||
|
||||
btCollisionShape* collisionShape;
|
||||
btDefaultMotionState* motionState;
|
||||
btRigidBody* rigidBody;
|
||||
|
@ -57,6 +81,12 @@ namespace Oyster
|
|||
EventAction_Move onMovement;
|
||||
|
||||
void *customTag;
|
||||
|
||||
Math::Float3 gravity;
|
||||
|
||||
btVector3 raySource[2];
|
||||
btVector3 rayTarget[2];
|
||||
btScalar rayLambda[2];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace Oyster
|
|||
typedef Struct::Gravity Gravity;
|
||||
|
||||
typedef void (*EventAction_Destruction)( ::Utility::DynamicMemory::UniquePointer<ICustomBody> proto );
|
||||
typedef void (*EventAction_ApplyEffect)(ICustomBody* collidedBody, void* args);
|
||||
|
||||
/** Gets the Physics instance. */
|
||||
static API & Instance();
|
||||
|
@ -78,12 +79,18 @@ namespace Oyster
|
|||
********************************************************/
|
||||
virtual void ReleaseFromLimbo( const ICustomBody* objRef ) = 0;
|
||||
|
||||
virtual void SetGravityPoint(::Oyster::Math::Float3 gravityPoint) = 0;
|
||||
virtual void SetGravity(float gravity) = 0;
|
||||
|
||||
// Bullet physics
|
||||
virtual ICustomBody* AddCollisionSphere(float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction) = 0;
|
||||
virtual ICustomBody* AddCollisionBox(::Oyster::Math::Float3 halfSize, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction) = 0;
|
||||
virtual ICustomBody* AddCollisionCylinder(::Oyster::Math::Float3 halfSize, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction) = 0;
|
||||
|
||||
virtual ICustomBody* AddCharacter(::Oyster::Math::Float height, ::Oyster::Math::Float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction) = 0;
|
||||
|
||||
virtual void SetTimeStep(float timeStep) = 0;
|
||||
|
||||
virtual void UpdateWorld() = 0;
|
||||
|
||||
|
||||
|
@ -95,7 +102,7 @@ namespace Oyster
|
|||
* @param hitAction: A function that contains the effect. Parameterlist contains the custom body
|
||||
the collideable hits, and the arguments sent to the function.
|
||||
********************************************************/
|
||||
virtual void ApplyEffect( const Oyster::Collision3D::ICollideable& collideable, void* args, void(hitAction)(ICustomBody*, void*) ) = 0;
|
||||
virtual void ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void* args, EventAction_ApplyEffect effect) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~API() {}
|
||||
|
@ -130,16 +137,35 @@ namespace Oyster
|
|||
virtual void SetSubscription(EventAction_AfterCollisionResponse function) = 0;
|
||||
virtual void SetSubscription(EventAction_Move function) = 0;
|
||||
|
||||
virtual void ApplyImpulse(::Oyster::Math::Float3 impulse) = 0;
|
||||
|
||||
virtual void SetLinearVelocity(::Oyster::Math::Float3 velocity) = 0;
|
||||
virtual void SetPosition(::Oyster::Math::Float3 position) = 0;
|
||||
virtual void SetRotation(::Oyster::Math::Float4 quaternion) = 0;
|
||||
virtual void SetRotation(::Oyster::Math::Quaternion quaternion) = 0;
|
||||
virtual void SetRotation(::Oyster::Math::Float3 eulerAngles) = 0;
|
||||
virtual void SetRotation(::Oyster::Math::Float4x4 rotation) = 0;
|
||||
virtual void SetRotationAsAngularAxis(::Oyster::Math::Float4 angularAxis) = 0;
|
||||
virtual void SetAngularFactor(::Oyster::Math::Float factor) = 0;
|
||||
virtual void SetMass(::Oyster::Math::Float mass) = 0;
|
||||
|
||||
::Oyster::Math::Float4x4 GetRotation() const;
|
||||
::Oyster::Math::Float4x4 GetOrientation() const;
|
||||
::Oyster::Math::Float4x4 GetView() const;
|
||||
::Oyster::Math::Float4x4 GetView( const ::Oyster::Math::Float3 &offset ) const;
|
||||
virtual void SetGravity(::Oyster::Math::Float3 gravity) = 0;
|
||||
|
||||
virtual void SetUpAndRight(::Oyster::Math::Float3 up, ::Oyster::Math::Float3 right) = 0;
|
||||
virtual void SetUpAndForward(::Oyster::Math::Float3 up, ::Oyster::Math::Float3 forward) = 0;
|
||||
virtual void SetUp(::Oyster::Math::Float3 up) = 0;
|
||||
|
||||
virtual ::Oyster::Math::Float4x4 GetRotation() const = 0;
|
||||
virtual ::Oyster::Math::Float4 GetRotationAsAngularAxis() = 0;
|
||||
virtual ::Oyster::Math::Float4x4 GetOrientation() const = 0;
|
||||
virtual ::Oyster::Math::Float4x4 GetView() const = 0;
|
||||
virtual ::Oyster::Math::Float4x4 GetView(const ::Oyster::Math::Float3 &offset) const = 0;
|
||||
|
||||
virtual ::Oyster::Math::Float3 GetGravity() const = 0;
|
||||
virtual ::Oyster::Math::Float3 GetLinearVelocity() const = 0;
|
||||
|
||||
virtual void CallSubscription_AfterCollisionResponse(ICustomBody* bodyA, ICustomBody* bodyB, Math::Float kineticEnergyLoss) = 0;
|
||||
virtual void CallSubscription_Move() = 0;
|
||||
|
||||
/********************************************************
|
||||
* @return the void pointer set by SetCustomTag.
|
||||
|
@ -153,11 +179,12 @@ namespace Oyster
|
|||
* @param ref: Anything castable to a void pointer, the engine won't care.
|
||||
********************************************************/
|
||||
virtual void SetCustomTag( void *ref ) = 0;
|
||||
|
||||
virtual float GetLamda() const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include "PhysicsStructs.h"
|
||||
#include "PhysicsFormula.h"
|
||||
|
||||
#endif
|
|
@ -1,82 +0,0 @@
|
|||
#ifndef PHYSICS_FORMULA_IMPL_H
|
||||
#define PHYSICS_FORMULA_IMPL_H
|
||||
|
||||
#include "PhysicsFormula.h"
|
||||
#include "OysterPhysics3D.h"
|
||||
|
||||
namespace Oyster { namespace Physics { namespace Formula
|
||||
{
|
||||
namespace MomentOfInertia
|
||||
{
|
||||
inline ::Oyster::Math::Float4x4 CreateSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius )
|
||||
{
|
||||
return ::Oyster::Physics3D::Formula::MomentOfInertia::Sphere(mass, radius);
|
||||
}
|
||||
|
||||
inline ::Oyster::Math::Float4x4 CreateHollowSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius )
|
||||
{
|
||||
return ::Oyster::Physics3D::Formula::MomentOfInertia::HollowSphere(mass, radius);
|
||||
}
|
||||
|
||||
inline ::Oyster::Math::Float4x4 CreateCuboidMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float width, const ::Oyster::Math::Float depth )
|
||||
{
|
||||
return ::Oyster::Physics3D::Formula::MomentOfInertia::Cuboid(mass, height, width, depth);
|
||||
}
|
||||
|
||||
inline ::Oyster::Math::Float4x4 CreateCylinderMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float radius )
|
||||
{
|
||||
return ::Oyster::Physics3D::Formula::MomentOfInertia::Cylinder(mass, height, radius);
|
||||
}
|
||||
|
||||
inline ::Oyster::Math::Float4x4 CreateRodMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float length )
|
||||
{
|
||||
return ::Oyster::Physics3D::Formula::MomentOfInertia::RodCenter(mass, length);
|
||||
}
|
||||
}
|
||||
|
||||
namespace CollisionResponse
|
||||
{
|
||||
inline ::Oyster::Math::Float Bounce( ::Oyster::Math::Float e, ::Oyster::Math::Float mA, ::Oyster::Math::Float gA, ::Oyster::Math::Float mB, ::Oyster::Math::Float gB )
|
||||
{
|
||||
//return (e + 1) * (mB*gA - mA*gB) / (mA + mB);
|
||||
return (e + 1) * (mA*gB - mB*gA) / (mA + mB);
|
||||
}
|
||||
|
||||
inline ::Oyster::Math::Float4 Friction( ::Oyster::Math::Float i, ::Oyster::Math::Float4 iN, ::Oyster::Math::Float4 momA, ::Oyster::Math::Float sFA, ::Oyster::Math::Float dFA, ::Oyster::Math::Float mA, ::Oyster::Math::Float4 momB, ::Oyster::Math::Float sFB, ::Oyster::Math::Float dFB, ::Oyster::Math::Float mB )
|
||||
{
|
||||
// FRICTION
|
||||
// Relative momentum after normal impulse
|
||||
::Oyster::Math::Float4 relativeMomentum = momB - momA;
|
||||
|
||||
::Oyster::Math::Float4 tanFriction = relativeMomentum - relativeMomentum.Dot( iN ) * iN;
|
||||
|
||||
if( tanFriction.Dot(tanFriction) > 0.0f )
|
||||
{ // no friction if moving directly into surface, or not at all.
|
||||
tanFriction.Normalize();
|
||||
|
||||
::Oyster::Math::Float magnitudeFriction = -relativeMomentum.Dot( tanFriction );
|
||||
magnitudeFriction = magnitudeFriction * mA * mB / ( mA + mB );
|
||||
|
||||
::Oyster::Math::Float mu = 0.5f * ( sFA + sFB );
|
||||
|
||||
::Oyster::Math::Float4 frictionImpulse;
|
||||
if( abs(magnitudeFriction) < i * mu )
|
||||
{
|
||||
frictionImpulse = magnitudeFriction * tanFriction;
|
||||
}
|
||||
else
|
||||
{
|
||||
::Oyster::Math::Float dynamicFriction = 0.5f * ( dFA + dFB );
|
||||
frictionImpulse = ( -i * dynamicFriction ) * tanFriction;
|
||||
}
|
||||
|
||||
return ( 1 / mA ) * frictionImpulse;
|
||||
}
|
||||
else
|
||||
return ::Oyster::Math::Float4::null;
|
||||
}
|
||||
}
|
||||
|
||||
} } }
|
||||
|
||||
#endif
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef PHYSICS_FORMULA_H
|
||||
#define PHYSICS_FORMULA_H
|
||||
|
||||
#include "OysterMath.h"
|
||||
#include "OysterPhysics3D.h"
|
||||
|
||||
namespace Oyster { namespace Physics { namespace Formula
|
||||
{
|
||||
namespace MomentOfInertia
|
||||
{
|
||||
::Oyster::Math::Float4x4 CreateSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius );
|
||||
::Oyster::Math::Float4x4 CreateHollowSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius );
|
||||
::Oyster::Math::Float4x4 CreateCuboidMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float width, const ::Oyster::Math::Float depth );
|
||||
::Oyster::Math::Float4x4 CreateCylinderMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float radius );
|
||||
::Oyster::Math::Float4x4 CreateRodMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float length );
|
||||
}
|
||||
|
||||
namespace CollisionResponse
|
||||
{
|
||||
::Oyster::Math::Float Bounce( ::Oyster::Math::Float coeffOfRestitution,
|
||||
::Oyster::Math::Float massA, ::Oyster::Math::Float momentumA,
|
||||
::Oyster::Math::Float massB, ::Oyster::Math::Float momentumB );
|
||||
|
||||
::Oyster::Math::Float4 Friction( ::Oyster::Math::Float impulse, ::Oyster::Math::Float4 impulseNormal,
|
||||
::Oyster::Math::Float4 momentumA, ::Oyster::Math::Float staticFrictionA,
|
||||
::Oyster::Math::Float dynamicFrictionA, ::Oyster::Math::Float massA,
|
||||
::Oyster::Math::Float4 momentumB, ::Oyster::Math::Float staticFrictionB,
|
||||
::Oyster::Math::Float dynamicFrictionB, ::Oyster::Math::Float massB );
|
||||
|
||||
}
|
||||
} } }
|
||||
|
||||
#include "PhysicsFormula-Impl.h"
|
||||
|
||||
#endif
|
|
@ -10,9 +10,10 @@ namespace Oyster
|
|||
{
|
||||
namespace Struct
|
||||
{
|
||||
inline CustomBodyState::CustomBodyState( ::Oyster::Math::Float mass, ::Oyster::Math::Float restitutionCoeff, ::Oyster::Math::Float staticFrictionCoeff, ::Oyster::Math::Float dynamicFrictionCoeff, const ::Oyster::Math::Float3 ¢erPos, const ::Oyster::Math::Quaternion& quaternion)
|
||||
inline CustomBodyState::CustomBodyState( ::Oyster::Math::Float mass, ::Oyster::Math::Float3 reach, ::Oyster::Math::Float restitutionCoeff, ::Oyster::Math::Float staticFrictionCoeff, ::Oyster::Math::Float dynamicFrictionCoeff, const ::Oyster::Math::Float3 ¢erPos, const ::Oyster::Math::Quaternion& quaternion)
|
||||
{
|
||||
this->mass = mass;
|
||||
this->reach = reach;
|
||||
this->restitutionCoeff = restitutionCoeff;
|
||||
this->staticFrictionCoeff = staticFrictionCoeff;
|
||||
this->dynamicFrictionCoeff = dynamicFrictionCoeff;
|
||||
|
@ -24,6 +25,7 @@ namespace Oyster
|
|||
{
|
||||
this->mass = state.mass;
|
||||
this->restitutionCoeff = state.restitutionCoeff;
|
||||
this->reach = state.reach;
|
||||
this->staticFrictionCoeff = state.staticFrictionCoeff;
|
||||
this->dynamicFrictionCoeff = state.dynamicFrictionCoeff;
|
||||
this->centerPos = state.centerPos;
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Oyster
|
|||
public:
|
||||
// Default constructor
|
||||
CustomBodyState( ::Oyster::Math::Float mass = 1.0f,
|
||||
::Oyster::Math::Float3 reach = ::Oyster::Math::Float3(0,0,0),
|
||||
::Oyster::Math::Float restitutionCoeff = 0.5f,
|
||||
::Oyster::Math::Float staticFrictionCoeff = 1.0f,
|
||||
::Oyster::Math::Float dynamicFrictionCoeff = 1.0f,
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace Oyster
|
|||
|
||||
private:
|
||||
//Implement this in the inherited classes for collision against that shape.
|
||||
virtual bool Collision(InputClass *input) = 0;
|
||||
virtual bool Collision(MouseInput& input) = 0;
|
||||
|
||||
public:
|
||||
EventButton();
|
||||
|
@ -54,14 +54,15 @@ namespace Oyster
|
|||
EventButton(EventFunc func);
|
||||
EventButton(EventFunc func, Owner owner);
|
||||
EventButton(EventFunc func, Owner owner, void* userData);
|
||||
~EventButton();
|
||||
virtual ~EventButton();
|
||||
|
||||
void Update(InputClass *input);
|
||||
void Update(MouseInput& input);
|
||||
|
||||
//Send event to callback function
|
||||
void SendEvent(ButtonState state);
|
||||
|
||||
//Set
|
||||
void SetEnabled(bool enable);
|
||||
void SetUserData(void* data);
|
||||
void SetEventFunc(EventFunc func);
|
||||
void SetOwner(Owner owner);
|
||||
|
@ -71,6 +72,7 @@ namespace Oyster
|
|||
unsigned int GetID();
|
||||
//EventFunc GetFunctionPointer();
|
||||
Owner GetOwner();
|
||||
ButtonState GetState();
|
||||
|
||||
bool operator ==(const EventButton<Owner>& obj);
|
||||
|
||||
|
@ -133,27 +135,42 @@ namespace Oyster
|
|||
|
||||
//Checks for collision and
|
||||
template <typename Owner>
|
||||
void EventButton<Owner>::Update(InputClass *input)
|
||||
void EventButton<Owner>::Update(MouseInput& input)
|
||||
{
|
||||
if(this->privData.enabled)
|
||||
{
|
||||
ButtonState currentState = ButtonState_None;
|
||||
static bool outside = false;
|
||||
static bool clicked = false;
|
||||
|
||||
//Check for collision against the button.
|
||||
if(Collision(input))
|
||||
{
|
||||
if(input->IsMousePressed())
|
||||
if(input.mouseButtonPressed)
|
||||
{
|
||||
//Change state when the mouse button is pressed
|
||||
switch(this->privData.previousState)
|
||||
{
|
||||
case ButtonState_None:
|
||||
outside = true;
|
||||
currentState = ButtonState_Hover;
|
||||
break;
|
||||
|
||||
case ButtonState_Hover:
|
||||
case ButtonState_Released:
|
||||
currentState = ButtonState_Pressed;
|
||||
if(outside == false)
|
||||
{
|
||||
clicked = true;
|
||||
currentState = ButtonState_Pressed;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentState = ButtonState_Hover;
|
||||
}
|
||||
break;
|
||||
case ButtonState_Released:
|
||||
currentState = ButtonState_Hover;
|
||||
break;
|
||||
|
||||
|
||||
case ButtonState_Pressed:
|
||||
case ButtonState_Down:
|
||||
|
@ -165,6 +182,7 @@ namespace Oyster
|
|||
}
|
||||
else
|
||||
{
|
||||
outside = false;
|
||||
//Change state when the mouse button is NOT pressed
|
||||
switch(this->privData.previousState)
|
||||
{
|
||||
|
@ -172,6 +190,7 @@ namespace Oyster
|
|||
case ButtonState_Hover:
|
||||
case ButtonState_Released:
|
||||
currentState = ButtonState_Hover;
|
||||
clicked = false;
|
||||
break;
|
||||
|
||||
case ButtonState_Pressed:
|
||||
|
@ -206,6 +225,13 @@ namespace Oyster
|
|||
}
|
||||
}
|
||||
|
||||
//Set if the button should be updated and collided with.
|
||||
template <typename Owner>
|
||||
void EventButton<Owner>::SetEnabled(bool enable)
|
||||
{
|
||||
this->privData.enabled = enable;
|
||||
}
|
||||
|
||||
template <typename Owner>
|
||||
void EventButton<Owner>::SetUserData(void* data)
|
||||
{
|
||||
|
@ -249,6 +275,12 @@ namespace Oyster
|
|||
return this->privData.owner;
|
||||
}
|
||||
|
||||
template <typename Owner>
|
||||
ButtonState EventButton<Owner>::GetState()
|
||||
{
|
||||
return this->privData.previousState;
|
||||
}
|
||||
|
||||
template <typename Owner>
|
||||
bool EventButton<Owner>::operator ==(const EventButton<Owner>& obj)
|
||||
{
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
//////////////////////////////////////
|
||||
// Created by Pontus Fransson 2014 //
|
||||
//////////////////////////////////////
|
||||
|
||||
#ifndef MISC_EVENT_BUTTON_CIRCLE_H
|
||||
#define MISC_EVENT_BUTTON_CIRCLE_H
|
||||
|
||||
#include "EventButton.h"
|
||||
#include "../../Input/L_inputClass.h"
|
||||
|
||||
namespace Oyster
|
||||
{
|
||||
namespace Event
|
||||
{
|
||||
template <typename Owner>
|
||||
class EventButtonCircle : public EventButton<Owner>
|
||||
{
|
||||
public:
|
||||
EventButtonCircle()
|
||||
: EventButton(), xPos(0), yPos(0), radius(0)
|
||||
{}
|
||||
EventButtonCircle(Owner owner, float xPos, float yPos, float radius)
|
||||
: EventButton(owner), xPos(xPos), yPos(yPos), radius(radius)
|
||||
{}
|
||||
EventButtonCircle(void (*EventFunc)( Oyster::Event::ButtonEvent<Owner>& e), float xPos, float yPos, float radius)
|
||||
: EventButton(EventFunc), xPos(xPos), yPos(yPos), radius(radius)
|
||||
{}
|
||||
EventButtonCircle(void (*EventFunc)( Oyster::Event::ButtonEvent<Owner>& e), Owner owner, float xPos, float yPos, float radius)
|
||||
: EventButton(EventFunc, owner), xPos(xPos), yPos(yPos), radius(radius)
|
||||
{}
|
||||
EventButtonCircle(void (*EventFunc)( Oyster::Event::ButtonEvent<Owner>& e), Owner owner, void* userData, float xPos, float yPos, float radius)
|
||||
: EventButton(EventFunc, owner, userData), xPos(xPos), yPos(yPos), radius(radius)
|
||||
{}
|
||||
~EventButtonCircle()
|
||||
{}
|
||||
|
||||
//Circle vs point collision
|
||||
bool Collision(InputClass* inputObject)
|
||||
{
|
||||
//Should come from the InputClass
|
||||
float xMouse = 2, yMouse = 2;
|
||||
|
||||
float xDiff = xMouse - xPos;
|
||||
float yDiff = yMouse - yPos;
|
||||
|
||||
float length = (xDiff * xDiff) + (yDiff * yDiff);
|
||||
|
||||
if(length <= radius*radius)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
float xPos, yPos;
|
||||
float radius;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -3,18 +3,27 @@
|
|||
//////////////////////////////////////
|
||||
|
||||
#include "EventButtonCollection.h"
|
||||
|
||||
#include "EventHandler.h"
|
||||
#include "../../Input/L_inputClass.h"
|
||||
|
||||
using namespace Oyster::Event;
|
||||
|
||||
EventButtonCollection::EventButtonCollection()
|
||||
: collectionState(EventCollectionState_Enabled)
|
||||
EventButtonCollection::EventButtonCollection(EventCollectionState state)
|
||||
: collectionState(state)
|
||||
{
|
||||
}
|
||||
|
||||
EventButtonCollection::~EventButtonCollection()
|
||||
{
|
||||
for(int i = 0; i < (int)EventHandler::Instance().collections.size(); i++)
|
||||
{
|
||||
if(EventHandler::Instance().collections.at(i) == this)
|
||||
{
|
||||
EventHandler::Instance().collections.erase(EventHandler::Instance().collections.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int size = buttons.size();
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
|
@ -23,13 +32,35 @@ EventButtonCollection::~EventButtonCollection()
|
|||
}
|
||||
}
|
||||
|
||||
void EventButtonCollection::Update(InputClass* inputObject)
|
||||
void EventButtonCollection::Update(MouseInput& input)
|
||||
{
|
||||
if(this->collectionState == EventCollectionState_Enabled)
|
||||
{
|
||||
for(int i = 0; i < (int)buttons.size(); i++)
|
||||
{
|
||||
buttons[i]->Update(inputObject);
|
||||
buttons[i]->Update(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EventButtonCollection::RenderTexture()
|
||||
{
|
||||
if(this->collectionState == EventCollectionState_Enabled)
|
||||
{
|
||||
for(int i = 0; i < (int)buttons.size(); i++)
|
||||
{
|
||||
buttons[i]->RenderTexture();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EventButtonCollection::RenderText()
|
||||
{
|
||||
if(this->collectionState == EventCollectionState_Enabled)
|
||||
{
|
||||
for(int i = 0; i < (int)buttons.size(); i++)
|
||||
{
|
||||
buttons[i]->RenderText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +77,13 @@ void EventButtonCollection::SetState(const EventCollectionState state)
|
|||
|
||||
void EventButtonCollection::Clear()
|
||||
{
|
||||
int size = buttons.size();
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
delete buttons[i];
|
||||
buttons[i] = NULL;
|
||||
}
|
||||
buttons.clear();
|
||||
|
||||
collectionState = EventCollectionState_Enabled;
|
||||
}
|
|
@ -27,16 +27,22 @@ namespace Oyster
|
|||
EventCollectionState_Unknown = -1,
|
||||
};
|
||||
|
||||
/********************************
|
||||
This EventButtonCollection will handle the destruction of the buttons when they are added to the collection
|
||||
********************************/
|
||||
class EventButtonCollection
|
||||
{
|
||||
public:
|
||||
EventButtonCollection();
|
||||
EventButtonCollection(EventCollectionState state = EventCollectionState_Enabled);
|
||||
~EventButtonCollection();
|
||||
|
||||
void Update(InputClass* inputObject);
|
||||
void Update(MouseInput& input);
|
||||
void RenderTexture();
|
||||
void RenderText();
|
||||
|
||||
template <typename Owner>
|
||||
void AddButton(EventButton<Owner>* button)
|
||||
/*Add a button to the collection when a button is added to the collection you are not allowed to delete it.
|
||||
*/
|
||||
template <typename Owner> void AddButton(EventButton<Owner>* button)
|
||||
{
|
||||
buttons.push_back(button);
|
||||
}
|
||||
|
@ -48,6 +54,11 @@ namespace Oyster
|
|||
void Clear();
|
||||
|
||||
private:
|
||||
//Can't copy
|
||||
EventButtonCollection(const EventButtonCollection& obj);
|
||||
EventButtonCollection& operator =(const EventButtonCollection& obj);
|
||||
|
||||
protected:
|
||||
std::vector<IEventButton*> buttons;
|
||||
EventCollectionState collectionState;
|
||||
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
//////////////////////////////////////
|
||||
// Created by Pontus Fransson 2014 //
|
||||
//////////////////////////////////////
|
||||
|
||||
#ifndef MISC_EVENT_BUTTON_RECTANGLE_H
|
||||
#define MISC_EVENT_BUTTON_RECTANGLE_H
|
||||
|
||||
#include "EventButton.h"
|
||||
#include "../../Input/L_inputClass.h"
|
||||
|
||||
namespace Oyster
|
||||
{
|
||||
namespace Event
|
||||
{
|
||||
template <typename Owner>
|
||||
class EventButtonRectangle : public EventButton<Owner>
|
||||
{
|
||||
public:
|
||||
EventButtonRectangle()
|
||||
: EventButton(), xPos(0), yPos(0), halfWidth(0), halfHeight(0)
|
||||
{}
|
||||
EventButtonRectangle(Owner owner, float xPos, float yPos, float halfWidth, float halfHeight)
|
||||
: EventButton(owner), xPos(xPos), yPos(yPos), halfWidth(halfWidth), halfHeight(halfHeight)
|
||||
{}
|
||||
EventButtonRectangle(void (*EventFunc)( Oyster::Event::ButtonEvent<Owner>& e), float xPos, float yPos, float halfWidth, float halfHeight)
|
||||
: EventButton(EventFunc), xPos(xPos), yPos(yPos), halfWidth(halfWidth), halfHeight(halfHeight)
|
||||
{}
|
||||
EventButtonRectangle(void (*EventFunc)( Oyster::Event::ButtonEvent<Owner>& e), Owner owner, float xPos, float yPos, float halfWidth, float halfHeight)
|
||||
: EventButton(EventFunc, owner), xPos(xPos), yPos(yPos), halfWidth(halfWidth), halfHeight(halfHeight)
|
||||
{}
|
||||
EventButtonRectangle(void (*EventFunc)( Oyster::Event::ButtonEvent<Owner>& e), Owner owner, void* userData, float xPos, float yPos, float halfWidth, float halfHeight)
|
||||
: EventButton(EventFunc, owner, userData), xPos(xPos), yPos(yPos), halfWidth(halfWidth), halfHeight(halfHeight)
|
||||
{}
|
||||
~EventButtonRectangle()
|
||||
{}
|
||||
|
||||
//Circle vs point collision
|
||||
bool Collision(InputClass* inputObject)
|
||||
{
|
||||
//Should come from the InputClass
|
||||
float xMouse = 1, yMouse = 0;
|
||||
|
||||
if(xMouse >= xPos - halfWidth && xMouse <= xPos + halfWidth
|
||||
&& yMouse >= yPos - halfHeight && yMouse <= yPos + halfHeight)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
float xPos, yPos;
|
||||
float halfWidth, halfHeight;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -19,29 +19,57 @@ EventHandler::EventHandler()
|
|||
|
||||
EventHandler::~EventHandler()
|
||||
{
|
||||
int size = collections.size();
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
delete collections[i];
|
||||
}
|
||||
Clean();
|
||||
}
|
||||
|
||||
void EventHandler::Update(InputClass* inputObject)
|
||||
void EventHandler::Clean()
|
||||
{
|
||||
collections.clear();
|
||||
}
|
||||
|
||||
void EventHandler::Update(MouseInput& input)
|
||||
{
|
||||
for(int i = 0; i < (int)collections.size(); i++)
|
||||
{
|
||||
collections.at(i)->Update(inputObject);
|
||||
collections.at(i)->Update(input);
|
||||
}
|
||||
}
|
||||
|
||||
void EventHandler::AddCollection(EventButtonCollection& collection)
|
||||
void EventHandler::RenderTexture()
|
||||
{
|
||||
collections.push_back(&collection);
|
||||
for(int i = 0; i < (int)collections.size(); i++)
|
||||
{
|
||||
collections.at(i)->RenderTexture();
|
||||
}
|
||||
}
|
||||
|
||||
EventButtonCollection& EventHandler::CreateCollection()
|
||||
void EventHandler::RenderText()
|
||||
{
|
||||
EventButtonCollection* temp = new EventButtonCollection;
|
||||
collections.push_back(temp);
|
||||
return *temp;
|
||||
for(int i = 0; i < (int)collections.size(); i++)
|
||||
{
|
||||
collections.at(i)->RenderText();
|
||||
}
|
||||
}
|
||||
|
||||
void EventHandler::AddCollection(EventButtonCollection* collection)
|
||||
{
|
||||
for(int i = 0; i < (int)collections.size(); i++)
|
||||
{
|
||||
//Do not add the collection if it's already in the list.
|
||||
if(collections.at(i) == collection)
|
||||
return;
|
||||
}
|
||||
collections.push_back(collection);
|
||||
}
|
||||
|
||||
void EventHandler::ReleaseCollection(EventButtonCollection* collection)
|
||||
{
|
||||
for(int i = 0; i < (int)collections.size(); i++)
|
||||
{
|
||||
if(collections.at(i) == collection)
|
||||
{
|
||||
collections.erase(collections.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
#include "EventButtonCollection.h"
|
||||
#include "EventButton.h"
|
||||
#include "EventButtonCircle.h"
|
||||
#include "EventButtonRectangle.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
@ -26,14 +24,29 @@ namespace Oyster
|
|||
|
||||
static EventHandler& Instance();
|
||||
|
||||
void Update(InputClass* inputObject);
|
||||
void Clean();
|
||||
|
||||
void AddCollection(EventButtonCollection& collection);
|
||||
EventButtonCollection& CreateCollection();
|
||||
void Update(MouseInput& input);
|
||||
void RenderTexture();
|
||||
void RenderText();
|
||||
|
||||
/*Add a collection to the EventHandler will only add collections not already present in the list.
|
||||
|
||||
*/
|
||||
void AddCollection(EventButtonCollection* collection);
|
||||
|
||||
void ReleaseCollection(EventButtonCollection* collection);
|
||||
|
||||
private:
|
||||
//Can't copy this class.
|
||||
EventHandler(const EventHandler& obj);
|
||||
EventHandler& operator =(const EventHandler& obj);
|
||||
|
||||
private:
|
||||
std::vector<EventButtonCollection*> collections;
|
||||
|
||||
//EventButtonCollection is a friend so it can delete it self.
|
||||
friend class EventButtonCollection;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,19 +20,27 @@ namespace Oyster
|
|||
ButtonState_Released,
|
||||
};
|
||||
|
||||
//Takes normalized device coordinates
|
||||
struct MouseInput
|
||||
{
|
||||
//Normalized device coordinates
|
||||
float x, y;
|
||||
bool mouseButtonPressed;
|
||||
};
|
||||
|
||||
class IEventButton
|
||||
{
|
||||
public:
|
||||
virtual ~IEventButton(){}
|
||||
|
||||
virtual void Update(InputClass *input){}
|
||||
virtual void RenderTexture() = 0;
|
||||
virtual void RenderText() = 0;
|
||||
|
||||
virtual void SendEvent(ButtonState state){}
|
||||
virtual void Update(MouseInput& input) = 0;
|
||||
|
||||
struct ButtonEvent;
|
||||
virtual void SetEventFunc(void (*EventFunc)( ButtonEvent e )){}
|
||||
virtual void SendEvent(ButtonState state) = 0;
|
||||
|
||||
virtual unsigned int GetID(){ return -1; }
|
||||
virtual unsigned int GetID() = 0;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -187,9 +187,7 @@
|
|||
<ItemGroup>
|
||||
<ClInclude Include="DynamicArray.h" />
|
||||
<ClInclude Include="EventHandler\EventButton.h" />
|
||||
<ClInclude Include="EventHandler\EventButtonCircle.h" />
|
||||
<ClInclude Include="EventHandler\EventButtonCollection.h" />
|
||||
<ClInclude Include="EventHandler\EventButtonRectangle.h" />
|
||||
<ClInclude Include="EventHandler\EventHandler.h" />
|
||||
<ClInclude Include="EventHandler\IEventButton.h" />
|
||||
<ClInclude Include="GID.h" />
|
||||
|
|
|
@ -134,12 +134,6 @@
|
|||
<ClInclude Include="EventHandler\IEventButton.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="EventHandler\EventButtonCircle.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="EventHandler\EventButtonRectangle.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="LinkedList.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#include <queue>
|
||||
#include <WinSock2.h>
|
||||
|
||||
//For conversion from wstring to string
|
||||
#include <codecvt>
|
||||
|
||||
using namespace Oyster::Network;
|
||||
using namespace Oyster::Thread;
|
||||
using namespace Utility::DynamicMemory;
|
||||
|
@ -293,6 +296,17 @@ bool NetworkClient::Connect(unsigned short port, const char serverIP[])
|
|||
return true;
|
||||
}
|
||||
|
||||
bool NetworkClient::Connect(unsigned short port, std::wstring serverIP)
|
||||
{
|
||||
//Convert from wstring to string.
|
||||
typedef std::codecvt_utf8<wchar_t> convert_typeX;
|
||||
std::wstring_convert<convert_typeX, wchar_t> converterX;
|
||||
|
||||
std::string ip = converterX.to_bytes(serverIP);
|
||||
|
||||
return this->Connect(port, ip.c_str());
|
||||
}
|
||||
|
||||
void NetworkClient::Disconnect()
|
||||
{
|
||||
if(!privateData) return;
|
||||
|
|
|
@ -88,6 +88,11 @@ namespace Oyster
|
|||
*/
|
||||
bool Connect(unsigned short port, const char serverIP[]);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
bool Connect(unsigned short port, std::wstring serverIP);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram />
|
|
@ -7,7 +7,8 @@
|
|||
#include "Dx11Includes.h"
|
||||
#include <sstream>
|
||||
#include "OysterMath.h"
|
||||
#include "../Misc/Resource/ResourceManager.h"
|
||||
//#include "../Misc/Resource/ResourceManager.h"
|
||||
#include "../../Misc/Resource/ResourceManager.h"
|
||||
//#include <vld.h>
|
||||
|
||||
namespace Oyster
|
||||
|
|
|
@ -66,6 +66,22 @@ namespace Oyster
|
|||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct Text2D
|
||||
{
|
||||
float pos;
|
||||
int offset;
|
||||
float coff;
|
||||
};
|
||||
|
||||
struct BlurrData
|
||||
{
|
||||
unsigned int StartX;
|
||||
unsigned int StartY;
|
||||
unsigned int StopX;
|
||||
unsigned int StopY;
|
||||
Math::Float4 BlurMask;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,11 +29,10 @@ namespace Oyster
|
|||
{
|
||||
return API::Fail;
|
||||
}
|
||||
Render::Resources::Gui::Text::Font = (ID3D11ShaderResourceView*)API::CreateTexture(L"font_generic.png");
|
||||
Render::Resources::Init();
|
||||
|
||||
Render::Preparations::Basic::SetViewPort();
|
||||
Render::DefaultRenderer::cube = API::CreateModel(L"box.dan");
|
||||
Render::DefaultRenderer::cube2 = API::CreateModel(L"box2.dan");
|
||||
return API::Sucsess;
|
||||
}
|
||||
|
||||
|
@ -51,11 +50,11 @@ namespace Oyster
|
|||
{
|
||||
if(Lights.size())
|
||||
{
|
||||
Render::DefaultRenderer::NewFrame(View, Projection, Lights[0], (int)Lights.size());
|
||||
Render::DefaultRenderer::NewFrame(View, Projection, &Lights[0], (int)Lights.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
Render::DefaultRenderer::NewFrame(View, Projection, Definitions::Pointlight(), 0);
|
||||
Render::DefaultRenderer::NewFrame(View, Projection, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,6 +87,7 @@ namespace Oyster
|
|||
m->WorldMatrix = Oyster::Math::Float4x4::identity;
|
||||
m->Visible = true;
|
||||
m->Animation.AnimationPlaying = NULL;
|
||||
m->Tint = Math::Float3(1);
|
||||
m->info = (Model::ModelInfo*)Core::loader.LoadResource((Core::modelPath + filename).c_str(),Oyster::Graphics::Loading::LoadDAN, Oyster::Graphics::Loading::UnloadDAN);
|
||||
|
||||
Model::ModelInfo* mi = (Model::ModelInfo*)m->info;
|
||||
|
@ -111,8 +111,7 @@ namespace Oyster
|
|||
|
||||
void API::Clean()
|
||||
{
|
||||
DeleteModel(Render::DefaultRenderer::cube);
|
||||
DeleteModel(Render::DefaultRenderer::cube2);
|
||||
DeleteTexture(Render::Resources::Gui::Text::Font);
|
||||
SAFE_DELETE(Core::viewPort);
|
||||
Core::loader.Clean();
|
||||
Oyster::Graphics::Core::PipelineManager::Clean();
|
||||
|
@ -157,12 +156,12 @@ namespace Oyster
|
|||
|
||||
void API::StartGuiRender()
|
||||
{
|
||||
Render::Rendering::Gui::BeginRender();
|
||||
Render::Gui::Begin2DRender();
|
||||
}
|
||||
|
||||
void API::RenderGuiElement(API::Texture tex, Math::Float2 pos, Math::Float2 size)
|
||||
void API::RenderGuiElement(API::Texture tex, Math::Float3 pos, Math::Float2 size, Math::Float3 color)
|
||||
{
|
||||
Render::Rendering::Gui::Render((ID3D11ShaderResourceView*)tex,pos,size);
|
||||
Render::Gui::Render((ID3D11ShaderResourceView*)tex,pos,size,color);
|
||||
}
|
||||
|
||||
API::Texture API::CreateTexture(std::wstring filename)
|
||||
|
@ -180,12 +179,22 @@ namespace Oyster
|
|||
m->Animation.AnimationPlaying = &(*m->info->Animations.find(name)).second;
|
||||
m->Animation.AnimationTime=0;
|
||||
m->Animation.LoopAnimation = looping;
|
||||
return m->Animation.AnimationPlaying->duration;
|
||||
return (float)m->Animation.AnimationPlaying->duration;
|
||||
}
|
||||
|
||||
void API::Update(float dt)
|
||||
{
|
||||
deltaTime = dt;
|
||||
}
|
||||
|
||||
void API::StartTextRender()
|
||||
{
|
||||
Render::Gui::Begin2DTextRender();
|
||||
}
|
||||
|
||||
void API::RenderText(std::wstring text, Math::Float3 Pos, Math::Float2 Size, float FontSize, Math::Float3 color)
|
||||
{
|
||||
Render::Gui::RenderText(text, Pos, Size, FontSize, color);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,7 +57,13 @@ namespace Oyster
|
|||
static void StartGuiRender();
|
||||
|
||||
//! @brief Renders a single GUI element using the texture provided and the Pos in the center, %based system
|
||||
static void RenderGuiElement(Texture, Math::Float2 Pos, Math::Float2 Size);
|
||||
static void RenderGuiElement(Texture, Math::Float3 Pos, Math::Float2 Size, Math::Float3 Color = Math::Float3(1,1,1));
|
||||
|
||||
//! @brief Configures Renderer to process 2D Text, data will be passed in to EndFrame()
|
||||
static void StartTextRender();
|
||||
|
||||
//! @brief Renders a single GUI string using the texture provided and the Pos in the center, %based system
|
||||
static void RenderText(std::wstring, Math::Float3 Pos, Math::Float2 Size, float FontSize, Math::Float3 Color = Math::Float3(1,1,1));
|
||||
|
||||
//! @brief Performs light calculations, post effects and presents the scene
|
||||
static void EndFrame();
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace Oyster
|
|||
{
|
||||
ModelInfo* info;
|
||||
Oyster::Math::Float4x4 WorldMatrix;
|
||||
Oyster::Math::Float3 Tint;
|
||||
bool Visible;
|
||||
AnimationData Animation;
|
||||
};
|
||||
|
|
|
@ -10,31 +10,6 @@ struct Text2D
|
|||
int offset;
|
||||
float coff;
|
||||
};
|
||||
/*struct TextInstanceData
|
||||
{
|
||||
Oyster::Buffer InstanceBuffer;
|
||||
bool Visible;
|
||||
int NumLetters;
|
||||
Oyster::Math::Float4x4 World;
|
||||
};*/
|
||||
/*struct TextData
|
||||
{
|
||||
Oyster::Math::Float3 pos;
|
||||
Oyster::Math::Float2 uv;
|
||||
};
|
||||
|
||||
struct PerCharData
|
||||
{
|
||||
float data;
|
||||
Oyster::Math::Float3 charOffset;
|
||||
};
|
||||
struct TextInstanceData
|
||||
{
|
||||
Oyster::Buffer InstanceBuffer;
|
||||
bool Visible;
|
||||
int NumLetters;
|
||||
Oyster::Math::Float4x4 World;
|
||||
};*/
|
||||
|
||||
namespace Oyster
|
||||
{
|
||||
|
@ -49,9 +24,6 @@ namespace Oyster
|
|||
static HRESULT CreateVertexBuffer();
|
||||
static HRESULT CreateTextfield(int _id);
|
||||
public:
|
||||
//static Oyster::Buffer TextBuffer;
|
||||
//static int NumVertices;
|
||||
//static std::vector<TextInstanceData> TextInstances;
|
||||
static Buffer TextBuffer;
|
||||
static int NumLetters;
|
||||
static ID3D11ShaderResourceView* Texture;
|
||||
|
@ -59,8 +31,10 @@ namespace Oyster
|
|||
static bool Init();
|
||||
static bool UpdateTextField(std::string _str);
|
||||
static bool SetTexture(const char* _file);
|
||||
|
||||
//Updates a textbox with the certain id
|
||||
static void Update(std::string _str, float _scale);
|
||||
|
||||
//Removes all old instances and recreates it with the input data
|
||||
static HRESULT Reset(int _count, std::string* _str, Float3* _pos);
|
||||
static void Apply(int _id);
|
||||
|
|
|
@ -231,6 +231,22 @@
|
|||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\Passes\2D\Text\2DTextGeometry.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Geometry</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Geometry</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Geometry</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Geometry</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\Passes\2D\Text\2DTextVertex.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\Passes\Light\LightPass.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
|
@ -319,6 +335,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Shader\Passes\2D\Header.hlsli" />
|
||||
<None Include="Shader\Passes\2D\Text\Header.hlsli" />
|
||||
<None Include="Shader\Passes\Light\Defines.hlsli" />
|
||||
<None Include="Shader\Passes\Gather\Header.hlsli" />
|
||||
<None Include="Shader\Passes\Light\LightCalc.hlsli" />
|
||||
|
|
|
@ -107,6 +107,8 @@
|
|||
<FxCompile Include="Shader\Passes\2D\2DGeometry.hlsl" />
|
||||
<FxCompile Include="Shader\Passes\Blur\BlurHor.hlsl" />
|
||||
<FxCompile Include="Shader\Passes\Blur\BlurVert.hlsl" />
|
||||
<FxCompile Include="Shader\Passes\2D\Text\2DTextVertex.hlsl" />
|
||||
<FxCompile Include="Shader\Passes\2D\Text\2DTextGeometry.hlsl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Shader\HLSL\SimpleDebug\Debug.hlsl" />
|
||||
|
@ -117,5 +119,6 @@
|
|||
<None Include="Shader\Passes\2D\Header.hlsli" />
|
||||
<None Include="Shader\Passes\Gather\Header.hlsli" />
|
||||
<None Include="Shader\Passes\Blur\BlurSharedData.hlsli" />
|
||||
<None Include="Shader\Passes\2D\Text\Header.hlsli" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,88 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Core\Buffer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\Core.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\ShaderManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\Init.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<<<<<<< HEAD
|
||||
<ClCompile Include="Render\Rendering\BasicRender.cpp">
|
||||
=======
|
||||
<ClCompile Include="Resources\Resources.cpp">
|
||||
>>>>>>> f08e9491ed00b00aedba0eabf1caed33830fc0e2
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Render\Preparations\BasicPreparations.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<<<<<<< HEAD
|
||||
<ClCompile Include="Render\Resources\Resources.cpp">
|
||||
=======
|
||||
<ClCompile Include="Render\Rendering\BasicRender.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="FileLoader\ObjReader.cpp">
|
||||
>>>>>>> f08e9491ed00b00aedba0eabf1caed33830fc0e2
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Core\Buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Core\Core.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Core\CoreIncludes.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Render\Preparations\Preparations.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Render\Rendering\Render.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Model\ModelInfo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Model\Model.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Render\Resources\Resources.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Definitions\GraphicalDefinition.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="FileLoader\ObjReader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugVertex.hlsl" />
|
||||
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugPixel.hlsl" />
|
||||
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugCameraVertex.hlsl" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,214 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0EC83E64-230E-48EF-B08C-6AC9651B4F82}</ProjectGuid>
|
||||
<RootNamespace>OysterGraphics</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)OysterMath;$(SolutionDir)Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\OysterPhysic3D\Collision;..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Core\Buffer.cpp" />
|
||||
<ClCompile Include="Core\Core.cpp" />
|
||||
<ClCompile Include="Core\Init.cpp" />
|
||||
<ClCompile Include="Core\ShaderManager.cpp" />
|
||||
<<<<<<< HEAD
|
||||
<ClCompile Include="Render\Preparations\BasicPreparations.cpp" />
|
||||
<ClCompile Include="Render\Rendering\BasicRender.cpp" />
|
||||
<ClCompile Include="Render\Resources\Resources.cpp" />
|
||||
=======
|
||||
<ClCompile Include="FileLoader\ObjReader.cpp" />
|
||||
<ClCompile Include="Render\Preparations\BasicPreparations.cpp" />
|
||||
<ClCompile Include="Render\Rendering\BasicRender.cpp" />
|
||||
<ClCompile Include="Resources\Resources.cpp" />
|
||||
>>>>>>> f08e9491ed00b00aedba0eabf1caed33830fc0e2
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Core\Buffer.h" />
|
||||
<ClInclude Include="Core\Core.h" />
|
||||
<ClInclude Include="Core\CoreIncludes.h" />
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<ClInclude Include="EngineIncludes.h" />
|
||||
<ClInclude Include="FileLoader\ObjReader.h" />
|
||||
>>>>>>> f08e9491ed00b00aedba0eabf1caed33830fc0e2
|
||||
<ClInclude Include="Model\Model.h" />
|
||||
<ClInclude Include="Model\ModelInfo.h" />
|
||||
<ClInclude Include="Render\Preparations\Preparations.h" />
|
||||
<ClInclude Include="Render\Rendering\Render.h" />
|
||||
<ClInclude Include="Definitions\GraphicalDefinition.h" />
|
||||
<ClInclude Include="Render\Resources\Resources.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Misc\Misc.vcxproj">
|
||||
<Project>{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OysterMath\OysterMath.vcxproj">
|
||||
<Project>{f10cbc03-9809-4cba-95d8-327c287b18ee}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugCameraVertex.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugPixel.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">main</EntryPointName>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugVertex.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">main</EntryPointName>
|
||||
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</AssemblerOutput>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -13,14 +13,13 @@ namespace Oyster
|
|||
namespace Render
|
||||
{
|
||||
Definitions::Pointlight pl;
|
||||
Model::Model* DefaultRenderer::cube = NULL;
|
||||
Model::Model* DefaultRenderer::cube2 = NULL;
|
||||
|
||||
void DefaultRenderer::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight Lights, int numLights)
|
||||
void DefaultRenderer::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights)
|
||||
{
|
||||
Preparations::Basic::ClearBackBuffer(Oyster::Math::Float4(1,0,0,1));
|
||||
Preparations::Basic::ClearRTV(Resources::GBufferRTV,Resources::GBufferSize,Math::Float4(0,0,0,0));
|
||||
Core::PipelineManager::SetRenderPass(Graphics::Render::Resources::Gather::Pass);
|
||||
Lights[1];
|
||||
|
||||
void* data;
|
||||
|
||||
|
@ -37,7 +36,7 @@ namespace Oyster
|
|||
Resources::Light::LightConstantsData.Unmap();
|
||||
|
||||
data = Resources::Light::PointLightsData.Map();
|
||||
memcpy(data, &Lights, sizeof(Definitions::Pointlight) * numLights);
|
||||
memcpy(data, Lights, sizeof(Definitions::Pointlight) * numLights);
|
||||
Resources::Light::PointLightsData.Unmap();
|
||||
|
||||
Definitions::PostData pd;
|
||||
|
@ -67,17 +66,11 @@ namespace Oyster
|
|||
if(info->Animated && models[i].Animation.AnimationPlaying != NULL)
|
||||
{
|
||||
models[i].Animation.AnimationTime += deltaTime;
|
||||
cube->WorldMatrix = Math::Matrix::identity;
|
||||
////store inverse absolut transform
|
||||
Math::Matrix SkinTransform[100];
|
||||
Math::Matrix BoneAnimated[100];
|
||||
Math::Matrix BoneAbsAnimated[100];
|
||||
|
||||
Math::Matrix Scale = Math::Matrix::identity;
|
||||
Scale.m[0][0] = 1;
|
||||
Scale.m[1][1] = 1;
|
||||
Scale.m[2][2] = 2;
|
||||
|
||||
|
||||
|
||||
for(int b = 0; b <info->BoneCount; ++b)
|
||||
|
@ -86,14 +79,10 @@ namespace Oyster
|
|||
SkinTransform[b] = Bone.Absolute.GetInverse();
|
||||
BoneAnimated[b] = Bone.Relative;
|
||||
BoneAbsAnimated[b] = Bone.Absolute;
|
||||
|
||||
|
||||
cube2->WorldMatrix = Scale;
|
||||
cube2->WorldMatrix.v[3] = info->bones[b].Absolute.v[3];
|
||||
}
|
||||
int b = 0;
|
||||
Model::Animation A = *models[i].Animation.AnimationPlaying;
|
||||
while(models[i].Animation.AnimationTime>A.duration)
|
||||
while(models[i].Animation.AnimationTime>A.duration && models[i].Animation.LoopAnimation)
|
||||
models[i].Animation.AnimationTime -= (float)A.duration;
|
||||
|
||||
float position = models[i].Animation.AnimationTime;
|
||||
|
@ -127,11 +116,6 @@ namespace Oyster
|
|||
for(int b = 0; b < info->BoneCount; ++b)
|
||||
{
|
||||
BoneAbsAnimated[b] = BoneAbsAnimated[info->bones[b].Parent] * BoneAnimated[b];
|
||||
//SkinTransform[b] = BoneAbsAnimated[b];
|
||||
cube->WorldMatrix = Scale;
|
||||
cube->WorldMatrix.v[3] = BoneAbsAnimated[b].v[3];
|
||||
cube->WorldMatrix = models[i].WorldMatrix * cube->WorldMatrix;
|
||||
DefaultRenderer::RenderScene(cube,1,View,Projection);
|
||||
}
|
||||
|
||||
//write data to am
|
||||
|
@ -154,6 +138,10 @@ namespace Oyster
|
|||
memcpy(data,&(pm),sizeof(pm));
|
||||
Resources::Gather::ModelData.Unmap();
|
||||
|
||||
data = Render::Resources::Color.Map();
|
||||
memcpy(data,&models[i].Tint,sizeof(Math::Float3));
|
||||
Render::Resources::Color.Unmap();
|
||||
|
||||
if(info->Material.size())
|
||||
{
|
||||
Core::deviceContext->PSSetShaderResources(0,(UINT)info->Material.size(),&(info->Material[0]));
|
||||
|
@ -174,6 +162,46 @@ namespace Oyster
|
|||
}
|
||||
}
|
||||
|
||||
void BlurGlow()
|
||||
{
|
||||
Definitions::BlurrData bd;
|
||||
bd.BlurMask = Math::Float4(1,1,1,1);
|
||||
bd.StopX = Core::resolution.x/2;
|
||||
bd.StopY = Core::resolution.y;
|
||||
bd.StartX = 0;
|
||||
bd.StartY = Core::resolution.y/2;
|
||||
|
||||
void* data = Resources::Blur::Data.Map();
|
||||
memcpy(data,&bd,sizeof(Definitions::BlurrData));
|
||||
Resources::Blur::Data.Unmap();
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Blur::HorPass);
|
||||
Core::deviceContext->Dispatch((UINT)((Core::resolution.x/2 + 127U) / 128U), (UINT)(Core::resolution.y/2), 1);
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Blur::VertPass);
|
||||
Core::deviceContext->Dispatch((UINT)(Core::resolution.x/2), (UINT)((Core::resolution.y/2 + 127U) / 128U), 1);
|
||||
}
|
||||
|
||||
void BlurSSAO()
|
||||
{
|
||||
Definitions::BlurrData bd;
|
||||
bd.BlurMask = Math::Float4(0,0,0,1);
|
||||
bd.StopX = Core::resolution.x/2;
|
||||
bd.StopY = Core::resolution.y/2;
|
||||
bd.StartX = 0;
|
||||
bd.StartY = 0;
|
||||
|
||||
void* data = Resources::Blur::Data.Map();
|
||||
memcpy(data,&bd,sizeof(Definitions::BlurrData));
|
||||
Resources::Blur::Data.Unmap();
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Blur::HorPass);
|
||||
Core::deviceContext->Dispatch((UINT)((Core::resolution.x/2 + 127U) / 128U), (UINT)(Core::resolution.y/2), 1);
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Blur::VertPass);
|
||||
Core::deviceContext->Dispatch((UINT)(Core::resolution.x/2), (UINT)((Core::resolution.y/2 + 127U) / 128U), 1);
|
||||
}
|
||||
|
||||
|
||||
void DefaultRenderer::EndFrame()
|
||||
{
|
||||
|
@ -181,11 +209,9 @@ namespace Oyster
|
|||
|
||||
Core::deviceContext->Dispatch((UINT)((Core::resolution.x + 15U) / 16U), (UINT)((Core::resolution.y + 15U) / 16U), 1);
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Blur::HorPass);
|
||||
Core::deviceContext->Dispatch((UINT)((Core::resolution.x + 15U) / 16U), (UINT)((Core::resolution.y + 15U) / 16U), 1);
|
||||
BlurGlow();
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Blur::VertPass);
|
||||
Core::deviceContext->Dispatch((UINT)((Core::resolution.x + 15U) / 16U), (UINT)((Core::resolution.y + 15U) / 16U), 1);
|
||||
BlurSSAO();
|
||||
|
||||
Core::PipelineManager::SetRenderPass(Resources::Post::Pass);
|
||||
|
||||
|
|
|
@ -13,12 +13,9 @@ namespace Oyster
|
|||
class DefaultRenderer
|
||||
{
|
||||
public:
|
||||
static void NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight Lights, int numLights);
|
||||
static void NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights);
|
||||
static void RenderScene(Model::Model* models, int count, Math::Matrix View, Math::Matrix Projection, float DeltaTime = 0);
|
||||
static void EndFrame();
|
||||
|
||||
static Model::Model* cube;
|
||||
static Model::Model* cube2;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,36 +8,102 @@ namespace Oyster
|
|||
{
|
||||
namespace Render
|
||||
{
|
||||
namespace Rendering
|
||||
const int TEXT_NR_LETTERS=95;
|
||||
const float TEXT_SPACING=1.8f;
|
||||
|
||||
void Gui::Begin2DRender()
|
||||
{
|
||||
void Gui::BeginRender()
|
||||
Core::PipelineManager::SetRenderPass(Render::Resources::Gui::Pass);
|
||||
}
|
||||
|
||||
void Gui::Render(ID3D11ShaderResourceView* tex,Math::Float3 pos, Math::Float2 size, Math::Float3 color)
|
||||
{
|
||||
Core::deviceContext->PSSetShaderResources(0,1,&tex);
|
||||
|
||||
pos *= 2;
|
||||
pos -= 1;
|
||||
pos.y *= -1;
|
||||
|
||||
Definitions::GuiData gd;
|
||||
gd.Translation = Math::Matrix::identity;
|
||||
gd.Translation.m41 = pos.x;
|
||||
gd.Translation.m42 = pos.y;
|
||||
gd.Translation.m43 = pos.z;
|
||||
gd.Translation.m11 = size.x;
|
||||
gd.Translation.m22 = size.y;
|
||||
|
||||
void* data = Render::Resources::Gui::Data.Map();
|
||||
memcpy(data,&gd,sizeof(Definitions::GuiData));
|
||||
Render::Resources::Gui::Data.Unmap();
|
||||
|
||||
data = Render::Resources::Color.Map();
|
||||
memcpy(data,&color,sizeof(Math::Float3));
|
||||
Render::Resources::Color.Unmap();
|
||||
|
||||
|
||||
Core::deviceContext->Draw(1,0);
|
||||
}
|
||||
|
||||
void Gui::Begin2DTextRender()
|
||||
{
|
||||
Resources::Gui::Text::Vertex.Apply();
|
||||
Core::PipelineManager::SetRenderPass(Resources::Gui::Text::Pass);
|
||||
}
|
||||
|
||||
void Gui::RenderText(std::wstring text, Math::Float3 pos, Math::Float2 size, float FontSize, Math::Float3 color)
|
||||
{
|
||||
|
||||
//size.x = size.x / (text.length() * TEXT_SPACING /2);
|
||||
|
||||
|
||||
pos *= 2;
|
||||
pos -= 1;
|
||||
pos.y *= -1;
|
||||
|
||||
|
||||
//pos.x = pos.x - (size.x * (text.length()-1) * TEXT_SPACING /2);
|
||||
pos.x = pos.x + size.x/ (text.length() * TEXT_SPACING/2);
|
||||
pos.y = pos.y - size.y/2;
|
||||
|
||||
Definitions::GuiData gd;
|
||||
|
||||
gd.Translation = Math::Matrix::identity;
|
||||
gd.Translation.m41 = pos.x;
|
||||
gd.Translation.m42 = pos.y;
|
||||
gd.Translation.m43 = pos.z;
|
||||
gd.Translation.m11 = FontSize * 0.8f;
|
||||
gd.Translation.m22 = FontSize;
|
||||
|
||||
|
||||
void* data = Render::Resources::Gui::Data.Map();
|
||||
memcpy(data,&gd,sizeof(Definitions::GuiData));
|
||||
Render::Resources::Gui::Data.Unmap();
|
||||
Definitions::Text2D tmpInst;
|
||||
|
||||
data = Render::Resources::Color.Map();
|
||||
memcpy(data,&color,sizeof(Math::Float3));
|
||||
Render::Resources::Color.Unmap();
|
||||
|
||||
void* dest = Resources::Gui::Text::Vertex.Map();
|
||||
Definitions::Text2D* dataView = reinterpret_cast<Definitions::Text2D*>(dest);
|
||||
|
||||
for (unsigned int i=0; i<text.length(); i++)
|
||||
{
|
||||
Core::PipelineManager::SetRenderPass(Render::Resources::Gui::Pass);
|
||||
tmpInst.coff=(1.0f/TEXT_NR_LETTERS);
|
||||
tmpInst.offset=text[i]-32;
|
||||
tmpInst.pos=i*(FontSize * 0.8f * TEXT_SPACING);
|
||||
if(tmpInst.pos > size.x)
|
||||
{
|
||||
text = text.substr(0,i-1);
|
||||
break;
|
||||
}
|
||||
dataView[i]=tmpInst;
|
||||
}
|
||||
|
||||
void Gui::Render(ID3D11ShaderResourceView* tex,Math::Float2 pos, Math::Float2 size)
|
||||
{
|
||||
Core::deviceContext->PSSetShaderResources(0,1,&tex);
|
||||
|
||||
pos *= 2;
|
||||
pos -= 1;
|
||||
pos.y *= -1;
|
||||
|
||||
Definitions::GuiData gd;
|
||||
|
||||
gd.Translation = Math::Matrix::identity;
|
||||
gd.Translation.m41 = pos.x;
|
||||
gd.Translation.m42 = pos.y;
|
||||
gd.Translation.m11 = size.x;
|
||||
gd.Translation.m22 = size.y;
|
||||
Resources::Gui::Text::Vertex.Unmap();
|
||||
|
||||
|
||||
void* data = Render::Resources::Gui::Data.Map();
|
||||
memcpy(data,&gd,sizeof(Definitions::GuiData));
|
||||
Render::Resources::Gui::Data.Unmap();
|
||||
|
||||
Core::deviceContext->Draw(1,0);
|
||||
}
|
||||
Core::deviceContext->Draw(text.length(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,15 +8,14 @@ namespace Oyster
|
|||
{
|
||||
namespace Render
|
||||
{
|
||||
namespace Rendering
|
||||
class Gui
|
||||
{
|
||||
class Gui
|
||||
{
|
||||
public:
|
||||
static void BeginRender();
|
||||
static void Render(ID3D11ShaderResourceView* tex, Math::Float2 pos, Math::Float2 size);
|
||||
};
|
||||
}
|
||||
public:
|
||||
static void Begin2DRender();
|
||||
static void Render(ID3D11ShaderResourceView* tex, Math::Float3 pos, Math::Float2 size, Math::Float3 tint = Math::Float3(1,1,1));
|
||||
static void Begin2DTextRender();
|
||||
static void RenderText(std::wstring text, Math::Float3 pos, Math::Float2 size, float FontSize, Math::Float3 tint = Math::Float3(1,1,1));
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue