2015-05-28 23:05:24 +00:00
|
|
|
/*
|
|
|
|
Bullet Continuous Collision Detection and Physics Library
|
|
|
|
Copyright (c) 2015 Google Inc. http://bulletphysics.org
|
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied warranty.
|
|
|
|
In no event will the authors be held liable for any damages arising from the use of this software.
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it freely,
|
|
|
|
subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-07-14 22:30:17 +00:00
|
|
|
#include "PhysicsServerExample.h"
|
|
|
|
#include "PhysicsClientExample.h"
|
2015-05-28 23:05:24 +00:00
|
|
|
#include "Bullet3Common/b3CommandLineArgs.h"
|
|
|
|
|
|
|
|
#include "../CommonInterfaces/CommonExampleInterface.h"
|
|
|
|
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
|
2015-05-29 22:04:05 +00:00
|
|
|
#include "SharedMemoryCommon.h"
|
2015-05-28 23:05:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
|
|
|
|
b3CommandLineArgs args(argc, argv);
|
|
|
|
|
|
|
|
DummyGUIHelper noGfx;
|
|
|
|
|
|
|
|
CommonExampleOptions options(&noGfx);
|
2015-05-29 22:04:05 +00:00
|
|
|
SharedMemoryCommon* example = 0;
|
2015-05-28 23:05:24 +00:00
|
|
|
|
|
|
|
if (args.CheckCmdLineFlag("client"))
|
|
|
|
{
|
2015-05-29 22:04:05 +00:00
|
|
|
example = (SharedMemoryCommon*)PhysicsClientCreateFunc(options);
|
2015-05-28 23:05:24 +00:00
|
|
|
}else
|
|
|
|
{
|
2015-05-29 22:04:05 +00:00
|
|
|
example = (SharedMemoryCommon*)PhysicsServerCreateFunc(options);
|
2015-05-28 23:05:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
example->initPhysics();
|
2015-05-29 22:04:05 +00:00
|
|
|
while (!example->wantsTermination())
|
|
|
|
{
|
|
|
|
example->stepSimulation(1.f/60.f);
|
|
|
|
}
|
|
|
|
|
2015-05-28 23:05:24 +00:00
|
|
|
example->exitPhysics();
|
|
|
|
|
|
|
|
delete example;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|