Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -92,13 +92,14 @@ INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||
)
|
||||
|
||||
IF (USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
|
||||
LINK_LIBRARIES(BulletSoftBody)
|
||||
ENDIF()
|
||||
|
||||
LINK_LIBRARIES(
|
||||
Bullet3Common BulletWorldImporter BulletFileLoader BulletInverseDynamicsUtils BulletInverseDynamics BulletDynamics BulletCollision LinearMath BussIK
|
||||
)
|
||||
|
||||
IF (USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
|
||||
LINK_LIBRARIES(BulletSoftBody)
|
||||
ENDIF()
|
||||
|
||||
IF (WIN32)
|
||||
ADD_EXECUTABLE(App_PhysicsServer_SharedMemory
|
||||
@@ -149,7 +150,7 @@ INCLUDE_DIRECTORIES(
|
||||
ADD_DEFINITIONS(-DB3_USE_STANDALONE_EXAMPLE)
|
||||
|
||||
LINK_LIBRARIES(
|
||||
Bullet3Common BulletWorldImporter BulletInverseDynamicsUtils BulletInverseDynamics BulletDynamics BulletCollision LinearMath BussIK OpenGLWindow
|
||||
BulletSoftBody Bullet3Common BulletWorldImporter BulletInverseDynamicsUtils BulletInverseDynamics BulletDynamics BulletCollision LinearMath BussIK OpenGLWindow
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ typedef b3PoolBodyHandle<b3Plugin> b3PluginHandle;
|
||||
struct b3PluginManagerInternalData
|
||||
{
|
||||
b3ResizablePool<b3PluginHandle> m_plugins;
|
||||
b3HashMap<b3HashString, b3PluginHandle*> m_pluginMap;
|
||||
b3HashMap<b3HashString, int> m_pluginMap;
|
||||
PhysicsDirect* m_physicsDirect;
|
||||
b3AlignedObjectArray<b3KeyboardEvent> m_keyEvents;
|
||||
b3AlignedObjectArray<b3VRControllerEvent> m_vrEvents;
|
||||
@@ -102,8 +102,12 @@ b3PluginManager::~b3PluginManager()
|
||||
{
|
||||
while (m_data->m_pluginMap.size())
|
||||
{
|
||||
b3PluginHandle** plugin = m_data->m_pluginMap.getAtIndex(0);
|
||||
unloadPlugin((*plugin)->m_pluginUniqueId);
|
||||
int* pluginUidPtr = m_data->m_pluginMap.getAtIndex(0);
|
||||
if (pluginUidPtr)
|
||||
{
|
||||
int pluginUid = *pluginUidPtr;
|
||||
unloadPlugin(*pluginUidPtr);
|
||||
}
|
||||
}
|
||||
delete m_data->m_physicsDirect;
|
||||
m_data->m_pluginMap.clear();
|
||||
@@ -140,11 +144,11 @@ int b3PluginManager::loadPlugin(const char* pluginPath, const char* postFixStr)
|
||||
{
|
||||
int pluginUniqueId = -1;
|
||||
|
||||
b3PluginHandle** pluginOrgPtr = m_data->m_pluginMap.find(pluginPath);
|
||||
if (pluginOrgPtr)
|
||||
int* pluginUidPtr = m_data->m_pluginMap.find(pluginPath);
|
||||
if (pluginUidPtr)
|
||||
{
|
||||
//already loaded
|
||||
pluginUniqueId = (*pluginOrgPtr)->m_pluginUniqueId;
|
||||
pluginUniqueId = *pluginUidPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,7 +189,7 @@ int b3PluginManager::loadPlugin(const char* pluginPath, const char* postFixStr)
|
||||
plugin->m_ownsPluginHandle = true;
|
||||
plugin->m_pluginHandle = pluginHandle;
|
||||
plugin->m_pluginPath = pluginPath;
|
||||
m_data->m_pluginMap.insert(pluginPath, plugin);
|
||||
m_data->m_pluginMap.insert(pluginPath, pluginUniqueId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -246,16 +250,19 @@ void b3PluginManager::tickPlugins(double timeStep, bool isPreTick)
|
||||
{
|
||||
for (int i=0;i<m_data->m_pluginMap.size();i++)
|
||||
{
|
||||
b3PluginHandle** pluginPtr = m_data->m_pluginMap.getAtIndex(i);
|
||||
int* pluginUidPtr = m_data->m_pluginMap.getAtIndex(i);
|
||||
b3PluginHandle* plugin = 0;
|
||||
if (pluginPtr && *pluginPtr)
|
||||
|
||||
if (pluginUidPtr)
|
||||
{
|
||||
plugin = *pluginPtr;
|
||||
int pluginUid = *pluginUidPtr;
|
||||
plugin = m_data->m_plugins.getHandle(pluginUid);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
PFN_TICK tick = isPreTick? plugin->m_preTickFunc : plugin->m_postTickFunc;
|
||||
if (tick)
|
||||
{
|
||||
@@ -319,7 +326,7 @@ int b3PluginManager::registerStaticLinkedPlugin(const char* pluginPath, PFN_INIT
|
||||
pluginHandle->m_userPointer = 0;
|
||||
|
||||
|
||||
m_data->m_pluginMap.insert(pluginPath, pluginHandle);
|
||||
m_data->m_pluginMap.insert(pluginPath, pluginUniqueId);
|
||||
|
||||
{
|
||||
b3PluginContext context;
|
||||
|
||||
@@ -12,6 +12,9 @@ includedirs {".","../../src", "../ThirdPartyLibs"}
|
||||
links {
|
||||
"BulletSoftBody", "Bullet3Common","BulletInverseDynamicsUtils", "BulletInverseDynamics", "BulletDynamics","BulletCollision", "LinearMath", "BussIK"
|
||||
}
|
||||
if os.is("Linux") then
|
||||
links{"dl"}
|
||||
end
|
||||
|
||||
language "C++"
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ links {
|
||||
end
|
||||
if os.is("Linux") then
|
||||
defines {"_LINUX"}
|
||||
links{"dl"}
|
||||
end
|
||||
if os.is("MacOSX") then
|
||||
defines {"_DARWIN"}
|
||||
|
||||
@@ -14,6 +14,7 @@ project ("App_PhysicsServerSharedMemoryBridgeUDP")
|
||||
links {"Ws2_32","Winmm"}
|
||||
end
|
||||
if os.is("Linux") then
|
||||
links{"dl"}
|
||||
end
|
||||
if os.is("MacOSX") then
|
||||
end
|
||||
@@ -68,6 +69,9 @@ if os.is("Windows") then
|
||||
defines { "WIN32" }
|
||||
links {"Ws2_32","Winmm"}
|
||||
end
|
||||
if os.is("Linux") then
|
||||
links{"dl"}
|
||||
end
|
||||
|
||||
language "C++"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user