mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
f9b232b153
premake4: allow to build example browser without C++11, re-enable stable PD control plugin using --enable_stable_pd=True
45 lines
1.3 KiB
C
45 lines
1.3 KiB
C
#ifndef SHARED_MEMORY_BLOCK_H
|
|
#define SHARED_MEMORY_BLOCK_H
|
|
|
|
#define SHARED_MEMORY_MAX_COMMANDS 1
|
|
|
|
#include "SharedMemoryCommands.h"
|
|
|
|
struct SharedMemoryBlock
|
|
{
|
|
int m_magicId;
|
|
struct SharedMemoryCommand m_clientCommands[SHARED_MEMORY_MAX_COMMANDS];
|
|
struct SharedMemoryStatus m_serverCommands[SHARED_MEMORY_MAX_COMMANDS];
|
|
|
|
int m_numClientCommands;
|
|
int m_numProcessedClientCommands;
|
|
|
|
int m_numServerCommands;
|
|
int m_numProcessedServerCommands;
|
|
|
|
|
|
//m_bulletStreamDataServerToClient is used to send (debug) data from server to client, for
|
|
//example to provide all details of a multibody including joint/link names, after loading a URDF file.
|
|
char m_bulletStreamDataServerToClientRefactor[SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE];
|
|
};
|
|
|
|
//http://stackoverflow.com/questions/24736304/unable-to-use-inline-in-declaration-get-error-c2054
|
|
#ifdef _WIN32
|
|
__inline
|
|
#else
|
|
inline
|
|
#endif
|
|
void
|
|
InitSharedMemoryBlock(struct SharedMemoryBlock* sharedMemoryBlock)
|
|
{
|
|
sharedMemoryBlock->m_numClientCommands = 0;
|
|
sharedMemoryBlock->m_numServerCommands = 0;
|
|
sharedMemoryBlock->m_numProcessedClientCommands = 0;
|
|
sharedMemoryBlock->m_numProcessedServerCommands = 0;
|
|
sharedMemoryBlock->m_magicId = SHARED_MEMORY_MAGIC_NUMBER;
|
|
}
|
|
|
|
#define SHARED_MEMORY_SIZE sizeof(SharedMemoryBlock)
|
|
|
|
#endif //SHARED_MEMORY_BLOCK_H
|