2015-11-23 04:50:32 +00:00
|
|
|
#include "PhysicsServerSharedMemory.h"
|
|
|
|
#include "PosixSharedMemory.h"
|
|
|
|
#include "Win32SharedMemory.h"
|
|
|
|
|
|
|
|
#include "../CommonInterfaces/CommonRenderInterface.h"
|
2017-05-31 02:54:55 +00:00
|
|
|
#include "../CommonInterfaces/CommonExampleInterface.h"
|
2015-11-23 04:50:32 +00:00
|
|
|
#include "btBulletDynamicsCommon.h"
|
|
|
|
|
|
|
|
#include "LinearMath/btTransform.h"
|
|
|
|
|
|
|
|
#include "Bullet3Common/b3Logging.h"
|
|
|
|
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
|
|
|
|
#include "SharedMemoryBlock.h"
|
|
|
|
|
2018-01-16 21:39:37 +00:00
|
|
|
#include "PhysicsCommandProcessorInterface.h"
|
2015-11-23 04:50:32 +00:00
|
|
|
|
2017-01-06 02:30:01 +00:00
|
|
|
//number of shared memory blocks == number of simultaneous connections
|
|
|
|
#define MAX_SHARED_MEMORY_BLOCKS 2
|
2015-11-23 04:50:32 +00:00
|
|
|
|
|
|
|
struct PhysicsServerSharedMemoryInternalData
|
|
|
|
{
|
|
|
|
///end handle management
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
SharedMemoryInterface* m_sharedMemory;
|
2016-03-10 22:36:46 +00:00
|
|
|
bool m_ownsSharedMemory;
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
SharedMemoryBlock* m_testBlocks[MAX_SHARED_MEMORY_BLOCKS];
|
2015-11-23 04:50:32 +00:00
|
|
|
int m_sharedMemoryKey;
|
2017-01-06 17:49:03 +00:00
|
|
|
bool m_areConnected[MAX_SHARED_MEMORY_BLOCKS];
|
2015-11-23 04:50:32 +00:00
|
|
|
bool m_verboseOutput;
|
print better error warning, in case the physics client/server version mismatch.
fix in b3HashString
remove many unused dependencies from kuka_grasp_block_playback.py (time,math, datetime ,numpy,pylab ,sys, os, fnmatch,argparse were not used!)
move block_grasp_log.bin from Bullet3/data to Bullet3/examples/pybullet/examples/data folder.
PhysicsServerCommandProcessor, derive from CommandProcessorInterface to prepare for different back-end implementation
2017-05-29 00:05:18 +00:00
|
|
|
CommandProcessorInterface* m_commandProcessor;
|
2017-05-31 02:54:55 +00:00
|
|
|
CommandProcessorCreationInterface* m_commandProcessorCreator;
|
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
PhysicsServerSharedMemoryInternalData()
|
2018-09-23 21:17:31 +00:00
|
|
|
: m_sharedMemory(0),
|
|
|
|
m_ownsSharedMemory(false),
|
|
|
|
m_sharedMemoryKey(SHARED_MEMORY_KEY),
|
|
|
|
m_verboseOutput(false),
|
|
|
|
m_commandProcessor(0)
|
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
for (int i = 0; i < MAX_SHARED_MEMORY_BLOCKS; i++)
|
|
|
|
{
|
|
|
|
m_testBlocks[i] = 0;
|
|
|
|
m_areConnected[i] = false;
|
|
|
|
}
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
2017-01-06 02:30:01 +00:00
|
|
|
SharedMemoryStatus& createServerStatus(int statusType, int sequenceNumber, int timeStamp, int blockIndex)
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
SharedMemoryStatus& serverCmd = m_testBlocks[blockIndex]->m_serverCommands[0];
|
|
|
|
serverCmd.m_type = statusType;
|
2015-11-23 04:50:32 +00:00
|
|
|
serverCmd.m_sequenceNumber = sequenceNumber;
|
|
|
|
serverCmd.m_timeStamp = timeStamp;
|
|
|
|
return serverCmd;
|
|
|
|
}
|
2018-09-23 21:17:31 +00:00
|
|
|
void submitServerStatus(SharedMemoryStatus& status, int blockIndex)
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
2017-01-06 02:30:01 +00:00
|
|
|
m_testBlocks[blockIndex]->m_numServerCommands++;
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-05-31 02:54:55 +00:00
|
|
|
PhysicsServerSharedMemory::PhysicsServerSharedMemory(CommandProcessorCreationInterface* commandProcessorCreator, SharedMemoryInterface* sharedMem, int bla)
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
|
|
|
m_data = new PhysicsServerSharedMemoryInternalData();
|
2017-05-31 02:54:55 +00:00
|
|
|
m_data->m_commandProcessorCreator = commandProcessorCreator;
|
2016-03-10 22:36:46 +00:00
|
|
|
if (sharedMem)
|
|
|
|
{
|
|
|
|
m_data->m_sharedMemory = sharedMem;
|
|
|
|
m_data->m_ownsSharedMemory = false;
|
2018-09-23 21:17:31 +00:00
|
|
|
}
|
|
|
|
else
|
2016-03-10 22:36:46 +00:00
|
|
|
{
|
2015-11-23 04:50:32 +00:00
|
|
|
#ifdef _WIN32
|
2018-09-23 21:17:31 +00:00
|
|
|
m_data->m_sharedMemory = new Win32SharedMemoryServer();
|
2015-11-23 04:50:32 +00:00
|
|
|
#else
|
2018-09-23 21:17:31 +00:00
|
|
|
m_data->m_sharedMemory = new PosixSharedMemory();
|
2015-11-23 04:50:32 +00:00
|
|
|
#endif
|
2018-09-23 21:17:31 +00:00
|
|
|
m_data->m_ownsSharedMemory = true;
|
2016-03-10 22:36:46 +00:00
|
|
|
}
|
|
|
|
|
2017-05-31 02:54:55 +00:00
|
|
|
m_data->m_commandProcessor = commandProcessorCreator->createCommandProcessor();
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PhysicsServerSharedMemory::~PhysicsServerSharedMemory()
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
if (m_data->m_sharedMemory)
|
|
|
|
{
|
|
|
|
if (m_data->m_verboseOutput)
|
|
|
|
{
|
|
|
|
b3Printf("m_sharedMemory\n");
|
|
|
|
}
|
|
|
|
if (m_data->m_ownsSharedMemory)
|
|
|
|
{
|
|
|
|
delete m_data->m_sharedMemory;
|
|
|
|
}
|
|
|
|
m_data->m_sharedMemory = 0;
|
|
|
|
}
|
2017-01-06 17:49:03 +00:00
|
|
|
|
2017-05-31 02:54:55 +00:00
|
|
|
m_data->m_commandProcessorCreator->deleteCommandProcessor(m_data->m_commandProcessor);
|
2018-09-23 21:17:31 +00:00
|
|
|
delete m_data;
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
print better error warning, in case the physics client/server version mismatch.
fix in b3HashString
remove many unused dependencies from kuka_grasp_block_playback.py (time,math, datetime ,numpy,pylab ,sys, os, fnmatch,argparse were not used!)
move block_grasp_log.bin from Bullet3/data to Bullet3/examples/pybullet/examples/data folder.
PhysicsServerCommandProcessor, derive from CommandProcessorInterface to prepare for different back-end implementation
2017-05-29 00:05:18 +00:00
|
|
|
/*void PhysicsServerSharedMemory::resetDynamicsWorld()
|
2016-07-08 02:24:44 +00:00
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->deleteDynamicsWorld();
|
|
|
|
m_data->m_commandProcessor ->createEmptyDynamicsWorld();
|
|
|
|
}
|
print better error warning, in case the physics client/server version mismatch.
fix in b3HashString
remove many unused dependencies from kuka_grasp_block_playback.py (time,math, datetime ,numpy,pylab ,sys, os, fnmatch,argparse were not used!)
move block_grasp_log.bin from Bullet3/data to Bullet3/examples/pybullet/examples/data folder.
PhysicsServerCommandProcessor, derive from CommandProcessorInterface to prepare for different back-end implementation
2017-05-29 00:05:18 +00:00
|
|
|
*/
|
2015-11-23 04:50:32 +00:00
|
|
|
void PhysicsServerSharedMemory::setSharedMemoryKey(int key)
|
|
|
|
{
|
|
|
|
m_data->m_sharedMemoryKey = key;
|
|
|
|
}
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
bool PhysicsServerSharedMemory::connectSharedMemory(struct GUIHelperInterface* guiHelper)
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->setGuiHelper(guiHelper);
|
|
|
|
|
|
|
|
bool allowCreation = true;
|
2018-09-23 21:17:31 +00:00
|
|
|
bool allConnected = false;
|
2017-01-16 19:17:32 +00:00
|
|
|
int numConnected = 0;
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
int counter = 0;
|
2018-09-23 21:17:31 +00:00
|
|
|
for (int block = 0; block < MAX_SHARED_MEMORY_BLOCKS; block++)
|
|
|
|
{
|
|
|
|
if (m_data->m_areConnected[block])
|
|
|
|
{
|
|
|
|
allConnected = true;
|
2017-01-16 19:17:32 +00:00
|
|
|
numConnected++;
|
2018-09-23 21:17:31 +00:00
|
|
|
b3Warning("connectSharedMemory, while already connected");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
do
|
|
|
|
{
|
|
|
|
m_data->m_testBlocks[block] = (SharedMemoryBlock*)m_data->m_sharedMemory->allocateSharedMemory(m_data->m_sharedMemoryKey + block, SHARED_MEMORY_SIZE, allowCreation);
|
|
|
|
if (m_data->m_testBlocks[block])
|
|
|
|
{
|
|
|
|
int magicId = m_data->m_testBlocks[block]->m_magicId;
|
|
|
|
if (m_data->m_verboseOutput)
|
|
|
|
{
|
|
|
|
b3Printf("magicId = %d\n", magicId);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_data->m_testBlocks[block]->m_magicId != SHARED_MEMORY_MAGIC_NUMBER)
|
|
|
|
{
|
|
|
|
InitSharedMemoryBlock(m_data->m_testBlocks[block]);
|
|
|
|
if (m_data->m_verboseOutput)
|
|
|
|
{
|
|
|
|
b3Printf("Created and initialized shared memory block\n");
|
|
|
|
}
|
|
|
|
m_data->m_areConnected[block] = true;
|
2017-01-16 19:17:32 +00:00
|
|
|
numConnected++;
|
2018-09-23 21:17:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_data->m_sharedMemory->releaseSharedMemory(m_data->m_sharedMemoryKey + block, SHARED_MEMORY_SIZE);
|
|
|
|
m_data->m_testBlocks[block] = 0;
|
|
|
|
m_data->m_areConnected[block] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//b3Error("Cannot connect to shared memory");
|
|
|
|
m_data->m_areConnected[block] = false;
|
|
|
|
}
|
|
|
|
} while (counter++ < 10 && !m_data->m_areConnected[block]);
|
|
|
|
if (!m_data->m_areConnected[block])
|
|
|
|
{
|
|
|
|
b3Error("Server cannot connect to shared memory.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
allConnected = (numConnected == MAX_SHARED_MEMORY_BLOCKS);
|
|
|
|
|
2017-01-06 17:49:03 +00:00
|
|
|
return allConnected;
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PhysicsServerSharedMemory::disconnectSharedMemory(bool deInitializeSharedMemory)
|
|
|
|
{
|
print better error warning, in case the physics client/server version mismatch.
fix in b3HashString
remove many unused dependencies from kuka_grasp_block_playback.py (time,math, datetime ,numpy,pylab ,sys, os, fnmatch,argparse were not used!)
move block_grasp_log.bin from Bullet3/data to Bullet3/examples/pybullet/examples/data folder.
PhysicsServerCommandProcessor, derive from CommandProcessorInterface to prepare for different back-end implementation
2017-05-29 00:05:18 +00:00
|
|
|
//m_data->m_commandProcessor->deleteDynamicsWorld();
|
2017-03-16 16:13:33 +00:00
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
m_data->m_commandProcessor->setGuiHelper(0);
|
|
|
|
|
|
|
|
if (m_data->m_verboseOutput)
|
|
|
|
{
|
|
|
|
b3Printf("releaseSharedMemory1\n");
|
|
|
|
}
|
2018-09-23 21:17:31 +00:00
|
|
|
for (int block = 0; block < MAX_SHARED_MEMORY_BLOCKS; block++)
|
|
|
|
{
|
|
|
|
if (m_data->m_testBlocks[block])
|
|
|
|
{
|
|
|
|
if (m_data->m_verboseOutput)
|
|
|
|
{
|
|
|
|
b3Printf("m_testBlock1\n");
|
|
|
|
}
|
|
|
|
if (deInitializeSharedMemory)
|
|
|
|
{
|
|
|
|
m_data->m_testBlocks[block]->m_magicId = 0;
|
|
|
|
if (m_data->m_verboseOutput)
|
|
|
|
{
|
|
|
|
b3Printf("De-initialized shared memory, magic id = %d\n", m_data->m_testBlocks[block]->m_magicId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
btAssert(m_data->m_sharedMemory);
|
|
|
|
m_data->m_sharedMemory->releaseSharedMemory(m_data->m_sharedMemoryKey + block, SHARED_MEMORY_SIZE);
|
|
|
|
}
|
|
|
|
m_data->m_testBlocks[block] = 0;
|
|
|
|
m_data->m_areConnected[block] = false;
|
|
|
|
}
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PhysicsServerSharedMemory::releaseSharedMemory()
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
disconnectSharedMemory(true);
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
2017-06-17 20:29:14 +00:00
|
|
|
void PhysicsServerSharedMemory::stepSimulationRealTime(double dtInSec, const struct b3VRControllerEvent* vrEvents, int numVREvents, const struct b3KeyboardEvent* keyEvents, int numKeyEvents, const struct b3MouseEvent* mouseEvents, int numMouseEvents)
|
2016-07-18 06:50:11 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
m_data->m_commandProcessor->stepSimulationRealTime(dtInSec, vrEvents, numVREvents, keyEvents, numKeyEvents, mouseEvents, numMouseEvents);
|
2016-07-18 06:50:11 +00:00
|
|
|
}
|
2015-11-23 04:50:32 +00:00
|
|
|
|
2016-12-11 17:28:36 +00:00
|
|
|
void PhysicsServerSharedMemory::enableRealTimeSimulation(bool enableRealTimeSim)
|
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->enableRealTimeSimulation(enableRealTimeSim);
|
|
|
|
}
|
|
|
|
|
2017-05-31 02:54:55 +00:00
|
|
|
bool PhysicsServerSharedMemory::isRealTimeSimulationEnabled() const
|
|
|
|
{
|
|
|
|
return m_data->m_commandProcessor->isRealTimeSimulationEnabled();
|
|
|
|
}
|
|
|
|
|
2018-07-25 12:47:34 +00:00
|
|
|
void PhysicsServerSharedMemory::reportNotifications()
|
2018-07-24 12:12:16 +00:00
|
|
|
{
|
2018-07-25 12:47:34 +00:00
|
|
|
m_data->m_commandProcessor->reportNotifications();
|
2018-07-24 12:12:16 +00:00
|
|
|
}
|
2015-11-23 04:50:32 +00:00
|
|
|
|
|
|
|
void PhysicsServerSharedMemory::processClientCommands()
|
|
|
|
{
|
2019-06-14 06:24:22 +00:00
|
|
|
//handle client commands in any of the plugins
|
2018-09-06 00:58:14 +00:00
|
|
|
m_data->m_commandProcessor->processClientCommands();
|
|
|
|
|
2019-06-14 06:24:22 +00:00
|
|
|
//now handle the client commands from the shared memory
|
2018-09-23 21:17:31 +00:00
|
|
|
for (int block = 0; block < MAX_SHARED_MEMORY_BLOCKS; block++)
|
|
|
|
{
|
|
|
|
if (m_data->m_areConnected[block] && m_data->m_testBlocks[block])
|
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->replayLogCommand(&m_data->m_testBlocks[block]->m_bulletStreamDataServerToClientRefactor[0], SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE);
|
|
|
|
|
|
|
|
///we ignore overflow of integer for now
|
|
|
|
if (m_data->m_testBlocks[block]->m_numClientCommands > m_data->m_testBlocks[block]->m_numProcessedClientCommands)
|
|
|
|
{
|
2017-05-05 00:51:40 +00:00
|
|
|
//BT_PROFILE("processClientCommand");
|
2017-01-06 02:30:01 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
//until we implement a proper ring buffer, we assume always maximum of 1 outstanding commands
|
|
|
|
btAssert(m_data->m_testBlocks[block]->m_numClientCommands == m_data->m_testBlocks[block]->m_numProcessedClientCommands + 1);
|
|
|
|
|
|
|
|
const SharedMemoryCommand& clientCmd = m_data->m_testBlocks[block]->m_clientCommands[0];
|
|
|
|
|
|
|
|
m_data->m_testBlocks[block]->m_numProcessedClientCommands++;
|
|
|
|
//todo, timeStamp
|
|
|
|
int timeStamp = 0;
|
|
|
|
SharedMemoryStatus& serverStatusOut = m_data->createServerStatus(CMD_BULLET_DATA_STREAM_RECEIVED_COMPLETED, clientCmd.m_sequenceNumber, timeStamp, block);
|
|
|
|
bool hasStatus = m_data->m_commandProcessor->processCommand(clientCmd, serverStatusOut, &m_data->m_testBlocks[block]->m_bulletStreamDataServerToClientRefactor[0], SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE);
|
|
|
|
if (hasStatus)
|
|
|
|
{
|
|
|
|
m_data->submitServerStatus(serverStatusOut, block);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
2017-05-16 19:19:03 +00:00
|
|
|
void PhysicsServerSharedMemory::renderScene(int renderFlags)
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
2017-05-16 19:19:03 +00:00
|
|
|
m_data->m_commandProcessor->renderScene(renderFlags);
|
Improve debug text/line rendering, can be use to draw frames and text in local coordinate of an object / link.
example:
kuka = p.loadURDF("kuka_iiwa/model.urdf")
p.getNumJoints(kuka)
pybullet.addUserDebugLine([0,0,0],[0,0,0.1],[0,0,1],trackObjectUniqueId=2,trackLinkIndex=6)
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],trackObjectUniqueId=2,trackLinkIndex=6)
Also allow to render text using a given orientation (instead of pointing to the camera), example:
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],textOrientation=[0,0,0,1], trackObjectUniqueId=2,trackLinkIndex=6)
Add drawTexturedTriangleMesh, for drawing 3d text.
Expose readSingleInstanceTransformToCPU, to extract position/orientation from graphics index.
updateTexture: allow to not flip texels around up axis
2017-05-24 05:05:26 +00:00
|
|
|
}
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void PhysicsServerSharedMemory::syncPhysicsToGraphics()
|
Improve debug text/line rendering, can be use to draw frames and text in local coordinate of an object / link.
example:
kuka = p.loadURDF("kuka_iiwa/model.urdf")
p.getNumJoints(kuka)
pybullet.addUserDebugLine([0,0,0],[0,0,0.1],[0,0,1],trackObjectUniqueId=2,trackLinkIndex=6)
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],trackObjectUniqueId=2,trackLinkIndex=6)
Also allow to render text using a given orientation (instead of pointing to the camera), example:
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],textOrientation=[0,0,0,1], trackObjectUniqueId=2,trackLinkIndex=6)
Add drawTexturedTriangleMesh, for drawing 3d text.
Expose readSingleInstanceTransformToCPU, to extract position/orientation from graphics index.
updateTexture: allow to not flip texels around up axis
2017-05-24 05:05:26 +00:00
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->syncPhysicsToGraphics();
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void PhysicsServerSharedMemory::physicsDebugDraw(int debugDrawFlags)
|
2015-11-23 04:50:32 +00:00
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->physicsDebugDraw(debugDrawFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PhysicsServerSharedMemory::pickBody(const btVector3& rayFromWorld, const btVector3& rayToWorld)
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
return m_data->m_commandProcessor->pickBody(rayFromWorld, rayToWorld);
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PhysicsServerSharedMemory::movePickedBody(const btVector3& rayFromWorld, const btVector3& rayToWorld)
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
return m_data->m_commandProcessor->movePickedBody(rayFromWorld, rayToWorld);
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
void PhysicsServerSharedMemory::removePickingConstraint()
|
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->removePickingConstraint();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PhysicsServerSharedMemory::enableCommandLogging(bool enable, const char* fileName)
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
m_data->m_commandProcessor->enableCommandLogging(enable, fileName);
|
2015-11-23 04:50:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PhysicsServerSharedMemory::replayFromLogFile(const char* fileName)
|
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->replayFromLogFile(fileName);
|
|
|
|
}
|
2017-05-31 02:54:55 +00:00
|
|
|
|
|
|
|
const btVector3& PhysicsServerSharedMemory::getVRTeleportPosition() const
|
|
|
|
{
|
|
|
|
return m_data->m_commandProcessor->getVRTeleportPosition();
|
|
|
|
}
|
|
|
|
void PhysicsServerSharedMemory::setVRTeleportPosition(const btVector3& vrTeleportPos)
|
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->setVRTeleportPosition(vrTeleportPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
const btQuaternion& PhysicsServerSharedMemory::getVRTeleportOrientation() const
|
|
|
|
{
|
|
|
|
return m_data->m_commandProcessor->getVRTeleportOrientation();
|
|
|
|
}
|
|
|
|
void PhysicsServerSharedMemory::setVRTeleportOrientation(const btQuaternion& vrTeleportOrn)
|
|
|
|
{
|
|
|
|
m_data->m_commandProcessor->setVRTeleportOrientation(vrTeleportOrn);
|
|
|
|
}
|