From 4c00b674b37f2b5c39b93284cbfc2a635e37f40b Mon Sep 17 00:00:00 2001 From: Matthew Endsley Date: Wed, 30 Aug 2017 01:12:45 -0700 Subject: [PATCH 01/38] Optimize Dbvt trees in place Instead of allocating new vectors for each partition, simply partion the nodes in place and pass the corresponding ranges to the next phase. --- .../BroadPhaseCollision/b3DynamicBvh.cpp | 110 +++++++++++------- .../BroadphaseCollision/btDbvt.cpp | 110 +++++++++++------- 2 files changed, 141 insertions(+), 79 deletions(-) diff --git a/src/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp b/src/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp index 16991bc04..0f04efe33 100644 --- a/src/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp +++ b/src/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp @@ -227,26 +227,59 @@ static void b3FetchLeaves(b3DynamicBvh* pdbvt, } } -// -static void b3Split( const b3NodeArray& leaves, - b3NodeArray& left, - b3NodeArray& right, +static bool b3LeftOfAxis( const b3DbvtNode* node, + const b3Vector3& org, + const b3Vector3& axis) +{ + return b3Dot(axis,node->volume.Center()-org) <= 0; +} + +// Partitions leaves such that leaves[0, n) are on the +// left of axis, and leaves[n, count) are on the right +// of axis. returns N. +static int b3Split( b3DbvtNode** leaves, + int count, const b3Vector3& org, const b3Vector3& axis) { - left.resize(0); - right.resize(0); - for(int i=0,ni=leaves.size();ivolume.Center()-org)<0) - left.push_back(leaves[i]); - else - right.push_back(leaves[i]); + while(begin!=end && b3LeftOfAxis(leaves[begin],org,axis)) + { + ++begin; + } + + if(begin==end) + { + break; + } + + while(begin!=end && !b3LeftOfAxis(leaves[end-1],org,axis)) + { + --end; + } + + if(begin==end) + { + break; + } + + // swap out of place nodes + --end; + b3DbvtNode* temp=leaves[begin]; + leaves[begin]=leaves[end]; + leaves[end]=temp; + ++begin; } + + return begin; } // -static b3DbvtVolume b3Bounds( const b3NodeArray& leaves) +static b3DbvtVolume b3Bounds( b3DbvtNode** leaves, + int count) { #if B3_DBVT_MERGE_IMPL==B3_DBVT_IMPL_SSE B3_ATTRIBUTE_ALIGNED16(char locals[sizeof(b3DbvtVolume)]); @@ -255,7 +288,7 @@ static b3DbvtVolume b3Bounds( const b3NodeArray& leaves) #else b3DbvtVolume volume=leaves[0]->volume; #endif - for(int i=1,ni=leaves.size();ivolume,volume); } @@ -264,15 +297,16 @@ static b3DbvtVolume b3Bounds( const b3NodeArray& leaves) // static void b3BottomUp( b3DynamicBvh* pdbvt, - b3NodeArray& leaves) + b3DbvtNode** leaves, + int count) { - while(leaves.size()>1) + while(count>1) { b3Scalar minsize=B3_INFINITY; int minidx[2]={-1,-1}; - for(int i=0;ivolume,leaves[j]->volume)); if(szparent = p; n[1]->parent = p; leaves[minidx[0]] = p; - leaves.swap(minidx[1],leaves.size()-1); - leaves.pop_back(); + leaves[minidx[1]] = leaves[count-1]; + --count; } } // static b3DbvtNode* b3TopDown(b3DynamicBvh* pdbvt, - b3NodeArray& leaves, + b3DbvtNode** leaves, + int count, int bu_treshold) { static const b3Vector3 axis[]={b3MakeVector3(1,0,0), b3MakeVector3(0,1,0), b3MakeVector3(0,0,1)}; - if(leaves.size()>1) + b3Assert(bu_treshold>1); + if(count>1) { - if(leaves.size()>bu_treshold) + if(count>bu_treshold) { - const b3DbvtVolume vol=b3Bounds(leaves); + const b3DbvtVolume vol=b3Bounds(leaves,count); const b3Vector3 org=vol.Center(); - b3NodeArray sets[2]; + int partition; int bestaxis=-1; - int bestmidp=leaves.size(); + int bestmidp=count; int splitcount[3][2]={{0,0},{0,0},{0,0}}; int i; - for( i=0;ivolume.Center()-org; for(int j=0;j<3;++j) @@ -336,29 +372,23 @@ static b3DbvtNode* b3TopDown(b3DynamicBvh* pdbvt, } if(bestaxis>=0) { - sets[0].reserve(splitcount[bestaxis][0]); - sets[1].reserve(splitcount[bestaxis][1]); - b3Split(leaves,sets[0],sets[1],org,axis[bestaxis]); + partition=b3Split(leaves,count,org,axis[bestaxis]); + b3Assert(partition!=0 && partition!=count); } else { - sets[0].reserve(leaves.size()/2+1); - sets[1].reserve(leaves.size()/2); - for(int i=0,ni=leaves.size();ichilds[0]=b3TopDown(pdbvt,sets[0],bu_treshold); - node->childs[1]=b3TopDown(pdbvt,sets[1],bu_treshold); + node->childs[0]=b3TopDown(pdbvt,&leaves[0],partition,bu_treshold); + node->childs[1]=b3TopDown(pdbvt,&leaves[partition],count-partition,bu_treshold); node->childs[0]->parent=node; node->childs[1]->parent=node; return(node); } else { - b3BottomUp(pdbvt,leaves); + b3BottomUp(pdbvt,leaves,count); return(leaves[0]); } } @@ -442,7 +472,7 @@ void b3DynamicBvh::optimizeBottomUp() b3NodeArray leaves; leaves.reserve(m_leaves); b3FetchLeaves(this,m_root,leaves); - b3BottomUp(this,leaves); + b3BottomUp(this,&leaves[0],leaves.size()); m_root=leaves[0]; } } @@ -455,7 +485,7 @@ void b3DynamicBvh::optimizeTopDown(int bu_treshold) b3NodeArray leaves; leaves.reserve(m_leaves); b3FetchLeaves(this,m_root,leaves); - m_root=b3TopDown(this,leaves,bu_treshold); + m_root=b3TopDown(this,&leaves[0],leaves.size(),bu_treshold); } } diff --git a/src/BulletCollision/BroadphaseCollision/btDbvt.cpp b/src/BulletCollision/BroadphaseCollision/btDbvt.cpp index 2ca20cdd8..d791d0741 100644 --- a/src/BulletCollision/BroadphaseCollision/btDbvt.cpp +++ b/src/BulletCollision/BroadphaseCollision/btDbvt.cpp @@ -229,25 +229,60 @@ static void fetchleaves(btDbvt* pdbvt, } // -static void split( const tNodeArray& leaves, - tNodeArray& left, - tNodeArray& right, +static bool leftOfAxis( const btDbvtNode* node, + const btVector3& org, + const btVector3& axis) +{ + return btDot(axis, node->volume.Center() - org) <= 0; +} + + +// Partitions leaves such that leaves[0, n) are on the +// left of axis, and leaves[n, count) are on the right +// of axis. returns N. +static int split( btDbvtNode** leaves, + int count, const btVector3& org, const btVector3& axis) { - left.resize(0); - right.resize(0); - for(int i=0,ni=leaves.size();ivolume.Center()-org)<0) - left.push_back(leaves[i]); - else - right.push_back(leaves[i]); + while(begin!=end && leftOfAxis(leaves[begin],org,axis)) + { + ++begin; + } + + if(begin==end) + { + break; + } + + while(begin!=end && !leftOfAxis(leaves[end-1],org,axis)) + { + --end; + } + + if(begin==end) + { + break; + } + + // swap out of place nodes + --end; + btDbvtNode* temp=leaves[begin]; + leaves[begin]=leaves[end]; + leaves[end]=temp; + ++begin; } + + return begin; } // -static btDbvtVolume bounds( const tNodeArray& leaves) +static btDbvtVolume bounds( btDbvtNode** leaves, + int count) { #if DBVT_MERGE_IMPL==DBVT_IMPL_SSE ATTRIBUTE_ALIGNED16(char locals[sizeof(btDbvtVolume)]); @@ -257,7 +292,7 @@ static btDbvtVolume bounds( const tNodeArray& leaves) #else btDbvtVolume volume=leaves[0]->volume; #endif - for(int i=1,ni=leaves.size();ivolume,volume); } @@ -266,15 +301,16 @@ static btDbvtVolume bounds( const tNodeArray& leaves) // static void bottomup( btDbvt* pdbvt, - tNodeArray& leaves) + btDbvtNode** leaves, + int count) { - while(leaves.size()>1) + while(count>1) { btScalar minsize=SIMD_INFINITY; int minidx[2]={-1,-1}; - for(int i=0;ivolume,leaves[j]->volume)); if(szparent = p; n[1]->parent = p; leaves[minidx[0]] = p; - leaves.swap(minidx[1],leaves.size()-1); - leaves.pop_back(); + leaves[minidx[1]] = leaves[count-1]; + --count; } } // static btDbvtNode* topdown(btDbvt* pdbvt, - tNodeArray& leaves, + btDbvtNode** leaves, + int count, int bu_treshold) { static const btVector3 axis[]={btVector3(1,0,0), btVector3(0,1,0), btVector3(0,0,1)}; - if(leaves.size()>1) + btAssert(bu_treshold>2); + if(count>1) { - if(leaves.size()>bu_treshold) + if(count>bu_treshold) { - const btDbvtVolume vol=bounds(leaves); + const btDbvtVolume vol=bounds(leaves,count); const btVector3 org=vol.Center(); - tNodeArray sets[2]; + int partition; int bestaxis=-1; - int bestmidp=leaves.size(); + int bestmidp=count; int splitcount[3][2]={{0,0},{0,0},{0,0}}; int i; - for( i=0;ivolume.Center()-org; for(int j=0;j<3;++j) @@ -338,29 +376,23 @@ static btDbvtNode* topdown(btDbvt* pdbvt, } if(bestaxis>=0) { - sets[0].reserve(splitcount[bestaxis][0]); - sets[1].reserve(splitcount[bestaxis][1]); - split(leaves,sets[0],sets[1],org,axis[bestaxis]); + partition=split(leaves,count,org,axis[bestaxis]); + btAssert(partition!=0 && partition!=count); } else { - sets[0].reserve(leaves.size()/2+1); - sets[1].reserve(leaves.size()/2); - for(int i=0,ni=leaves.size();ichilds[0]=topdown(pdbvt,sets[0],bu_treshold); - node->childs[1]=topdown(pdbvt,sets[1],bu_treshold); + node->childs[0]=topdown(pdbvt,&leaves[0],partition,bu_treshold); + node->childs[1]=topdown(pdbvt,&leaves[partition],count-partition,bu_treshold); node->childs[0]->parent=node; node->childs[1]->parent=node; return(node); } else { - bottomup(pdbvt,leaves); + bottomup(pdbvt,leaves,count); return(leaves[0]); } } @@ -444,7 +476,7 @@ void btDbvt::optimizeBottomUp() tNodeArray leaves; leaves.reserve(m_leaves); fetchleaves(this,m_root,leaves); - bottomup(this,leaves); + bottomup(this,&leaves[0],leaves.size()); m_root=leaves[0]; } } @@ -457,7 +489,7 @@ void btDbvt::optimizeTopDown(int bu_treshold) tNodeArray leaves; leaves.reserve(m_leaves); fetchleaves(this,m_root,leaves); - m_root=topdown(this,leaves,bu_treshold); + m_root=topdown(this,&leaves[0],leaves.size(),bu_treshold); } } From 6a7efac4c3afc0b6dc13590f3b28c687a40046b4 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Wed, 20 Sep 2017 23:18:18 -0700 Subject: [PATCH 02/38] Quick first prototype/test to integrate pybullet into Unity, see readme.txt for details. --- examples/SharedMemory/PhysicsClientC_API.cpp | 20 +- examples/SharedMemory/PhysicsClientC_API.h | 112 +- .../PhysicsClientSharedMemory_C_API.cpp | 2 +- .../PhysicsClientSharedMemory_C_API.h | 2 +- .../SharedMemoryInProcessPhysicsC_API.cpp | 10 +- .../SharedMemoryInProcessPhysicsC_API.h | 10 +- .../pybullet/unity3d/autogen/NativeMethods.cs | 3113 +++++++++++++++++ .../unity3d/examples/NewBehaviourScript.cs | 86 + .../examples/NewBehaviourScript.cs.meta | 12 + examples/pybullet/unity3d/readme.txt | 33 + 10 files changed, 3324 insertions(+), 76 deletions(-) create mode 100644 examples/pybullet/unity3d/autogen/NativeMethods.cs create mode 100644 examples/pybullet/unity3d/examples/NewBehaviourScript.cs create mode 100644 examples/pybullet/unity3d/examples/NewBehaviourScript.cs.meta create mode 100644 examples/pybullet/unity3d/readme.txt diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 46c4ae0be..04eb59007 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -53,7 +53,7 @@ b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physCli return (b3SharedMemoryCommandHandle) command; } -b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -212,7 +212,7 @@ int b3LoadBunnySetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, dou return 0; } -int b3LoadUrdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody) +B3_SHARED_API int b3LoadUrdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -223,7 +223,7 @@ int b3LoadUrdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, return 0; } -int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling) +B3_SHARED_API int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -259,7 +259,7 @@ int b3LoadSdfCommandSetUseGlobalScaling(b3SharedMemoryCommandHandle commandHandl -int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle, int useFixedBase) +B3_SHARED_API int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle, int useFixedBase) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -273,7 +273,7 @@ int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle, return -1; } -int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags) +B3_SHARED_API int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -286,7 +286,7 @@ int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int fla return 0; } -int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ) +B3_SHARED_API int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -305,7 +305,7 @@ int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, return -1; } -int b3LoadUrdfCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW) +B3_SHARED_API int b3LoadUrdfCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -495,7 +495,7 @@ int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandl } -b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -507,7 +507,7 @@ b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle ph return (b3SharedMemoryCommandHandle) command; } -b3SharedMemoryCommandHandle b3InitResetSimulationCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitResetSimulationCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1631,7 +1631,7 @@ int b3SubmitClientCommand(b3PhysicsClientHandle physClient, const b3SharedMemory #include "../Utils/b3Clock.h" -b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, const b3SharedMemoryCommandHandle commandHandle) +B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, const b3SharedMemoryCommandHandle commandHandle) { B3_PROFILE("b3SubmitClientCommandAndWaitStatus"); b3Clock clock; diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index 04105e701..137561d84 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -10,6 +10,10 @@ B3_DECLARE_HANDLE(b3PhysicsClientHandle); B3_DECLARE_HANDLE(b3SharedMemoryCommandHandle); B3_DECLARE_HANDLE(b3SharedMemoryStatusHandle); +#ifdef _WIN32 +#define B3_SHARED_API __declspec(dllexport) +#endif + ///There are several connection methods, see following header files: #include "PhysicsClientSharedMemory_C_API.h" @@ -39,7 +43,7 @@ void b3DisconnectSharedMemory(b3PhysicsClientHandle physClient); int b3CanSubmitCommand(b3PhysicsClientHandle physClient); ///blocking submit command and wait for status -b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle); +B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle); ///In general it is better to use b3SubmitClientCommandAndWaitStatus. b3SubmitClientCommand is a non-blocking submit ///command, which requires checking for the status manually, using b3ProcessServerStatus. Also, before sending the @@ -67,7 +71,7 @@ int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId); -int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[3], double aabbMax[3]); +int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[/*3*/], double aabbMax[/*3*/]); ///If you re-connected to an existing server, or server changed otherwise, sync the body info and user constraints etc. b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient); @@ -111,8 +115,8 @@ int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle); ///change parameters of an existing user constraint b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId); -int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double jointChildPivot[3]); -int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double jointChildFrameOrn[4]); +int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double jointChildPivot[/*3*/]); +int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double jointChildFrameOrn[/*4*/]); int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce); int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio); int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink); @@ -135,18 +139,18 @@ void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* l ///configure the 3D OpenGL debug visualizer (enable/disable GUI widgets, shadows, position camera etc) b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandle physClient); void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandle commandHandle, int flag, int enabled); -void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[3]); +void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[/*3*/]); b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3PhysicsClientHandle physClient); int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, struct b3OpenGLVisualizerCameraInfo* camera); /// Add/remove user-specific debug lines and debug text messages -b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, double fromXYZ[3], double toXYZ[3], double colorRGB[3], double lineWidth, double lifeTime); +b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, double fromXYZ[/*3*/], double toXYZ[/*3*/], double colorRGB[/*3*/], double lineWidth, double lifeTime); -b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, double positionXYZ[3], double colorRGB[3], double textSize, double lifeTime); +b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, double positionXYZ[/*3*/], double colorRGB[/*3*/], double textSize, double lifeTime); void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, int optionFlags); -void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, double orientation[4]); +void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, double orientation[/*4*/]); void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex); @@ -158,7 +162,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle phys b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle physClient); b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle physClient); -void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, double objectColorRGB[3]); +void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, double objectColorRGB[/*3*/]); void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex); ///All debug items unique Ids are positive: a negative unique Id means failure. @@ -167,10 +171,10 @@ int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle); ///request an image from a simulated camera, using a software renderer. b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient); -void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle command, float viewMatrix[16], float projectionMatrix[16]); +void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle command, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]); void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle command, int width, int height ); -void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[3]); -void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[3]); +void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[/*3*/]); +void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[/*3*/]); void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance); void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle commandHandle, float lightAmbientCoeff); void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle commandHandle, float lightDiffuseCoeff); @@ -180,19 +184,19 @@ void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandl void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImageData* imageData); ///compute a view matrix, helper function for b3RequestCameraImageSetCameraMatrices -void b3ComputeViewMatrixFromPositions(const float cameraPosition[3], const float cameraTargetPosition[3], const float cameraUp[3], float viewMatrix[16]); -void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[3], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[16]); -void b3ComputePositionFromViewMatrix(const float viewMatrix[16], float cameraPosition[3], float cameraTargetPosition[3], float cameraUp[3]); +void b3ComputeViewMatrixFromPositions(const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/], float viewMatrix[/*16*/]); +void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[/*16*/]); +void b3ComputePositionFromViewMatrix(const float viewMatrix[/*16*/], float cameraPosition[/*3*/], float cameraTargetPosition[/*3*/], float cameraUp[/*3*/]); ///compute a projection matrix, helper function for b3RequestCameraImageSetCameraMatrices -void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[16]); -void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[16]); +void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[/*16*/]); +void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[/*16*/]); /* obsolete, please use b3ComputeViewProjectionMatrices */ -void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle command, const float cameraPosition[3], const float cameraTargetPosition[3], const float cameraUp[3]); +void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle command, const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/]); /* obsolete, please use b3ComputeViewProjectionMatrices */ -void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[3], float distance, float yaw, float pitch, float roll, int upAxis); +void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis); /* obsolete, please use b3ComputeViewProjectionMatrices */ void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle command, float left, float right, float bottom, float top, float nearVal, float farVal); /* obsolete, please use b3ComputeViewProjectionMatrices */ @@ -217,7 +221,7 @@ void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, do void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo); ///get all the bodies that touch a given axis aligned bounding box specified in world space (min and max coordinates) -b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[3],const double aabbMax[3]); +b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[/*3*/],const double aabbMax[/*3*/]); void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOverlapData* data); //request visual shape information @@ -230,8 +234,8 @@ int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle); b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHandle physClient, int textureUniqueId, int width, int height, const char* rgbPixels); b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId); -void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, double rgbaColor[4]); -void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, double specularColor[3]); +void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, double rgbaColor[/*4*/]); +void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, double specularColor[/*3*/]); b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle physClient); @@ -262,20 +266,20 @@ int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle co int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHandle, int flags); -b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient); -b3SharedMemoryCommandHandle b3InitResetSimulationCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitResetSimulationCommand(b3PhysicsClientHandle physClient); ///Load a robot from a URDF file. Status type will CMD_URDF_LOADING_COMPLETED. ///Access the robot from the unique body index, through b3GetStatusBodyIndex(statusHandle); -b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName); +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName); -int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); -int b3LoadUrdfCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); -int b3LoadUrdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody); -int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle, int useFixedBase); -int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags); -int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling); +B3_SHARED_API int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); +B3_SHARED_API int b3LoadUrdfCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); +B3_SHARED_API int b3LoadUrdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody); +B3_SHARED_API int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle, int useFixedBase); +B3_SHARED_API int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags); +B3_SHARED_API int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling); @@ -300,10 +304,10 @@ int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJ ///compute the joint positions to move the end effector to a desired target using inverse kinematics b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); -void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[3]); -void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[3], const double targetOrientation[4]); -void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[3], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); -void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[3], const double targetOrientation[4], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); +void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/]); +void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/]); +void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); +void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* jointDampingCoeff); int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, @@ -345,14 +349,14 @@ int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandl b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHandle physClient); int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle,double radius); -int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,double halfExtents[3]); +int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,double halfExtents[/*3*/]); int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle,double radius, double height); int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle,double radius, double height); -int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, double planeNormal[3], double planeConstant); -int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,const char* fileName, double meshScale[3]); +int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, double planeNormal[/*3*/], double planeConstant); +int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,const char* fileName, double meshScale[/*3*/]); void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, int flags); -void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, double childPosition[3], double childOrientation[4]); +void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, double childPosition[/*3*/], double childOrientation[/*4*/]); int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle); @@ -360,17 +364,17 @@ b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle); b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle physClient); -int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, double basePosition[3], double baseOrientation[4] , double baseInertialFramePosition[3], double baseInertialFrameOrientation[4]); +int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, double basePosition[/*3*/], double baseOrientation[/*4*/] , double baseInertialFramePosition[/*3*/], double baseInertialFrameOrientation[/*4*/]); int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double linkMass, double linkCollisionShapeIndex, double linkVisualShapeIndex, - double linkPosition[3], - double linkOrientation[4], - double linkInertialFramePosition[3], - double linkInertialFrameOrientation[4], + double linkPosition[/*3*/], + double linkOrientation[/*4*/], + double linkInertialFramePosition[/*3*/], + double linkInertialFrameOrientation[/*4*/], int linkParentIndex, int linkJointType, - double linkJointAxis[3]); + double linkJointAxis[/*3*/]); //useMaximalCoordinates are disabled by default, enabling them is experimental and not fully supported yet @@ -397,8 +401,8 @@ int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, do b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); -int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, double linVel[3]); -int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, double angVel[3]); +int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, double linVel[/*3*/]); +int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, double angVel[/*3*/]); int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* jointPositions); int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointPosition); @@ -434,7 +438,7 @@ b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle phy double rayToWorldX, double rayToWorldY, double rayToWorldZ); b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient); -void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[3], const double rayToWorld[3]); +void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[/*3*/], const double rayToWorld[/*3*/]); void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo); @@ -442,8 +446,8 @@ void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastI /// Apply external force at the body (or link) center of mass, in world space/Cartesian coordinates. b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient); -void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[3], const double position[3], int flags); -void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[3], int flags); +void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[/*3*/], const double position[/*3*/], int flags); +void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[/*3*/], int flags); ///experiments of robots interacting with non-rigid objects (such as btSoftBody) b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physClient); @@ -458,8 +462,8 @@ void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, in void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* vrEventsData); b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle physClient); -int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double rootPos[3]); -int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, double rootOrn[4]); +int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double rootPos[/*3*/]); +int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, double rootOrn[/*4*/]); int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId); int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, int flag); @@ -493,8 +497,8 @@ double b3GetTimeOut(b3PhysicsClientHandle physClient); b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle physClient, char* path); -void b3MultiplyTransforms(const double posA[3], const double ornA[4], const double posB[3], const double ornB[4], double outPos[3], double outOrn[4]); -void b3InvertTransform(const double pos[3], const double orn[4], double outPos[3], double outOrn[4]); +void b3MultiplyTransforms(const double posA[/*3*/], const double ornA[/*4*/], const double posB[/*3*/], const double ornB[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]); +void b3InvertTransform(const double pos[/*3*/], const double orn[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]); #ifdef __cplusplus } diff --git a/examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp b/examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp index 36c794f80..eedcb0160 100644 --- a/examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp +++ b/examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp @@ -2,7 +2,7 @@ #include "PhysicsClientSharedMemory.h" -b3PhysicsClientHandle b3ConnectSharedMemory(int key) +B3_SHARED_API b3PhysicsClientHandle b3ConnectSharedMemory(int key) { PhysicsClientSharedMemory* cl = new PhysicsClientSharedMemory(); cl->setSharedMemoryKey(key); diff --git a/examples/SharedMemory/PhysicsClientSharedMemory_C_API.h b/examples/SharedMemory/PhysicsClientSharedMemory_C_API.h index 2a4e4e665..44f9997d7 100644 --- a/examples/SharedMemory/PhysicsClientSharedMemory_C_API.h +++ b/examples/SharedMemory/PhysicsClientSharedMemory_C_API.h @@ -7,7 +7,7 @@ extern "C" { #endif - b3PhysicsClientHandle b3ConnectSharedMemory(int key); +B3_SHARED_API b3PhysicsClientHandle b3ConnectSharedMemory(int key); #ifdef __cplusplus } diff --git a/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp b/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp index b82d550a6..3c13898ba 100644 --- a/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp +++ b/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp @@ -83,7 +83,7 @@ public: }; -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[]) +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[]) { InProcessPhysicsClientSharedMemoryMainThread* cl = new InProcessPhysicsClientSharedMemoryMainThread(argc, argv, 1); cl->setSharedMemoryKey(SHARED_MEMORY_KEY+1); @@ -91,7 +91,7 @@ b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int arg return (b3PhysicsClientHandle ) cl; } -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, char* argv[]) +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, char* argv[]) { InProcessPhysicsClientSharedMemoryMainThread* cl = new InProcessPhysicsClientSharedMemoryMainThread(argc, argv, 0); cl->setSharedMemoryKey(SHARED_MEMORY_KEY+1); @@ -133,7 +133,7 @@ public: }; -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[]) +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[]) { InProcessPhysicsClientSharedMemory* cl = new InProcessPhysicsClientSharedMemory(argc, argv, 1); @@ -141,7 +141,7 @@ b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* a cl->connect(); return (b3PhysicsClientHandle ) cl; } -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, char* argv[]) +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, char* argv[]) { InProcessPhysicsClientSharedMemory* cl = new InProcessPhysicsClientSharedMemory(argc, argv, 0); @@ -248,7 +248,7 @@ int b3InProcessMouseButtonCallback(b3PhysicsClientHandle clientHandle, int butto } -b3PhysicsClientHandle b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(void* guiHelperPtr) +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(void* guiHelperPtr) { GUIHelperInterface* guiHelper = (GUIHelperInterface*) guiHelperPtr; InProcessPhysicsClientExistingExampleBrowser* cl = new InProcessPhysicsClientExistingExampleBrowser(guiHelper); diff --git a/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.h b/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.h index 04acba313..9f2a82be0 100644 --- a/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.h +++ b/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.h @@ -10,13 +10,13 @@ extern "C" { ///think more about naming. The b3ConnectPhysicsLoopback -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[]); -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, char* argv[]); +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[]); +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, char* argv[]); -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[]); -b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, char* argv[]); +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[]); +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, char* argv[]); -b3PhysicsClientHandle b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(void* guiHelperPtr); +B3_SHARED_API b3PhysicsClientHandle b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(void* guiHelperPtr); ///ignore the following APIs, they are for internal use for example browser void b3InProcessRenderSceneInternal(b3PhysicsClientHandle clientHandle); diff --git a/examples/pybullet/unity3d/autogen/NativeMethods.cs b/examples/pybullet/unity3d/autogen/NativeMethods.cs new file mode 100644 index 000000000..b0d3521e6 --- /dev/null +++ b/examples/pybullet/unity3d/autogen/NativeMethods.cs @@ -0,0 +1,3113 @@ + +public partial class NativeConstants { + + /// PHYSICS_CLIENT_C_API_H -> + /// Error generating expression: Value cannot be null. + ///Parameter name: node + public const string PHYSICS_CLIENT_C_API_H = ""; + + /// SHARED_MEMORY_PUBLIC_H -> + /// Error generating expression: Value cannot be null. + ///Parameter name: node + public const string SHARED_MEMORY_PUBLIC_H = ""; + + /// SHARED_MEMORY_KEY -> 12347 + public const int SHARED_MEMORY_KEY = 12347; + + /// SHARED_MEMORY_MAGIC_NUMBER -> 201708270 + public const int SHARED_MEMORY_MAGIC_NUMBER = 201708270; + + /// MAX_VR_BUTTONS -> 64 + public const int MAX_VR_BUTTONS = 64; + + /// MAX_VR_CONTROLLERS -> 8 + public const int MAX_VR_CONTROLLERS = 8; + + /// MAX_RAY_INTERSECTION_BATCH_SIZE -> 256 + public const int MAX_RAY_INTERSECTION_BATCH_SIZE = 256; + + /// MAX_RAY_HITS -> MAX_RAY_INTERSECTION_BATCH_SIZE + public const int MAX_RAY_HITS = NativeConstants.MAX_RAY_INTERSECTION_BATCH_SIZE; + + /// MAX_KEYBOARD_EVENTS -> 256 + public const int MAX_KEYBOARD_EVENTS = 256; + + /// MAX_MOUSE_EVENTS -> 256 + public const int MAX_MOUSE_EVENTS = 256; + + /// VISUAL_SHAPE_MAX_PATH_LEN -> 1024 + public const int VISUAL_SHAPE_MAX_PATH_LEN = 1024; + + /// Warning: Generation of Method Macros is not supported at this time + /// B3_DECLARE_HANDLE -> "(name) typedef struct name##__ { int unused; } *name" + public const string B3_DECLARE_HANDLE = "(name) typedef struct name##__ { int unused; } *name"; + + /// PHYSICS_CLIENT_SHARED_MEMORY_H -> + /// Error generating expression: Value cannot be null. + ///Parameter name: node + public const string PHYSICS_CLIENT_SHARED_MEMORY_H = ""; + + /// PHYSICS_CLIENT_SHARED_MEMORY2_H -> + /// Error generating expression: Value cannot be null. + ///Parameter name: node + public const string PHYSICS_CLIENT_SHARED_MEMORY2_H = ""; + + /// PHYSICS_DIRECT_C_API_H -> + /// Error generating expression: Value cannot be null. + ///Parameter name: node + public const string PHYSICS_DIRECT_C_API_H = ""; + + /// IN_PROCESS_PHYSICS_C_API_H -> + /// Error generating expression: Value cannot be null. + ///Parameter name: node + public const string IN_PROCESS_PHYSICS_C_API_H = ""; +} + +public enum EnumSharedMemoryClientCommand { + + CMD_LOAD_SDF, + + CMD_LOAD_URDF, + + CMD_LOAD_BULLET, + + CMD_SAVE_BULLET, + + CMD_LOAD_MJCF, + + CMD_LOAD_BUNNY, + + CMD_SEND_BULLET_DATA_STREAM, + + CMD_CREATE_BOX_COLLISION_SHAPE, + + CMD_CREATE_RIGID_BODY, + + CMD_DELETE_RIGID_BODY, + + CMD_CREATE_SENSOR, + + CMD_INIT_POSE, + + CMD_SEND_PHYSICS_SIMULATION_PARAMETERS, + + CMD_SEND_DESIRED_STATE, + + CMD_REQUEST_ACTUAL_STATE, + + CMD_REQUEST_DEBUG_LINES, + + CMD_REQUEST_BODY_INFO, + + CMD_REQUEST_INTERNAL_DATA, + + CMD_STEP_FORWARD_SIMULATION, + + CMD_RESET_SIMULATION, + + CMD_PICK_BODY, + + CMD_MOVE_PICKED_BODY, + + CMD_REMOVE_PICKING_CONSTRAINT_BODY, + + CMD_REQUEST_CAMERA_IMAGE_DATA, + + CMD_APPLY_EXTERNAL_FORCE, + + CMD_CALCULATE_INVERSE_DYNAMICS, + + CMD_CALCULATE_INVERSE_KINEMATICS, + + CMD_CALCULATE_JACOBIAN, + + CMD_USER_CONSTRAINT, + + CMD_REQUEST_CONTACT_POINT_INFORMATION, + + CMD_REQUEST_RAY_CAST_INTERSECTIONS, + + CMD_REQUEST_AABB_OVERLAP, + + CMD_SAVE_WORLD, + + CMD_REQUEST_VISUAL_SHAPE_INFO, + + CMD_UPDATE_VISUAL_SHAPE, + + CMD_LOAD_TEXTURE, + + CMD_SET_SHADOW, + + CMD_USER_DEBUG_DRAW, + + CMD_REQUEST_VR_EVENTS_DATA, + + CMD_SET_VR_CAMERA_STATE, + + CMD_SYNC_BODY_INFO, + + CMD_STATE_LOGGING, + + CMD_CONFIGURE_OPENGL_VISUALIZER, + + CMD_REQUEST_KEYBOARD_EVENTS_DATA, + + CMD_REQUEST_OPENGL_VISUALIZER_CAMERA, + + CMD_REMOVE_BODY, + + CMD_CHANGE_DYNAMICS_INFO, + + CMD_GET_DYNAMICS_INFO, + + CMD_PROFILE_TIMING, + + CMD_CREATE_COLLISION_SHAPE, + + CMD_CREATE_VISUAL_SHAPE, + + CMD_CREATE_MULTI_BODY, + + CMD_REQUEST_COLLISION_INFO, + + CMD_REQUEST_MOUSE_EVENTS_DATA, + + CMD_CHANGE_TEXTURE, + + CMD_SET_ADDITIONAL_SEARCH_PATH, + + CMD_MAX_CLIENT_COMMANDS, +} + +public enum EnumSharedMemoryServerStatus { + + /// CMD_SHARED_MEMORY_NOT_INITIALIZED -> 0 + CMD_SHARED_MEMORY_NOT_INITIALIZED = 0, + + CMD_WAITING_FOR_CLIENT_COMMAND, + + CMD_CLIENT_COMMAND_COMPLETED, + + CMD_UNKNOWN_COMMAND_FLUSHED, + + CMD_SDF_LOADING_COMPLETED, + + CMD_SDF_LOADING_FAILED, + + CMD_URDF_LOADING_COMPLETED, + + CMD_URDF_LOADING_FAILED, + + CMD_BULLET_LOADING_COMPLETED, + + CMD_BULLET_LOADING_FAILED, + + CMD_BULLET_SAVING_COMPLETED, + + CMD_BULLET_SAVING_FAILED, + + CMD_MJCF_LOADING_COMPLETED, + + CMD_MJCF_LOADING_FAILED, + + CMD_REQUEST_INTERNAL_DATA_COMPLETED, + + CMD_REQUEST_INTERNAL_DATA_FAILED, + + CMD_BULLET_DATA_STREAM_RECEIVED_COMPLETED, + + CMD_BULLET_DATA_STREAM_RECEIVED_FAILED, + + CMD_BOX_COLLISION_SHAPE_CREATION_COMPLETED, + + CMD_RIGID_BODY_CREATION_COMPLETED, + + CMD_SET_JOINT_FEEDBACK_COMPLETED, + + CMD_ACTUAL_STATE_UPDATE_COMPLETED, + + CMD_ACTUAL_STATE_UPDATE_FAILED, + + CMD_DEBUG_LINES_COMPLETED, + + CMD_DEBUG_LINES_OVERFLOW_FAILED, + + CMD_DESIRED_STATE_RECEIVED_COMPLETED, + + CMD_STEP_FORWARD_SIMULATION_COMPLETED, + + CMD_RESET_SIMULATION_COMPLETED, + + CMD_CAMERA_IMAGE_COMPLETED, + + CMD_CAMERA_IMAGE_FAILED, + + CMD_BODY_INFO_COMPLETED, + + CMD_BODY_INFO_FAILED, + + CMD_INVALID_STATUS, + + CMD_CALCULATED_INVERSE_DYNAMICS_COMPLETED, + + CMD_CALCULATED_INVERSE_DYNAMICS_FAILED, + + CMD_CALCULATED_JACOBIAN_COMPLETED, + + CMD_CALCULATED_JACOBIAN_FAILED, + + CMD_CONTACT_POINT_INFORMATION_COMPLETED, + + CMD_CONTACT_POINT_INFORMATION_FAILED, + + CMD_REQUEST_AABB_OVERLAP_COMPLETED, + + CMD_REQUEST_AABB_OVERLAP_FAILED, + + CMD_CALCULATE_INVERSE_KINEMATICS_COMPLETED, + + CMD_CALCULATE_INVERSE_KINEMATICS_FAILED, + + CMD_SAVE_WORLD_COMPLETED, + + CMD_SAVE_WORLD_FAILED, + + CMD_VISUAL_SHAPE_INFO_COMPLETED, + + CMD_VISUAL_SHAPE_INFO_FAILED, + + CMD_VISUAL_SHAPE_UPDATE_COMPLETED, + + CMD_VISUAL_SHAPE_UPDATE_FAILED, + + CMD_LOAD_TEXTURE_COMPLETED, + + CMD_LOAD_TEXTURE_FAILED, + + CMD_USER_DEBUG_DRAW_COMPLETED, + + CMD_USER_DEBUG_DRAW_PARAMETER_COMPLETED, + + CMD_USER_DEBUG_DRAW_FAILED, + + CMD_USER_CONSTRAINT_COMPLETED, + + CMD_USER_CONSTRAINT_INFO_COMPLETED, + + CMD_REMOVE_USER_CONSTRAINT_COMPLETED, + + CMD_CHANGE_USER_CONSTRAINT_COMPLETED, + + CMD_REMOVE_USER_CONSTRAINT_FAILED, + + CMD_CHANGE_USER_CONSTRAINT_FAILED, + + CMD_USER_CONSTRAINT_FAILED, + + CMD_REQUEST_VR_EVENTS_DATA_COMPLETED, + + CMD_REQUEST_RAY_CAST_INTERSECTIONS_COMPLETED, + + CMD_SYNC_BODY_INFO_COMPLETED, + + CMD_SYNC_BODY_INFO_FAILED, + + CMD_STATE_LOGGING_COMPLETED, + + CMD_STATE_LOGGING_START_COMPLETED, + + CMD_STATE_LOGGING_FAILED, + + CMD_REQUEST_KEYBOARD_EVENTS_DATA_COMPLETED, + + CMD_REQUEST_KEYBOARD_EVENTS_DATA_FAILED, + + CMD_REQUEST_OPENGL_VISUALIZER_CAMERA_FAILED, + + CMD_REQUEST_OPENGL_VISUALIZER_CAMERA_COMPLETED, + + CMD_REMOVE_BODY_COMPLETED, + + CMD_REMOVE_BODY_FAILED, + + CMD_GET_DYNAMICS_INFO_COMPLETED, + + CMD_GET_DYNAMICS_INFO_FAILED, + + CMD_CREATE_COLLISION_SHAPE_FAILED, + + CMD_CREATE_COLLISION_SHAPE_COMPLETED, + + CMD_CREATE_VISUAL_SHAPE_FAILED, + + CMD_CREATE_VISUAL_SHAPE_COMPLETED, + + CMD_CREATE_MULTI_BODY_FAILED, + + CMD_CREATE_MULTI_BODY_COMPLETED, + + CMD_REQUEST_COLLISION_INFO_COMPLETED, + + CMD_REQUEST_COLLISION_INFO_FAILED, + + CMD_REQUEST_MOUSE_EVENTS_DATA_COMPLETED, + + CMD_CHANGE_TEXTURE_COMMAND_FAILED, + + CMD_MAX_SERVER_COMMANDS, +} + +public enum JointInfoFlags { + + /// JOINT_HAS_MOTORIZED_POWER -> 1 + JOINT_HAS_MOTORIZED_POWER = 1, +} + +public enum JointType { + + /// eRevoluteType -> 0 + eRevoluteType = 0, + + /// ePrismaticType -> 1 + ePrismaticType = 1, + + /// eSphericalType -> 2 + eSphericalType = 2, + + /// ePlanarType -> 3 + ePlanarType = 3, + + /// eFixedType -> 4 + eFixedType = 4, + + /// ePoint2PointType -> 5 + ePoint2PointType = 5, + + /// eGearType -> 6 + eGearType = 6, +} + +public enum b3JointInfoFlags { + + /// eJointChangeMaxForce -> 1 + eJointChangeMaxForce = 1, + + /// eJointChangeChildFramePosition -> 2 + eJointChangeChildFramePosition = 2, + + /// eJointChangeChildFrameOrientation -> 4 + eJointChangeChildFrameOrientation = 4, +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3JointInfo { + + /// char* + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] + public string m_linkName; + + /// char* + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] + public string m_jointName; + + /// int + public int m_jointType; + + /// int + public int m_qIndex; + + /// int + public int m_uIndex; + + /// int + public int m_jointIndex; + + /// int + public int m_flags; + + /// double + public double m_jointDamping; + + /// double + public double m_jointFriction; + + /// double + public double m_jointLowerLimit; + + /// double + public double m_jointUpperLimit; + + /// double + public double m_jointMaxForce; + + /// double + public double m_jointMaxVelocity; + + /// double[7] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=7, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_parentFrame; + + /// double[7] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=7, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_childFrame; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_jointAxis; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3UserConstraint { + + /// int + public int m_parentBodyIndex; + + /// int + public int m_parentJointIndex; + + /// int + public int m_childBodyIndex; + + /// int + public int m_childJointIndex; + + /// double[7] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=7, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_parentFrame; + + /// double[7] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=7, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_childFrame; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_jointAxis; + + /// int + public int m_jointType; + + /// double + public double m_maxAppliedForce; + + /// int + public int m_userConstraintUniqueId; + + /// double + public double m_gearRatio; + + /// int + public int m_gearAuxLink; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3BodyInfo { + + /// char* + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] + public string m_baseName; + + /// char* + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] + public string m_bodyName; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3DynamicsInfo { + + /// double + public double m_mass; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_localInertialPosition; + + /// double + public double m_lateralFrictionCoeff; +} + +public enum SensorType { + + /// eSensorForceTorqueType -> 1 + eSensorForceTorqueType = 1, +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3JointSensorState { + + /// double + public double m_jointPosition; + + /// double + public double m_jointVelocity; + + /// double[6] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=6, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_jointForceTorque; + + /// double + public double m_jointMotorTorque; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3DebugLines { + + /// int + public int m_numDebugLines; + + /// float* + public System.IntPtr m_linesFrom; + + /// float* + public System.IntPtr m_linesTo; + + /// float* + public System.IntPtr m_linesColor; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3OverlappingObject { + + /// int + public int m_objectUniqueId; + + /// int + public int m_linkIndex; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3AABBOverlapData { + + /// int + public int m_numOverlappingObjects; + + /// b3OverlappingObject* + public System.IntPtr m_overlappingObjects; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3CameraImageData { + + /// int + public int m_pixelWidth; + + /// int + public int m_pixelHeight; + + /// char* + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] + public string m_rgbColorData; + + /// float* + public System.IntPtr m_depthValues; + + /// int* + public System.IntPtr m_segmentationMaskValues; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3OpenGLVisualizerCameraInfo { + + /// int + public int m_width; + + /// int + public int m_height; + + /// float[16] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=16, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_viewMatrix; + + /// float[16] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=16, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_projectionMatrix; + + /// float[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_camUp; + + /// float[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_camForward; + + /// float[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_horizontal; + + /// float[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_vertical; + + /// float + public float m_yaw; + + /// float + public float m_pitch; + + /// float + public float m_dist; + + /// float[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_target; +} + +public enum b3VREventType { + + /// VR_CONTROLLER_MOVE_EVENT -> 1 + VR_CONTROLLER_MOVE_EVENT = 1, + + /// VR_CONTROLLER_BUTTON_EVENT -> 2 + VR_CONTROLLER_BUTTON_EVENT = 2, + + /// VR_HMD_MOVE_EVENT -> 4 + VR_HMD_MOVE_EVENT = 4, + + /// VR_GENERIC_TRACKER_MOVE_EVENT -> 8 + VR_GENERIC_TRACKER_MOVE_EVENT = 8, +} + +public enum b3VRButtonInfo { + + /// eButtonIsDown -> 1 + eButtonIsDown = 1, + + /// eButtonTriggered -> 2 + eButtonTriggered = 2, + + /// eButtonReleased -> 4 + eButtonReleased = 4, +} + +public enum eVRDeviceTypeEnums { + + /// VR_DEVICE_CONTROLLER -> 1 + VR_DEVICE_CONTROLLER = 1, + + /// VR_DEVICE_HMD -> 2 + VR_DEVICE_HMD = 2, + + /// VR_DEVICE_GENERIC_TRACKER -> 4 + VR_DEVICE_GENERIC_TRACKER = 4, +} + +public enum EVRCameraFlags { + + /// VR_CAMERA_TRACK_OBJECT_ORIENTATION -> 1 + VR_CAMERA_TRACK_OBJECT_ORIENTATION = 1, +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3VRControllerEvent { + + /// int + public int m_controllerId; + + /// int + public int m_deviceType; + + /// int + public int m_numMoveEvents; + + /// int + public int m_numButtonEvents; + + /// float[4] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=4, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_pos; + + /// float[4] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=4, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R4)] + public float[] m_orn; + + /// float + public float m_analogAxis; + + /// int[64] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=64, ArraySubType=System.Runtime.InteropServices.UnmanagedType.I4)] + public int[] m_buttons; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3VREventsData { + + /// int + public int m_numControllerEvents; + + /// b3VRControllerEvent* + public System.IntPtr m_controllerEvents; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3KeyboardEvent { + + /// int + public int m_keyCode; + + /// int + public int m_keyState; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3KeyboardEventsData { + + /// int + public int m_numKeyboardEvents; + + /// b3KeyboardEvent* + public System.IntPtr m_keyboardEvents; +} + +public enum eMouseEventTypeEnums { + + /// MOUSE_MOVE_EVENT -> 1 + MOUSE_MOVE_EVENT = 1, + + /// MOUSE_BUTTON_EVENT -> 2 + MOUSE_BUTTON_EVENT = 2, +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3MouseEvent { + + /// int + public int m_eventType; + + /// float + public float m_mousePosX; + + /// float + public float m_mousePosY; + + /// int + public int m_buttonIndex; + + /// int + public int m_buttonState; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3MouseEventsData { + + /// int + public int m_numMouseEvents; + + /// b3MouseEvent* + public System.IntPtr m_mouseEvents; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3ContactPointData { + + /// int + public int m_contactFlags; + + /// int + public int m_bodyUniqueIdA; + + /// int + public int m_bodyUniqueIdB; + + /// int + public int m_linkIndexA; + + /// int + public int m_linkIndexB; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_positionOnAInWS; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_positionOnBInWS; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_contactNormalOnBInWS; + + /// double + public double m_contactDistance; + + /// double + public double m_normalForce; +} + +public enum b3StateLoggingType { + + /// STATE_LOGGING_MINITAUR -> 0 + STATE_LOGGING_MINITAUR = 0, + + /// STATE_LOGGING_GENERIC_ROBOT -> 1 + STATE_LOGGING_GENERIC_ROBOT = 1, + + /// STATE_LOGGING_VR_CONTROLLERS -> 2 + STATE_LOGGING_VR_CONTROLLERS = 2, + + /// STATE_LOGGING_VIDEO_MP4 -> 3 + STATE_LOGGING_VIDEO_MP4 = 3, + + /// STATE_LOGGING_COMMANDS -> 4 + STATE_LOGGING_COMMANDS = 4, + + /// STATE_LOGGING_CONTACT_POINTS -> 5 + STATE_LOGGING_CONTACT_POINTS = 5, + + /// STATE_LOGGING_PROFILE_TIMINGS -> 6 + STATE_LOGGING_PROFILE_TIMINGS = 6, +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3ContactInformation { + + /// int + public int m_numContactPoints; + + /// b3ContactPointData* + public System.IntPtr m_contactPointData; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3RayHitInfo { + + /// double + public double m_hitFraction; + + /// int + public int m_hitObjectUniqueId; + + /// int + public int m_hitObjectLinkIndex; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_hitPositionWorld; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_hitNormalWorld; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3RaycastInformation { + + /// int + public int m_numRayHits; + + /// b3RayHitInfo* + public System.IntPtr m_rayHits; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet=System.Runtime.InteropServices.CharSet.Ansi)] +public struct b3VisualShapeData { + + /// int + public int m_objectUniqueId; + + /// int + public int m_linkIndex; + + /// int + public int m_visualGeometryType; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_dimensions; + + /// char[1024] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst=1024)] + public string m_meshAssetFileName; + + /// double[7] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=7, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_localVisualFrame; + + /// double[4] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=4, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_rgbaColor; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3VisualShapeInformation { + + /// int + public int m_numVisualShapes; + + /// b3VisualShapeData* + public System.IntPtr m_visualShapeData; +} + +public enum eLinkStateFlags { + + /// ACTUAL_STATE_COMPUTE_LINKVELOCITY -> 1 + ACTUAL_STATE_COMPUTE_LINKVELOCITY = 1, +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3LinkState { + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldPosition; + + /// double[4] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=4, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldOrientation; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_localInertialPosition; + + /// double[4] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=4, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_localInertialOrientation; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldLinkFramePosition; + + /// double[4] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=4, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldLinkFrameOrientation; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldLinearVelocity; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldAngularVelocity; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldAABBMin; + + /// double[3] + [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=3, ArraySubType=System.Runtime.InteropServices.UnmanagedType.R8)] + public double[] m_worldAABBMax; +} + +public enum EnumExternalForceFlags { + + /// EF_LINK_FRAME -> 1 + EF_LINK_FRAME = 1, + + /// EF_WORLD_FRAME -> 2 + EF_WORLD_FRAME = 2, +} + +public enum EnumRenderer { + + /// ER_TINY_RENDERER -> (1<<16) + ER_TINY_RENDERER = (1) << (16), + + /// ER_BULLET_HARDWARE_OPENGL -> (1<<17) + ER_BULLET_HARDWARE_OPENGL = (1) << (17), +} + +public enum b3ConfigureDebugVisualizerEnum { + + /// COV_ENABLE_GUI -> 1 + COV_ENABLE_GUI = 1, + + COV_ENABLE_SHADOWS, + + COV_ENABLE_WIREFRAME, + + COV_ENABLE_VR_TELEPORTING, + + COV_ENABLE_VR_PICKING, + + COV_ENABLE_VR_RENDER_CONTROLLERS, + + COV_ENABLE_RENDERING, + + COV_ENABLE_SYNC_RENDERING_INTERNAL, + + COV_ENABLE_KEYBOARD_SHORTCUTS, + + COV_ENABLE_MOUSE_PICKING, +} + +public enum b3AddUserDebugItemEnum { + + /// DEB_DEBUG_TEXT_USE_ORIENTATION -> 1 + DEB_DEBUG_TEXT_USE_ORIENTATION = 1, + + /// DEB_DEBUG_TEXT_USE_TRUE_TYPE_FONTS -> 2 + DEB_DEBUG_TEXT_USE_TRUE_TYPE_FONTS = 2, + + /// DEB_DEBUG_TEXT_HAS_TRACKING_OBJECT -> 4 + DEB_DEBUG_TEXT_HAS_TRACKING_OBJECT = 4, +} + +public enum eCONNECT_METHOD { + + /// eCONNECT_GUI -> 1 + eCONNECT_GUI = 1, + + /// eCONNECT_DIRECT -> 2 + eCONNECT_DIRECT = 2, + + /// eCONNECT_SHARED_MEMORY -> 3 + eCONNECT_SHARED_MEMORY = 3, + + /// eCONNECT_UDP -> 4 + eCONNECT_UDP = 4, + + /// eCONNECT_TCP -> 5 + eCONNECT_TCP = 5, + + /// eCONNECT_EXISTING_EXAMPLE_BROWSER -> 6 + eCONNECT_EXISTING_EXAMPLE_BROWSER = 6, + + /// eCONNECT_GUI_SERVER -> 7 + eCONNECT_GUI_SERVER = 7, +} + +public enum eURDF_Flags { + + /// URDF_USE_INERTIA_FROM_FILE -> 2 + URDF_USE_INERTIA_FROM_FILE = 2, + + /// URDF_USE_SELF_COLLISION -> 8 + URDF_USE_SELF_COLLISION = 8, + + /// URDF_USE_SELF_COLLISION_EXCLUDE_PARENT -> 16 + URDF_USE_SELF_COLLISION_EXCLUDE_PARENT = 16, + + /// URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS -> 32 + URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS = 32, + + /// URDF_RESERVED -> 64 + URDF_RESERVED = 64, +} + +public enum eUrdfGeomTypes { + + /// GEOM_SPHERE -> 2 + GEOM_SPHERE = 2, + + GEOM_BOX, + + GEOM_CYLINDER, + + GEOM_MESH, + + GEOM_PLANE, + + GEOM_CAPSULE, + + GEOM_UNKNOWN, +} + +public enum eUrdfCollisionFlags { + + /// GEOM_FORCE_CONCAVE_TRIMESH -> 1 + GEOM_FORCE_CONCAVE_TRIMESH = 1, +} + +public enum eStateLoggingFlags { + + /// STATE_LOG_JOINT_MOTOR_TORQUES -> 1 + STATE_LOG_JOINT_MOTOR_TORQUES = 1, + + /// STATE_LOG_JOINT_USER_TORQUES -> 2 + STATE_LOG_JOINT_USER_TORQUES = 2, + + /// STATE_LOG_JOINT_TORQUES -> STATE_LOG_JOINT_MOTOR_TORQUES+STATE_LOG_JOINT_USER_TORQUES + STATE_LOG_JOINT_TORQUES = (eStateLoggingFlags.STATE_LOG_JOINT_MOTOR_TORQUES + eStateLoggingFlags.STATE_LOG_JOINT_USER_TORQUES), +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3PhysicsClientHandle__ { + + /// int + public int unused; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3SharedMemoryCommandHandle__ { + + /// int + public int unused; +} + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] +public struct b3SharedMemoryStatusHandle__ { + + /// int + public int unused; +} + +public partial class NativeMethods { + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///key: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConnectSharedMemory")] +public static extern System.IntPtr b3ConnectSharedMemory(int key) ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///key: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConnectSharedMemory2")] +public static extern System.IntPtr b3ConnectSharedMemory2(int key) ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConnectPhysicsDirect")] +public static extern System.IntPtr b3ConnectPhysicsDirect() ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///argc: int + ///argv: char** + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnect")] +public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnect(int argc, ref System.IntPtr argv) ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///argc: int + ///argv: char** + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnectSharedMemory")] +public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, ref System.IntPtr argv) ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///argc: int + ///argv: char** + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnectMainThread")] +public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, ref System.IntPtr argv) ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///argc: int + ///argv: char** + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory")] +public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, ref System.IntPtr argv) ; + + + /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///guiHelperPtr: void* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect")] +public static extern System.IntPtr b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(System.IntPtr guiHelperPtr) ; + + + /// Return Type: void + ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessRenderSceneInternal")] +public static extern void b3InProcessRenderSceneInternal(ref b3PhysicsClientHandle__ clientHandle) ; + + + /// Return Type: void + ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///debugDrawMode: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessDebugDrawInternal")] +public static extern void b3InProcessDebugDrawInternal(ref b3PhysicsClientHandle__ clientHandle, int debugDrawMode) ; + + + /// Return Type: int + ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///x: float + ///y: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessMouseMoveCallback")] +public static extern int b3InProcessMouseMoveCallback(ref b3PhysicsClientHandle__ clientHandle, float x, float y) ; + + + /// Return Type: int + ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///button: int + ///state: int + ///x: float + ///y: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessMouseButtonCallback")] +public static extern int b3InProcessMouseButtonCallback(ref b3PhysicsClientHandle__ clientHandle, int button, int state, float x, float y) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3DisconnectSharedMemory")] +public static extern void b3DisconnectSharedMemory(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CanSubmitCommand")] +public static extern int b3CanSubmitCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SubmitClientCommandAndWaitStatus")] +public static extern System.IntPtr b3SubmitClientCommandAndWaitStatus(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SubmitClientCommand")] +public static extern int b3SubmitClientCommand(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle) ; + + + /// Return Type: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ProcessServerStatus")] +public static extern System.IntPtr b3ProcessServerStatus(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusType")] +public static extern int b3GetStatusType(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///bodyIndicesOut: int* + ///bodyIndicesCapacity: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusBodyIndices")] +public static extern int b3GetStatusBodyIndices(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyIndicesOut, int bodyIndicesCapacity) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusBodyIndex")] +public static extern int b3GetStatusBodyIndex(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///bodyUniqueId: int* + ///numDegreeOfFreedomQ: int* + ///numDegreeOfFreedomU: int* + ///rootLocalInertialFrame: double** + ///actualStateQ: double** + ///actualStateQdot: double** + ///jointReactionForces: double** + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusActualState")] +public static extern int b3GetStatusActualState(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyUniqueId, ref int numDegreeOfFreedomQ, ref int numDegreeOfFreedomU, ref System.IntPtr rootLocalInertialFrame, ref System.IntPtr actualStateQ, ref System.IntPtr actualStateQdot, ref System.IntPtr jointReactionForces) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCollisionInfoCommandInit")] +public static extern System.IntPtr b3RequestCollisionInfoCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///linkIndex: int + ///aabbMin: double* + ///aabbMax: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusAABB")] +public static extern int b3GetStatusAABB(ref b3SharedMemoryStatusHandle__ statusHandle, int linkIndex, ref double aabbMin, ref double aabbMax) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitSyncBodyInfoCommand")] +public static extern System.IntPtr b3InitSyncBodyInfoCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRemoveBodyCommand")] +public static extern System.IntPtr b3InitRemoveBodyCommand(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetNumBodies")] +public static extern int b3GetNumBodies(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///serialIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetBodyUniqueId")] +public static extern int b3GetBodyUniqueId(ref b3PhysicsClientHandle__ physClient, int serialIndex) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + ///info: b3BodyInfo* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetBodyInfo")] +public static extern int b3GetBodyInfo(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, ref b3BodyInfo info) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetNumJoints")] +public static extern int b3GetNumJoints(ref b3PhysicsClientHandle__ physClient, int bodyIndex) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyIndex: int + ///jointIndex: int + ///info: b3JointInfo* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetJointInfo")] +public static extern int b3GetJointInfo(ref b3PhysicsClientHandle__ physClient, int bodyIndex, int jointIndex, ref b3JointInfo info) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + ///linkIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDynamicsInfoCommandInit")] +public static extern System.IntPtr b3GetDynamicsInfoCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, int linkIndex) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///info: b3DynamicsInfo* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDynamicsInfo")] +public static extern int b3GetDynamicsInfo(ref b3SharedMemoryStatusHandle__ statusHandle, ref b3DynamicsInfo info) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeDynamicsInfo")] +public static extern System.IntPtr b3InitChangeDynamicsInfo(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///mass: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetMass")] +public static extern int b3ChangeDynamicsInfoSetMass(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double mass) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///lateralFriction: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetLateralFriction")] +public static extern int b3ChangeDynamicsInfoSetLateralFriction(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///friction: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetSpinningFriction")] +public static extern int b3ChangeDynamicsInfoSetSpinningFriction(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double friction) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///friction: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetRollingFriction")] +public static extern int b3ChangeDynamicsInfoSetRollingFriction(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double friction) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///restitution: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetRestitution")] +public static extern int b3ChangeDynamicsInfoSetRestitution(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double restitution) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linearDamping: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetLinearDamping")] +public static extern int b3ChangeDynamicsInfoSetLinearDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, double linearDamping) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///angularDamping: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetAngularDamping")] +public static extern int b3ChangeDynamicsInfoSetAngularDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, double angularDamping) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///contactStiffness: double + ///contactDamping: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetContactStiffnessAndDamping")] +public static extern int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double contactStiffness, double contactDamping) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkIndex: int + ///frictionAnchor: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetFrictionAnchor")] +public static extern int b3ChangeDynamicsInfoSetFrictionAnchor(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, int frictionAnchor) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///parentBodyIndex: int + ///parentJointIndex: int + ///childBodyIndex: int + ///childJointIndex: int + ///info: b3JointInfo* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitCreateUserConstraintCommand")] +public static extern System.IntPtr b3InitCreateUserConstraintCommand(ref b3PhysicsClientHandle__ physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, ref b3JointInfo info) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusUserConstraintUniqueId")] +public static extern int b3GetStatusUserConstraintUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///userConstraintUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintCommand")] +public static extern System.IntPtr b3InitChangeUserConstraintCommand(ref b3PhysicsClientHandle__ physClient, int userConstraintUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///jointChildPivot: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetPivotInB")] +public static extern int b3InitChangeUserConstraintSetPivotInB(ref b3SharedMemoryCommandHandle__ commandHandle, ref double jointChildPivot) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///jointChildFrameOrn: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetFrameInB")] +public static extern int b3InitChangeUserConstraintSetFrameInB(ref b3SharedMemoryCommandHandle__ commandHandle, ref double jointChildFrameOrn) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///maxAppliedForce: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetMaxForce")] +public static extern int b3InitChangeUserConstraintSetMaxForce(ref b3SharedMemoryCommandHandle__ commandHandle, double maxAppliedForce) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///gearRatio: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetGearRatio")] +public static extern int b3InitChangeUserConstraintSetGearRatio(ref b3SharedMemoryCommandHandle__ commandHandle, double gearRatio) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///gearAuxLink: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetGearAuxLink")] +public static extern int b3InitChangeUserConstraintSetGearAuxLink(ref b3SharedMemoryCommandHandle__ commandHandle, int gearAuxLink) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///userConstraintUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRemoveUserConstraintCommand")] +public static extern System.IntPtr b3InitRemoveUserConstraintCommand(ref b3PhysicsClientHandle__ physClient, int userConstraintUniqueId) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetNumUserConstraints")] +public static extern int b3GetNumUserConstraints(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///constraintUniqueId: int + ///info: b3UserConstraint* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetUserConstraintInfo")] +public static extern int b3GetUserConstraintInfo(ref b3PhysicsClientHandle__ physClient, int constraintUniqueId, ref b3UserConstraint info) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///serialIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetUserConstraintId")] +public static extern int b3GetUserConstraintId(ref b3PhysicsClientHandle__ physClient, int serialIndex) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///debugMode: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestDebugLinesCommand")] +public static extern System.IntPtr b3InitRequestDebugLinesCommand(ref b3PhysicsClientHandle__ physClient, int debugMode) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///lines: b3DebugLines* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDebugLines")] +public static extern void b3GetDebugLines(ref b3PhysicsClientHandle__ physClient, ref b3DebugLines lines) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitConfigureOpenGLVisualizer")] +public static extern System.IntPtr b3InitConfigureOpenGLVisualizer(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///flag: int + ///enabled: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConfigureOpenGLVisualizerSetVisualizationFlags")] +public static extern void b3ConfigureOpenGLVisualizerSetVisualizationFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flag, int enabled) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///cameraDistance: float + ///cameraPitch: float + ///cameraYaw: float + ///cameraTargetPosition: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConfigureOpenGLVisualizerSetViewMatrix")] +public static extern void b3ConfigureOpenGLVisualizerSetViewMatrix(ref b3SharedMemoryCommandHandle__ commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, ref float cameraTargetPosition) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestOpenGLVisualizerCameraCommand")] +public static extern System.IntPtr b3InitRequestOpenGLVisualizerCameraCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///camera: b3OpenGLVisualizerCameraInfo* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusOpenGLVisualizerCamera")] +public static extern int b3GetStatusOpenGLVisualizerCamera(ref b3SharedMemoryStatusHandle__ statusHandle, ref b3OpenGLVisualizerCameraInfo camera) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///fromXYZ: double* + ///toXYZ: double* + ///colorRGB: double* + ///lineWidth: double + ///lifeTime: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawAddLine3D")] +public static extern System.IntPtr b3InitUserDebugDrawAddLine3D(ref b3PhysicsClientHandle__ physClient, ref double fromXYZ, ref double toXYZ, ref double colorRGB, double lineWidth, double lifeTime) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///txt: char* + ///positionXYZ: double* + ///colorRGB: double* + ///textSize: double + ///lifeTime: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawAddText3D")] +public static extern System.IntPtr b3InitUserDebugDrawAddText3D(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string txt, ref double positionXYZ, ref double colorRGB, double textSize, double lifeTime) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///optionFlags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UserDebugTextSetOptionFlags")] +public static extern void b3UserDebugTextSetOptionFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int optionFlags) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///orientation: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UserDebugTextSetOrientation")] +public static extern void b3UserDebugTextSetOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, ref double orientation) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///objectUniqueId: int + ///linkIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UserDebugItemSetParentObject")] +public static extern void b3UserDebugItemSetParentObject(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId, int linkIndex) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///txt: char* + ///rangeMin: double + ///rangeMax: double + ///startValue: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugAddParameter")] +public static extern System.IntPtr b3InitUserDebugAddParameter(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string txt, double rangeMin, double rangeMax, double startValue) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///debugItemUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugReadParameter")] +public static extern System.IntPtr b3InitUserDebugReadParameter(ref b3PhysicsClientHandle__ physClient, int debugItemUniqueId) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///paramValue: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusDebugParameterValue")] +public static extern int b3GetStatusDebugParameterValue(ref b3SharedMemoryStatusHandle__ statusHandle, ref double paramValue) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///debugItemUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawRemove")] +public static extern System.IntPtr b3InitUserDebugDrawRemove(ref b3PhysicsClientHandle__ physClient, int debugItemUniqueId) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawRemoveAll")] +public static extern System.IntPtr b3InitUserDebugDrawRemoveAll(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitDebugDrawingCommand")] +public static extern System.IntPtr b3InitDebugDrawingCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///objectUniqueId: int + ///linkIndex: int + ///objectColorRGB: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetDebugObjectColor")] +public static extern void b3SetDebugObjectColor(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId, int linkIndex, ref double objectColorRGB) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///objectUniqueId: int + ///linkIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RemoveDebugObjectColor")] +public static extern void b3RemoveDebugObjectColor(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId, int linkIndex) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDebugItemUniqueId")] +public static extern int b3GetDebugItemUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestCameraImage")] +public static extern System.IntPtr b3InitRequestCameraImage(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///viewMatrix: float* + ///projectionMatrix: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetCameraMatrices")] +public static extern void b3RequestCameraImageSetCameraMatrices(ref b3SharedMemoryCommandHandle__ command, ref float viewMatrix, ref float projectionMatrix) ; + + + /// Return Type: void + ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///width: int + ///height: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetPixelResolution")] +public static extern void b3RequestCameraImageSetPixelResolution(ref b3SharedMemoryCommandHandle__ command, int width, int height) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///lightDirection: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightDirection")] +public static extern void b3RequestCameraImageSetLightDirection(ref b3SharedMemoryCommandHandle__ commandHandle, ref float lightDirection) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///lightColor: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightColor")] +public static extern void b3RequestCameraImageSetLightColor(ref b3SharedMemoryCommandHandle__ commandHandle, ref float lightColor) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///lightDistance: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightDistance")] +public static extern void b3RequestCameraImageSetLightDistance(ref b3SharedMemoryCommandHandle__ commandHandle, float lightDistance) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///lightAmbientCoeff: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightAmbientCoeff")] +public static extern void b3RequestCameraImageSetLightAmbientCoeff(ref b3SharedMemoryCommandHandle__ commandHandle, float lightAmbientCoeff) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///lightDiffuseCoeff: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightDiffuseCoeff")] +public static extern void b3RequestCameraImageSetLightDiffuseCoeff(ref b3SharedMemoryCommandHandle__ commandHandle, float lightDiffuseCoeff) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///lightSpecularCoeff: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightSpecularCoeff")] +public static extern void b3RequestCameraImageSetLightSpecularCoeff(ref b3SharedMemoryCommandHandle__ commandHandle, float lightSpecularCoeff) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///hasShadow: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetShadow")] +public static extern void b3RequestCameraImageSetShadow(ref b3SharedMemoryCommandHandle__ commandHandle, int hasShadow) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///renderer: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSelectRenderer")] +public static extern void b3RequestCameraImageSelectRenderer(ref b3SharedMemoryCommandHandle__ commandHandle, int renderer) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///imageData: b3CameraImageData* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetCameraImageData")] +public static extern void b3GetCameraImageData(ref b3PhysicsClientHandle__ physClient, ref b3CameraImageData imageData) ; + + + /// Return Type: void + ///cameraPosition: float* + ///cameraTargetPosition: float* + ///cameraUp: float* + ///viewMatrix: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeViewMatrixFromPositions")] +public static extern void b3ComputeViewMatrixFromPositions(ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp, ref float viewMatrix) ; + + + /// Return Type: void + ///cameraTargetPosition: float* + ///distance: float + ///yaw: float + ///pitch: float + ///roll: float + ///upAxis: int + ///viewMatrix: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeViewMatrixFromYawPitchRoll")] +public static extern void b3ComputeViewMatrixFromYawPitchRoll(ref float cameraTargetPosition, float distance, float yaw, float pitch, float roll, int upAxis, ref float viewMatrix) ; + + + /// Return Type: void + ///viewMatrix: float* + ///cameraPosition: float* + ///cameraTargetPosition: float* + ///cameraUp: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputePositionFromViewMatrix")] +public static extern void b3ComputePositionFromViewMatrix(ref float viewMatrix, ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp) ; + + + /// Return Type: void + ///left: float + ///right: float + ///bottom: float + ///top: float + ///nearVal: float + ///farVal: float + ///projectionMatrix: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeProjectionMatrix")] +public static extern void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, ref float projectionMatrix) ; + + + /// Return Type: void + ///fov: float + ///aspect: float + ///nearVal: float + ///farVal: float + ///projectionMatrix: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeProjectionMatrixFOV")] +public static extern void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, ref float projectionMatrix) ; + + + /// Return Type: void + ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///cameraPosition: float* + ///cameraTargetPosition: float* + ///cameraUp: float* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetViewMatrix")] +public static extern void b3RequestCameraImageSetViewMatrix(ref b3SharedMemoryCommandHandle__ command, ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///cameraTargetPosition: float* + ///distance: float + ///yaw: float + ///pitch: float + ///roll: float + ///upAxis: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetViewMatrix2")] +public static extern void b3RequestCameraImageSetViewMatrix2(ref b3SharedMemoryCommandHandle__ commandHandle, ref float cameraTargetPosition, float distance, float yaw, float pitch, float roll, int upAxis) ; + + + /// Return Type: void + ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///left: float + ///right: float + ///bottom: float + ///top: float + ///nearVal: float + ///farVal: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetProjectionMatrix")] +public static extern void b3RequestCameraImageSetProjectionMatrix(ref b3SharedMemoryCommandHandle__ command, float left, float right, float bottom, float top, float nearVal, float farVal) ; + + + /// Return Type: void + ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///fov: float + ///aspect: float + ///nearVal: float + ///farVal: float + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetFOVProjectionMatrix")] +public static extern void b3RequestCameraImageSetFOVProjectionMatrix(ref b3SharedMemoryCommandHandle__ command, float fov, float aspect, float nearVal, float farVal) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestContactPointInformation")] +public static extern System.IntPtr b3InitRequestContactPointInformation(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueIdA: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterBodyA")] +public static extern void b3SetContactFilterBodyA(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdA) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueIdB: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterBodyB")] +public static extern void b3SetContactFilterBodyB(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdB) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndexA: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterLinkA")] +public static extern void b3SetContactFilterLinkA(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexA) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndexB: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterLinkB")] +public static extern void b3SetContactFilterLinkB(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexB) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///contactPointInfo: b3ContactInformation* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetContactPointInformation")] +public static extern void b3GetContactPointInformation(ref b3PhysicsClientHandle__ physClient, ref b3ContactInformation contactPointInfo) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitClosestDistanceQuery")] +public static extern System.IntPtr b3InitClosestDistanceQuery(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueIdA: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterBodyA")] +public static extern void b3SetClosestDistanceFilterBodyA(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdA) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndexA: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterLinkA")] +public static extern void b3SetClosestDistanceFilterLinkA(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexA) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueIdB: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterBodyB")] +public static extern void b3SetClosestDistanceFilterBodyB(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdB) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndexB: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterLinkB")] +public static extern void b3SetClosestDistanceFilterLinkB(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexB) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///distance: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceThreshold")] +public static extern void b3SetClosestDistanceThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double distance) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///contactPointInfo: b3ContactInformation* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetClosestPointInformation")] +public static extern void b3GetClosestPointInformation(ref b3PhysicsClientHandle__ physClient, ref b3ContactInformation contactPointInfo) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///aabbMin: double* + ///aabbMax: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitAABBOverlapQuery")] +public static extern System.IntPtr b3InitAABBOverlapQuery(ref b3PhysicsClientHandle__ physClient, ref double aabbMin, ref double aabbMax) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///data: b3AABBOverlapData* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetAABBOverlapResults")] +public static extern void b3GetAABBOverlapResults(ref b3PhysicsClientHandle__ physClient, ref b3AABBOverlapData data) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueIdA: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestVisualShapeInformation")] +public static extern System.IntPtr b3InitRequestVisualShapeInformation(ref b3PhysicsClientHandle__ physClient, int bodyUniqueIdA) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///visualShapeInfo: b3VisualShapeInformation* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetVisualShapeInformation")] +public static extern void b3GetVisualShapeInformation(ref b3PhysicsClientHandle__ physClient, ref b3VisualShapeInformation visualShapeInfo) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///filename: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitLoadTexture")] +public static extern System.IntPtr b3InitLoadTexture(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string filename) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusTextureUniqueId")] +public static extern int b3GetStatusTextureUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///textureUniqueId: int + ///width: int + ///height: int + ///rgbPixels: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateChangeTextureCommandInit")] +public static extern System.IntPtr b3CreateChangeTextureCommandInit(ref b3PhysicsClientHandle__ physClient, int textureUniqueId, int width, int height, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string rgbPixels) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + ///jointIndex: int + ///shapeIndex: int + ///textureUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUpdateVisualShape")] +public static extern System.IntPtr b3InitUpdateVisualShape(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///rgbaColor: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UpdateVisualShapeRGBAColor")] +public static extern void b3UpdateVisualShapeRGBAColor(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rgbaColor) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///specularColor: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UpdateVisualShapeSpecularColor")] +public static extern void b3UpdateVisualShapeSpecularColor(ref b3SharedMemoryCommandHandle__ commandHandle, ref double specularColor) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitPhysicsParamCommand")] +public static extern System.IntPtr b3InitPhysicsParamCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///gravx: double + ///gravy: double + ///gravz: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetGravity")] +public static extern int b3PhysicsParamSetGravity(ref b3SharedMemoryCommandHandle__ commandHandle, double gravx, double gravy, double gravz) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///timeStep: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetTimeStep")] +public static extern int b3PhysicsParamSetTimeStep(ref b3SharedMemoryCommandHandle__ commandHandle, double timeStep) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///defaultContactERP: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetDefaultContactERP")] +public static extern int b3PhysicsParamSetDefaultContactERP(ref b3SharedMemoryCommandHandle__ commandHandle, double defaultContactERP) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///defaultNonContactERP: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetDefaultNonContactERP")] +public static extern int b3PhysicsParamSetDefaultNonContactERP(ref b3SharedMemoryCommandHandle__ commandHandle, double defaultNonContactERP) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///frictionERP: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetDefaultFrictionERP")] +public static extern int b3PhysicsParamSetDefaultFrictionERP(ref b3SharedMemoryCommandHandle__ commandHandle, double frictionERP) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numSubSteps: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetNumSubSteps")] +public static extern int b3PhysicsParamSetNumSubSteps(ref b3SharedMemoryCommandHandle__ commandHandle, int numSubSteps) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///enableRealTimeSimulation: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetRealTimeSimulation")] +public static extern int b3PhysicsParamSetRealTimeSimulation(ref b3SharedMemoryCommandHandle__ commandHandle, int enableRealTimeSimulation) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numSolverIterations: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetNumSolverIterations")] +public static extern int b3PhysicsParamSetNumSolverIterations(ref b3SharedMemoryCommandHandle__ commandHandle, int numSolverIterations) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///filterMode: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetCollisionFilterMode")] +public static extern int b3PhysicsParamSetCollisionFilterMode(ref b3SharedMemoryCommandHandle__ commandHandle, int filterMode) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///useSplitImpulse: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetUseSplitImpulse")] +public static extern int b3PhysicsParamSetUseSplitImpulse(ref b3SharedMemoryCommandHandle__ commandHandle, int useSplitImpulse) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///splitImpulsePenetrationThreshold: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetSplitImpulsePenetrationThreshold")] +public static extern int b3PhysicsParamSetSplitImpulsePenetrationThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double splitImpulsePenetrationThreshold) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///contactBreakingThreshold: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetContactBreakingThreshold")] +public static extern int b3PhysicsParamSetContactBreakingThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double contactBreakingThreshold) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///maxNumCmdPer1ms: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetMaxNumCommandsPer1ms")] +public static extern int b3PhysicsParamSetMaxNumCommandsPer1ms(ref b3SharedMemoryCommandHandle__ commandHandle, int maxNumCmdPer1ms) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///enableFileCaching: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetEnableFileCaching")] +public static extern int b3PhysicsParamSetEnableFileCaching(ref b3SharedMemoryCommandHandle__ commandHandle, int enableFileCaching) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///restitutionVelocityThreshold: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetRestitutionVelocityThreshold")] +public static extern int b3PhysicsParamSetRestitutionVelocityThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double restitutionVelocityThreshold) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///flags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetInternalSimFlags")] +public static extern int b3PhysicsParamSetInternalSimFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flags) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitStepSimulationCommand")] +public static extern System.IntPtr b3InitStepSimulationCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitResetSimulationCommand")] +public static extern System.IntPtr b3InitResetSimulationCommand(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///urdfFileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandInit")] +public static extern System.IntPtr b3LoadUrdfCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string urdfFileName) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///startPosX: double + ///startPosY: double + ///startPosZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetStartPosition")] +public static extern int b3LoadUrdfCommandSetStartPosition(ref b3SharedMemoryCommandHandle__ commandHandle, double startPosX, double startPosY, double startPosZ) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///startOrnX: double + ///startOrnY: double + ///startOrnZ: double + ///startOrnW: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetStartOrientation")] +public static extern int b3LoadUrdfCommandSetStartOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///useMultiBody: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetUseMultiBody")] +public static extern int b3LoadUrdfCommandSetUseMultiBody(ref b3SharedMemoryCommandHandle__ commandHandle, int useMultiBody) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///useFixedBase: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetUseFixedBase")] +public static extern int b3LoadUrdfCommandSetUseFixedBase(ref b3SharedMemoryCommandHandle__ commandHandle, int useFixedBase) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///flags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetFlags")] +public static extern int b3LoadUrdfCommandSetFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flags) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///globalScaling: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetGlobalScaling")] +public static extern int b3LoadUrdfCommandSetGlobalScaling(ref b3SharedMemoryCommandHandle__ commandHandle, double globalScaling) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///fileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBulletCommandInit")] +public static extern System.IntPtr b3LoadBulletCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///fileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SaveBulletCommandInit")] +public static extern System.IntPtr b3SaveBulletCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///fileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadMJCFCommandInit")] +public static extern System.IntPtr b3LoadMJCFCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///flags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadMJCFCommandSetFlags")] +public static extern void b3LoadMJCFCommandSetFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flags) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyIndex: int + ///jointPositionsQ: double* + ///jointVelocitiesQdot: double* + ///jointAccelerations: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseDynamicsCommandInit")] +public static extern System.IntPtr b3CalculateInverseDynamicsCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex, ref double jointPositionsQ, ref double jointVelocitiesQdot, ref double jointAccelerations) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///bodyUniqueId: int* + ///dofCount: int* + ///jointForces: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusInverseDynamicsJointForces")] +public static extern int b3GetStatusInverseDynamicsJointForces(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyUniqueId, ref int dofCount, ref double jointForces) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyIndex: int + ///linkIndex: int + ///localPosition: double* + ///jointPositionsQ: double* + ///jointVelocitiesQdot: double* + ///jointAccelerations: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateJacobianCommandInit")] +public static extern System.IntPtr b3CalculateJacobianCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex, int linkIndex, ref double localPosition, ref double jointPositionsQ, ref double jointVelocitiesQdot, ref double jointAccelerations) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///linearJacobian: double* + ///angularJacobian: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusJacobian")] +public static extern int b3GetStatusJacobian(ref b3SharedMemoryStatusHandle__ statusHandle, ref double linearJacobian, ref double angularJacobian) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsCommandInit")] +public static extern System.IntPtr b3CalculateInverseKinematicsCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///endEffectorLinkIndex: int + ///targetPosition: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsAddTargetPurePosition")] +public static extern void b3CalculateInverseKinematicsAddTargetPurePosition(ref b3SharedMemoryCommandHandle__ commandHandle, int endEffectorLinkIndex, ref double targetPosition) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///endEffectorLinkIndex: int + ///targetPosition: double* + ///targetOrientation: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsAddTargetPositionWithOrientation")] +public static extern void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, int endEffectorLinkIndex, ref double targetPosition, ref double targetOrientation) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numDof: int + ///endEffectorLinkIndex: int + ///targetPosition: double* + ///lowerLimit: double* + ///upperLimit: double* + ///jointRange: double* + ///restPose: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsPosWithNullSpaceVel")] +public static extern void b3CalculateInverseKinematicsPosWithNullSpaceVel(ref b3SharedMemoryCommandHandle__ commandHandle, int numDof, int endEffectorLinkIndex, ref double targetPosition, ref double lowerLimit, ref double upperLimit, ref double jointRange, ref double restPose) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numDof: int + ///endEffectorLinkIndex: int + ///targetPosition: double* + ///targetOrientation: double* + ///lowerLimit: double* + ///upperLimit: double* + ///jointRange: double* + ///restPose: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsPosOrnWithNullSpaceVel")] +public static extern void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(ref b3SharedMemoryCommandHandle__ commandHandle, int numDof, int endEffectorLinkIndex, ref double targetPosition, ref double targetOrientation, ref double lowerLimit, ref double upperLimit, ref double jointRange, ref double restPose) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numDof: int + ///jointDampingCoeff: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsSetJointDamping")] +public static extern void b3CalculateInverseKinematicsSetJointDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int numDof, ref double jointDampingCoeff) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///bodyUniqueId: int* + ///dofCount: int* + ///jointPositions: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusInverseKinematicsJointPositions")] +public static extern int b3GetStatusInverseKinematicsJointPositions(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyUniqueId, ref int dofCount, ref double jointPositions) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///sdfFileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadSdfCommandInit")] +public static extern System.IntPtr b3LoadSdfCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string sdfFileName) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///useMultiBody: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadSdfCommandSetUseMultiBody")] +public static extern int b3LoadSdfCommandSetUseMultiBody(ref b3SharedMemoryCommandHandle__ commandHandle, int useMultiBody) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///globalScaling: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadSdfCommandSetUseGlobalScaling")] +public static extern int b3LoadSdfCommandSetUseGlobalScaling(ref b3SharedMemoryCommandHandle__ commandHandle, double globalScaling) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///sdfFileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SaveWorldCommandInit")] +public static extern System.IntPtr b3SaveWorldCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string sdfFileName) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///controlMode: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlCommandInit")] +public static extern System.IntPtr b3JointControlCommandInit(ref b3PhysicsClientHandle__ physClient, int controlMode) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + ///controlMode: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlCommandInit2")] +public static extern System.IntPtr b3JointControlCommandInit2(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, int controlMode) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///qIndex: int + ///value: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetDesiredPosition")] +public static extern int b3JointControlSetDesiredPosition(ref b3SharedMemoryCommandHandle__ commandHandle, int qIndex, double value) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///dofIndex: int + ///value: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetKp")] +public static extern int b3JointControlSetKp(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///dofIndex: int + ///value: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetKd")] +public static extern int b3JointControlSetKd(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///dofIndex: int + ///value: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetDesiredVelocity")] +public static extern int b3JointControlSetDesiredVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///dofIndex: int + ///value: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetMaximumForce")] +public static extern int b3JointControlSetMaximumForce(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///dofIndex: int + ///value: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetDesiredForceTorque")] +public static extern int b3JointControlSetDesiredForceTorque(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeCommandInit")] +public static extern System.IntPtr b3CreateCollisionShapeCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///radius: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddSphere")] +public static extern int b3CreateCollisionShapeAddSphere(ref b3SharedMemoryCommandHandle__ commandHandle, double radius) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///halfExtents: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddBox")] +public static extern int b3CreateCollisionShapeAddBox(ref b3SharedMemoryCommandHandle__ commandHandle, ref double halfExtents) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///radius: double + ///height: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddCapsule")] +public static extern int b3CreateCollisionShapeAddCapsule(ref b3SharedMemoryCommandHandle__ commandHandle, double radius, double height) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///radius: double + ///height: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddCylinder")] +public static extern int b3CreateCollisionShapeAddCylinder(ref b3SharedMemoryCommandHandle__ commandHandle, double radius, double height) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///planeNormal: double* + ///planeConstant: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddPlane")] +public static extern int b3CreateCollisionShapeAddPlane(ref b3SharedMemoryCommandHandle__ commandHandle, ref double planeNormal, double planeConstant) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///fileName: char* + ///meshScale: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddMesh")] +public static extern int b3CreateCollisionShapeAddMesh(ref b3SharedMemoryCommandHandle__ commandHandle, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName, ref double meshScale) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///shapeIndex: int + ///flags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionSetFlag")] +public static extern void b3CreateCollisionSetFlag(ref b3SharedMemoryCommandHandle__ commandHandle, int shapeIndex, int flags) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///shapeIndex: int + ///childPosition: double* + ///childOrientation: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeSetChildTransform")] +public static extern void b3CreateCollisionShapeSetChildTransform(ref b3SharedMemoryCommandHandle__ commandHandle, int shapeIndex, ref double childPosition, ref double childOrientation) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusCollisionShapeUniqueId")] +public static extern int b3GetStatusCollisionShapeUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateVisualShapeCommandInit")] +public static extern System.IntPtr b3CreateVisualShapeCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusVisualShapeUniqueId")] +public static extern int b3GetStatusVisualShapeUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyCommandInit")] +public static extern System.IntPtr b3CreateMultiBodyCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///mass: double + ///collisionShapeUnique: int + ///visualShapeUniqueId: int + ///basePosition: double* + ///baseOrientation: double* + ///baseInertialFramePosition: double* + ///baseInertialFrameOrientation: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyBase")] +public static extern int b3CreateMultiBodyBase(ref b3SharedMemoryCommandHandle__ commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, ref double basePosition, ref double baseOrientation, ref double baseInertialFramePosition, ref double baseInertialFrameOrientation) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkMass: double + ///linkCollisionShapeIndex: double + ///linkVisualShapeIndex: double + ///linkPosition: double* + ///linkOrientation: double* + ///linkInertialFramePosition: double* + ///linkInertialFrameOrientation: double* + ///linkParentIndex: int + ///linkJointType: int + ///linkJointAxis: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyLink")] +public static extern int b3CreateMultiBodyLink(ref b3SharedMemoryCommandHandle__ commandHandle, double linkMass, double linkCollisionShapeIndex, double linkVisualShapeIndex, ref double linkPosition, ref double linkOrientation, ref double linkInertialFramePosition, ref double linkInertialFrameOrientation, int linkParentIndex, int linkJointType, ref double linkJointAxis) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyUseMaximalCoordinates")] +public static extern void b3CreateMultiBodyUseMaximalCoordinates(ref b3SharedMemoryCommandHandle__ commandHandle) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxShapeCommandInit")] +public static extern System.IntPtr b3CreateBoxShapeCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///startPosX: double + ///startPosY: double + ///startPosZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetStartPosition")] +public static extern int b3CreateBoxCommandSetStartPosition(ref b3SharedMemoryCommandHandle__ commandHandle, double startPosX, double startPosY, double startPosZ) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///startOrnX: double + ///startOrnY: double + ///startOrnZ: double + ///startOrnW: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetStartOrientation")] +public static extern int b3CreateBoxCommandSetStartOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///halfExtentsX: double + ///halfExtentsY: double + ///halfExtentsZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetHalfExtents")] +public static extern int b3CreateBoxCommandSetHalfExtents(ref b3SharedMemoryCommandHandle__ commandHandle, double halfExtentsX, double halfExtentsY, double halfExtentsZ) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///mass: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetMass")] +public static extern int b3CreateBoxCommandSetMass(ref b3SharedMemoryCommandHandle__ commandHandle, double mass) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///collisionShapeType: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetCollisionShapeType")] +public static extern int b3CreateBoxCommandSetCollisionShapeType(ref b3SharedMemoryCommandHandle__ commandHandle, int collisionShapeType) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///red: double + ///green: double + ///blue: double + ///alpha: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetColorRGBA")] +public static extern int b3CreateBoxCommandSetColorRGBA(ref b3SharedMemoryCommandHandle__ commandHandle, double red, double green, double blue, double alpha) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyIndex: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandInit")] +public static extern System.IntPtr b3CreatePoseCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///startPosX: double + ///startPosY: double + ///startPosZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBasePosition")] +public static extern int b3CreatePoseCommandSetBasePosition(ref b3SharedMemoryCommandHandle__ commandHandle, double startPosX, double startPosY, double startPosZ) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///startOrnX: double + ///startOrnY: double + ///startOrnZ: double + ///startOrnW: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBaseOrientation")] +public static extern int b3CreatePoseCommandSetBaseOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linVel: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBaseLinearVelocity")] +public static extern int b3CreatePoseCommandSetBaseLinearVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, ref double linVel) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///angVel: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBaseAngularVelocity")] +public static extern int b3CreatePoseCommandSetBaseAngularVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, ref double angVel) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numJointPositions: int + ///jointPositions: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointPositions")] +public static extern int b3CreatePoseCommandSetJointPositions(ref b3SharedMemoryCommandHandle__ commandHandle, int numJointPositions, ref double jointPositions) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///jointIndex: int + ///jointPosition: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointPosition")] +public static extern int b3CreatePoseCommandSetJointPosition(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle, int jointIndex, double jointPosition) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///numJointVelocities: int + ///jointVelocities: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointVelocities")] +public static extern int b3CreatePoseCommandSetJointVelocities(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle, int numJointVelocities, ref double jointVelocities) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///jointIndex: int + ///jointVelocity: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointVelocity")] +public static extern int b3CreatePoseCommandSetJointVelocity(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle, int jointIndex, double jointVelocity) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateSensorCommandInit")] +public static extern System.IntPtr b3CreateSensorCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///jointIndex: int + ///enable: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateSensorEnable6DofJointForceTorqueSensor")] +public static extern int b3CreateSensorEnable6DofJointForceTorqueSensor(ref b3SharedMemoryCommandHandle__ commandHandle, int jointIndex, int enable) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndex: int + ///enable: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateSensorEnableIMUForLink")] +public static extern int b3CreateSensorEnableIMUForLink(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndex, int enable) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///bodyUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestActualStateCommandInit")] +public static extern System.IntPtr b3RequestActualStateCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///computeLinkVelocity: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestActualStateCommandComputeLinkVelocity")] +public static extern int b3RequestActualStateCommandComputeLinkVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, int computeLinkVelocity) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///jointIndex: int + ///state: b3JointSensorState* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetJointState")] +public static extern int b3GetJointState(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryStatusHandle__ statusHandle, int jointIndex, ref b3JointSensorState state) ; + + + /// Return Type: int + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + ///linkIndex: int + ///state: b3LinkState* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetLinkState")] +public static extern int b3GetLinkState(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryStatusHandle__ statusHandle, int linkIndex, ref b3LinkState state) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///rayFromWorldX: double + ///rayFromWorldY: double + ///rayFromWorldZ: double + ///rayToWorldX: double + ///rayToWorldY: double + ///rayToWorldZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PickBody")] +public static extern System.IntPtr b3PickBody(ref b3PhysicsClientHandle__ physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///rayFromWorldX: double + ///rayFromWorldY: double + ///rayFromWorldZ: double + ///rayToWorldX: double + ///rayToWorldY: double + ///rayToWorldZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3MovePickedBody")] +public static extern System.IntPtr b3MovePickedBody(ref b3PhysicsClientHandle__ physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RemovePickingConstraint")] +public static extern System.IntPtr b3RemovePickingConstraint(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///rayFromWorldX: double + ///rayFromWorldY: double + ///rayFromWorldZ: double + ///rayToWorldX: double + ///rayToWorldY: double + ///rayToWorldZ: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateRaycastCommandInit")] +public static extern System.IntPtr b3CreateRaycastCommandInit(ref b3PhysicsClientHandle__ physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateRaycastBatchCommandInit")] +public static extern System.IntPtr b3CreateRaycastBatchCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///rayFromWorld: double* + ///rayToWorld: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RaycastBatchAddRay")] +public static extern void b3RaycastBatchAddRay(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rayFromWorld, ref double rayToWorld) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///raycastInfo: b3RaycastInformation* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetRaycastInformation")] +public static extern void b3GetRaycastInformation(ref b3PhysicsClientHandle__ physClient, ref b3RaycastInformation raycastInfo) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ApplyExternalForceCommandInit")] +public static extern System.IntPtr b3ApplyExternalForceCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkId: int + ///force: double* + ///position: double* + ///flags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ApplyExternalForce")] +public static extern void b3ApplyExternalForce(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkId, ref double force, ref double position, int flags) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyUniqueId: int + ///linkId: int + ///torque: double* + ///flags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ApplyExternalTorque")] +public static extern void b3ApplyExternalTorque(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkId, ref double torque, int flags) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnyCommandInit")] +public static extern System.IntPtr b3LoadBunnyCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///scale: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnySetScale")] +public static extern int b3LoadBunnySetScale(ref b3SharedMemoryCommandHandle__ commandHandle, double scale) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///mass: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnySetMass")] +public static extern int b3LoadBunnySetMass(ref b3SharedMemoryCommandHandle__ commandHandle, double mass) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///collisionMargin: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnySetCollisionMargin")] +public static extern int b3LoadBunnySetCollisionMargin(ref b3SharedMemoryCommandHandle__ commandHandle, double collisionMargin) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestVREventsCommandInit")] +public static extern System.IntPtr b3RequestVREventsCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///deviceTypeFilter: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3VREventsSetDeviceTypeFilter")] +public static extern void b3VREventsSetDeviceTypeFilter(ref b3SharedMemoryCommandHandle__ commandHandle, int deviceTypeFilter) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///vrEventsData: b3VREventsData* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetVREventsData")] +public static extern void b3GetVREventsData(ref b3PhysicsClientHandle__ physClient, ref b3VREventsData vrEventsData) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraStateCommandInit")] +public static extern System.IntPtr b3SetVRCameraStateCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///rootPos: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraRootPosition")] +public static extern int b3SetVRCameraRootPosition(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rootPos) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///rootOrn: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraRootOrientation")] +public static extern int b3SetVRCameraRootOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rootOrn) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///objectUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraTrackingObject")] +public static extern int b3SetVRCameraTrackingObject(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///flag: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraTrackingObjectFlag")] +public static extern int b3SetVRCameraTrackingObjectFlag(ref b3SharedMemoryCommandHandle__ commandHandle, int flag) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestKeyboardEventsCommandInit")] +public static extern System.IntPtr b3RequestKeyboardEventsCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///keyboardEventsData: b3KeyboardEventsData* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetKeyboardEventsData")] +public static extern void b3GetKeyboardEventsData(ref b3PhysicsClientHandle__ physClient, ref b3KeyboardEventsData keyboardEventsData) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestMouseEventsCommandInit")] +public static extern System.IntPtr b3RequestMouseEventsCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///mouseEventsData: b3MouseEventsData* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetMouseEventsData")] +public static extern void b3GetMouseEventsData(ref b3PhysicsClientHandle__ physClient, ref b3MouseEventsData mouseEventsData) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingCommandInit")] +public static extern System.IntPtr b3StateLoggingCommandInit(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///loggingType: int + ///fileName: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingStart")] +public static extern int b3StateLoggingStart(ref b3SharedMemoryCommandHandle__ commandHandle, int loggingType, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///objectUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingAddLoggingObjectUniqueId")] +public static extern int b3StateLoggingAddLoggingObjectUniqueId(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///maxLogDof: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetMaxLogDof")] +public static extern int b3StateLoggingSetMaxLogDof(ref b3SharedMemoryCommandHandle__ commandHandle, int maxLogDof) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndexA: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetLinkIndexA")] +public static extern int b3StateLoggingSetLinkIndexA(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexA) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///linkIndexB: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetLinkIndexB")] +public static extern int b3StateLoggingSetLinkIndexB(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexB) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyAUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetBodyAUniqueId")] +public static extern int b3StateLoggingSetBodyAUniqueId(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyAUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///bodyBUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetBodyBUniqueId")] +public static extern int b3StateLoggingSetBodyBUniqueId(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyBUniqueId) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///deviceTypeFilter: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetDeviceTypeFilter")] +public static extern int b3StateLoggingSetDeviceTypeFilter(ref b3SharedMemoryCommandHandle__ commandHandle, int deviceTypeFilter) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///logFlags: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetLogFlags")] +public static extern int b3StateLoggingSetLogFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int logFlags) ; + + + /// Return Type: int + ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusLoggingUniqueId")] +public static extern int b3GetStatusLoggingUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + + + /// Return Type: int + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///loggingUniqueId: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingStop")] +public static extern int b3StateLoggingStop(ref b3SharedMemoryCommandHandle__ commandHandle, int loggingUniqueId) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///name: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ProfileTimingCommandInit")] +public static extern System.IntPtr b3ProfileTimingCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string name) ; + + + /// Return Type: void + ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///duration: int + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetProfileTimingDuractionInMicroSeconds")] +public static extern void b3SetProfileTimingDuractionInMicroSeconds(ref b3SharedMemoryCommandHandle__ commandHandle, int duration) ; + + + /// Return Type: void + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///timeOutInSeconds: double + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetTimeOut")] +public static extern void b3SetTimeOut(ref b3PhysicsClientHandle__ physClient, double timeOutInSeconds) ; + + + /// Return Type: double + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetTimeOut")] +public static extern double b3GetTimeOut(ref b3PhysicsClientHandle__ physClient) ; + + + /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* + ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* + ///path: char* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetAdditionalSearchPath")] +public static extern System.IntPtr b3SetAdditionalSearchPath(ref b3PhysicsClientHandle__ physClient, System.IntPtr path) ; + + + /// Return Type: void + ///posA: double* + ///ornA: double* + ///posB: double* + ///ornB: double* + ///outPos: double* + ///outOrn: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3MultiplyTransforms")] +public static extern void b3MultiplyTransforms(ref double posA, ref double ornA, ref double posB, ref double ornB, ref double outPos, ref double outOrn) ; + + + /// Return Type: void + ///pos: double* + ///orn: double* + ///outPos: double* + ///outOrn: double* + [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InvertTransform")] +public static extern void b3InvertTransform(ref double pos, ref double orn, ref double outPos, ref double outOrn) ; + +} diff --git a/examples/pybullet/unity3d/examples/NewBehaviourScript.cs b/examples/pybullet/unity3d/examples/NewBehaviourScript.cs new file mode 100644 index 000000000..026e7a709 --- /dev/null +++ b/examples/pybullet/unity3d/examples/NewBehaviourScript.cs @@ -0,0 +1,86 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using System.Runtime.InteropServices; +using System; + +[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + + +public class NewBehaviourScript : MonoBehaviour { + + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010_x64_release.dll", EntryPoint = "b3ConnectSharedMemory")] + public static extern System.IntPtr b3ConnectSharedMemory(int key); + + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010_x64_release.dll", EntryPoint = "b3CreateInProcessPhysicsServerAndConnect")] + public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnect(int argc, ref System.IntPtr argv); + + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010_x64_release.dll", EntryPoint = "b3InitStepSimulationCommand")] + public static extern System.IntPtr b3InitStepSimulationCommand(IntPtr physClient); + + + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010_x64_release.dll", EntryPoint = "b3LoadUrdfCommandInit")] + public static extern System.IntPtr b3LoadUrdfCommandInit(IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string urdfFileName); + + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010_x64_release.dll", EntryPoint = "b3InitResetSimulationCommand")] + public static extern System.IntPtr b3InitResetSimulationCommand(IntPtr physClient); + + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010_x64_release.dll", EntryPoint = "b3SubmitClientCommandAndWaitStatus")] + public static extern System.IntPtr b3SubmitClientCommandAndWaitStatus(IntPtr physClient, IntPtr commandHandle); + + + [DllImport("TestCppPlug.dll")] + static extern int Add(int a, int b); + + [DllImport("TestCppPlug.dll")] + static extern int CallMe(Action action); + + [DllImport("TestCppPlug.dll")] + static extern IntPtr CreateSharedAPI(int id); + + [DllImport("TestCppPlug.dll")] + static extern int GetMyIdPlusTen(IntPtr api); + + [DllImport("TestCppPlug.dll")] + static extern void DeleteSharedAPI(IntPtr api); + + private void IWasCalled(int value) + { + text.text = value.ToString(); + } + + Text text; + IntPtr sharedAPI; + IntPtr pybullet; + + // Use this for initialization + void Start () { + text = GetComponent(); + CallMe(IWasCalled); + sharedAPI = CreateSharedAPI(30); + + IntPtr pybullet = b3ConnectSharedMemory(12347); + IntPtr cmd = b3InitResetSimulationCommand(pybullet); + IntPtr status = b3SubmitClientCommandAndWaitStatus(pybullet, cmd); + cmd = b3LoadUrdfCommandInit(pybullet, "plane.urdf"); + status = b3SubmitClientCommandAndWaitStatus(pybullet, cmd); + //IntPtr clientPtr = b3CreateInProcessPhysicsServerAndConnect(0, ref ptr); + } + + // Update is called once per frame + void Update () { + IntPtr cmd = b3InitStepSimulationCommand(pybullet); + IntPtr status = b3SubmitClientCommandAndWaitStatus(pybullet, cmd); + + //System.IO.Directory.GetCurrentDirectory().ToString();// + //text.text = Add(4, 5).ToString(); + text.text = UnityEngine.Random.Range(0f, 1f).ToString();// GetMyIdPlusTen(sharedAPI).ToString(); + } + + void OnDestroy() + { + + DeleteSharedAPI(sharedAPI); + } +} diff --git a/examples/pybullet/unity3d/examples/NewBehaviourScript.cs.meta b/examples/pybullet/unity3d/examples/NewBehaviourScript.cs.meta new file mode 100644 index 000000000..6e595b031 --- /dev/null +++ b/examples/pybullet/unity3d/examples/NewBehaviourScript.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6197b3a0389e92c47b7d8698e5f61f06 +timeCreated: 1505961790 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/examples/pybullet/unity3d/readme.txt b/examples/pybullet/unity3d/readme.txt new file mode 100644 index 000000000..43497b816 --- /dev/null +++ b/examples/pybullet/unity3d/readme.txt @@ -0,0 +1,33 @@ +Quick prototype to connect Unity 3D to pybullet + +Generate C# Native Methods using the Microsoft PInvoke Signature Toolkit: + +sigimp.exe /lang:cs e:\develop\bullet3\examples\SharedMemory\PhysicsClientC_API.h + +Add some #define B3_SHARED_API __declspec(dllexport) to the exported methods, +replace [3], [4], [16] by [] to get sigimp.exe working. + +This generates autogen/NativeMethods.cs + +Then put pybullet.dll in the right location, so Unity finds it. + +NewBehaviourScript.cs is a 1 evening prototype that works within Unity 3D: +Create a connection to pybullet, reset the world, load a urdf at startup. +Step the simulation each Update. + +Now the real work can start, converting Unity objects to pybullet, +pybullet robots to Unity, synchronizing the transforms each Update. + +void Start () { + IntPtr pybullet = b3ConnectSharedMemory(12347); + IntPtr cmd = b3InitResetSimulationCommand(pybullet); + IntPtr status = b3SubmitClientCommandAndWaitStatus(pybullet, cmd); + cmd = b3LoadUrdfCommandInit(pybullet, "plane.urdf"); + status = b3SubmitClientCommandAndWaitStatus(pybullet, cmd); +} + +void Update () +{ + IntPtr cmd = b3InitStepSimulationCommand(pybullet); + IntPtr status = b3SubmitClientCommandAndWaitStatus(pybullet, cmd); +} From 176c2512de9c5d1e03788a254f9d7be6c81ddbc3 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 21 Sep 2017 08:37:00 -0700 Subject: [PATCH 03/38] add B3_SHARED_API definition for Mac / Linux / gcc --- examples/SharedMemory/PhysicsClientC_API.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index 137561d84..a370df102 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -11,7 +11,11 @@ B3_DECLARE_HANDLE(b3SharedMemoryCommandHandle); B3_DECLARE_HANDLE(b3SharedMemoryStatusHandle); #ifdef _WIN32 -#define B3_SHARED_API __declspec(dllexport) + #define B3_SHARED_API __declspec(dllexport) +#elif defined (__GNUC__) + #define B3_SHARED_API __attribute__((visibility("default"))) +#else + #define B3_SHARED_API #endif From cc0c46c4b0eb5b82ae185687a0eb06da8659966d Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 21 Sep 2017 14:24:22 -0700 Subject: [PATCH 04/38] re-update the VR camera --- examples/StandaloneMain/hellovr_opengl_main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/StandaloneMain/hellovr_opengl_main.cpp b/examples/StandaloneMain/hellovr_opengl_main.cpp index cad0eeb35..8426aa67f 100644 --- a/examples/StandaloneMain/hellovr_opengl_main.cpp +++ b/examples/StandaloneMain/hellovr_opengl_main.cpp @@ -1804,6 +1804,8 @@ void CMainApplication::RenderStereoTargets() m_app->m_instancingRenderer->getActiveCamera()->setCameraUpVector(mat[0],mat[1],mat[2]); m_app->m_instancingRenderer->getActiveCamera()->setVRCamera(viewMatLeft.get(),m_mat4ProjectionLeft.get()); m_app->m_instancingRenderer->updateCamera(m_app->getUpAxis()); + m_app->m_instancingRenderer->getActiveCamera()->setVRCamera(viewMatLeft.get(),m_mat4ProjectionLeft.get()); + } glBindFramebuffer( GL_FRAMEBUFFER, leftEyeDesc.m_nRenderFramebufferId ); @@ -1862,6 +1864,7 @@ void CMainApplication::RenderStereoTargets() Matrix4 viewMatRight = m_mat4eyePosRight * m_mat4HMDPose * rotYtoZ; m_app->m_instancingRenderer->getActiveCamera()->setVRCamera(viewMatRight.get(),m_mat4ProjectionRight.get()); m_app->m_instancingRenderer->updateCamera(m_app->getUpAxis()); + m_app->m_instancingRenderer->getActiveCamera()->setVRCamera(viewMatRight.get(),m_mat4ProjectionRight.get()); } glBindFramebuffer( GL_FRAMEBUFFER, rightEyeDesc.m_nRenderFramebufferId ); From b9b1b2dbcad06f7429404a4cda115c6637c53c7a Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 21 Sep 2017 16:40:19 -0700 Subject: [PATCH 05/38] add B3_SHARED_API to the remaining PhysicsClientC_API APIs --- examples/SharedMemory/PhysicsClientC_API.cpp | 474 +++++++++--------- examples/SharedMemory/PhysicsClientC_API.h | 468 ++++++++--------- .../SharedMemory/PhysicsClientTCP_C_API.cpp | 2 +- .../SharedMemory/PhysicsClientTCP_C_API.h | 2 +- .../SharedMemory/PhysicsClientUDP_C_API.cpp | 2 +- .../SharedMemory/PhysicsClientUDP_C_API.h | 2 +- examples/SharedMemory/PhysicsDirectC_API.cpp | 2 +- examples/SharedMemory/PhysicsDirectC_API.h | 2 +- 8 files changed, 477 insertions(+), 477 deletions(-) diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 04eb59007..9bc362373 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -9,7 +9,7 @@ #include "SharedMemoryCommands.h" -b3SharedMemoryCommandHandle b3LoadSdfCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadSdfCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -31,7 +31,7 @@ b3SharedMemoryCommandHandle b3LoadSdfCommandInit(b3PhysicsClientHandle physClien return (b3SharedMemoryCommandHandle) command; } -b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -53,7 +53,7 @@ b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physCli return (b3SharedMemoryCommandHandle) command; } -B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -80,7 +80,7 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientH return 0; } -b3SharedMemoryCommandHandle b3LoadBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -107,7 +107,7 @@ b3SharedMemoryCommandHandle b3LoadBulletCommandInit(b3PhysicsClientHandle physCl return 0; } -b3SharedMemoryCommandHandle b3SaveBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3SaveBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -133,7 +133,7 @@ b3SharedMemoryCommandHandle b3SaveBulletCommandInit(b3PhysicsClientHandle physCl } return 0; } -b3SharedMemoryCommandHandle b3LoadMJCFCommandInit(b3PhysicsClientHandle physClient, const char* fileName) +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadMJCFCommandInit(b3PhysicsClientHandle physClient, const char* fileName) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -160,7 +160,7 @@ b3SharedMemoryCommandHandle b3LoadMJCFCommandInit(b3PhysicsClientHandle physClie return 0; } -void b3LoadMJCFCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags) +B3_SHARED_API void b3LoadMJCFCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_LOAD_MJCF); @@ -171,7 +171,7 @@ void b3LoadMJCFCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int fl } } -b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -185,7 +185,7 @@ b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physCli return (b3SharedMemoryCommandHandle) command; } -int b3LoadBunnySetScale(b3SharedMemoryCommandHandle commandHandle, double scale) +B3_SHARED_API int b3LoadBunnySetScale(b3SharedMemoryCommandHandle commandHandle, double scale) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_LOAD_BUNNY); @@ -194,7 +194,7 @@ int b3LoadBunnySetScale(b3SharedMemoryCommandHandle commandHandle, double scale) return 0; } -int b3LoadBunnySetMass(b3SharedMemoryCommandHandle commandHandle, double mass) +B3_SHARED_API int b3LoadBunnySetMass(b3SharedMemoryCommandHandle commandHandle, double mass) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_LOAD_BUNNY); @@ -203,7 +203,7 @@ int b3LoadBunnySetMass(b3SharedMemoryCommandHandle commandHandle, double mass) return 0; } -int b3LoadBunnySetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, double collisionMargin) +B3_SHARED_API int b3LoadBunnySetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, double collisionMargin) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_LOAD_BUNNY); @@ -235,7 +235,7 @@ B3_SHARED_API int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle -int b3LoadSdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody) +B3_SHARED_API int b3LoadSdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -246,7 +246,7 @@ int b3LoadSdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, i return 0; } -int b3LoadSdfCommandSetUseGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling) +B3_SHARED_API int b3LoadSdfCommandSetUseGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -325,7 +325,7 @@ B3_SHARED_API int b3LoadUrdfCommandSetStartOrientation(b3SharedMemoryCommandHand return -1; } -b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -337,7 +337,7 @@ b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle return (b3SharedMemoryCommandHandle) command; } -int b3PhysicsParamSetGravity(b3SharedMemoryCommandHandle commandHandle, double gravx,double gravy, double gravz) +B3_SHARED_API int b3PhysicsParamSetGravity(b3SharedMemoryCommandHandle commandHandle, double gravx,double gravy, double gravz) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -348,7 +348,7 @@ int b3PhysicsParamSetGravity(b3SharedMemoryCommandHandle commandHandle, doub return 0; } -int b3PhysicsParamSetRealTimeSimulation(b3SharedMemoryCommandHandle commandHandle, int enableRealTimeSimulation) +B3_SHARED_API int b3PhysicsParamSetRealTimeSimulation(b3SharedMemoryCommandHandle commandHandle, int enableRealTimeSimulation) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -357,7 +357,7 @@ int b3PhysicsParamSetRealTimeSimulation(b3SharedMemoryCommandHandle commandH return 0; } -int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHandle, int flags) +B3_SHARED_API int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHandle, int flags) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -366,7 +366,7 @@ int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHan return 0; } -int b3PhysicsParamSetUseSplitImpulse(b3SharedMemoryCommandHandle commandHandle, int useSplitImpulse) +B3_SHARED_API int b3PhysicsParamSetUseSplitImpulse(b3SharedMemoryCommandHandle commandHandle, int useSplitImpulse) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -376,7 +376,7 @@ int b3PhysicsParamSetUseSplitImpulse(b3SharedMemoryCommandHandle commandHandle, return 0; } -int b3PhysicsParamSetSplitImpulsePenetrationThreshold(b3SharedMemoryCommandHandle commandHandle, double splitImpulsePenetrationThreshold) +B3_SHARED_API int b3PhysicsParamSetSplitImpulsePenetrationThreshold(b3SharedMemoryCommandHandle commandHandle, double splitImpulsePenetrationThreshold) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -386,7 +386,7 @@ int b3PhysicsParamSetSplitImpulsePenetrationThreshold(b3SharedMemoryCommandHandl return 0; } -int b3PhysicsParamSetContactBreakingThreshold(b3SharedMemoryCommandHandle commandHandle, double contactBreakingThreshold) +B3_SHARED_API int b3PhysicsParamSetContactBreakingThreshold(b3SharedMemoryCommandHandle commandHandle, double contactBreakingThreshold) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -395,7 +395,7 @@ int b3PhysicsParamSetContactBreakingThreshold(b3SharedMemoryCommandHandle comman command->m_updateFlags |= SIM_PARAM_UPDATE_CONTACT_BREAKING_THRESHOLD; return 0; } -int b3PhysicsParamSetMaxNumCommandsPer1ms(b3SharedMemoryCommandHandle commandHandle, int maxNumCmdPer1ms) +B3_SHARED_API int b3PhysicsParamSetMaxNumCommandsPer1ms(b3SharedMemoryCommandHandle commandHandle, int maxNumCmdPer1ms) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -406,7 +406,7 @@ int b3PhysicsParamSetMaxNumCommandsPer1ms(b3SharedMemoryCommandHandle commandHan } -int b3PhysicsParamSetEnableFileCaching(b3SharedMemoryCommandHandle commandHandle, int enableFileCaching) +B3_SHARED_API int b3PhysicsParamSetEnableFileCaching(b3SharedMemoryCommandHandle commandHandle, int enableFileCaching) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -417,7 +417,7 @@ int b3PhysicsParamSetEnableFileCaching(b3SharedMemoryCommandHandle commandHandle } -int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle commandHandle, double restitutionVelocityThreshold) +B3_SHARED_API int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle commandHandle, double restitutionVelocityThreshold) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -429,7 +429,7 @@ int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle co } -int b3PhysicsParamSetNumSolverIterations(b3SharedMemoryCommandHandle commandHandle, int numSolverIterations) +B3_SHARED_API int b3PhysicsParamSetNumSolverIterations(b3SharedMemoryCommandHandle commandHandle, int numSolverIterations) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -439,7 +439,7 @@ int b3PhysicsParamSetNumSolverIterations(b3SharedMemoryCommandHandle commandHand } -int b3PhysicsParamSetCollisionFilterMode(b3SharedMemoryCommandHandle commandHandle, int filterMode) +B3_SHARED_API int b3PhysicsParamSetCollisionFilterMode(b3SharedMemoryCommandHandle commandHandle, int filterMode) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -450,7 +450,7 @@ int b3PhysicsParamSetCollisionFilterMode(b3SharedMemoryCommandHandle commandHand -int b3PhysicsParamSetTimeStep(b3SharedMemoryCommandHandle commandHandle, double timeStep) +B3_SHARED_API int b3PhysicsParamSetTimeStep(b3SharedMemoryCommandHandle commandHandle, double timeStep) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -459,7 +459,7 @@ int b3PhysicsParamSetTimeStep(b3SharedMemoryCommandHandle commandHandle, double return 0; } -int b3PhysicsParamSetNumSubSteps(b3SharedMemoryCommandHandle commandHandle, int numSubSteps) +B3_SHARED_API int b3PhysicsParamSetNumSubSteps(b3SharedMemoryCommandHandle commandHandle, int numSubSteps) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -469,7 +469,7 @@ int b3PhysicsParamSetNumSubSteps(b3SharedMemoryCommandHandle commandHandle, int } -int b3PhysicsParamSetDefaultContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultContactERP) +B3_SHARED_API int b3PhysicsParamSetDefaultContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultContactERP) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -477,7 +477,7 @@ int b3PhysicsParamSetDefaultContactERP(b3SharedMemoryCommandHandle commandHandle command->m_physSimParamArgs.m_defaultContactERP = defaultContactERP; return 0; } -int b3PhysicsParamSetDefaultNonContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultNonContactERP) +B3_SHARED_API int b3PhysicsParamSetDefaultNonContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultNonContactERP) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -485,7 +485,7 @@ int b3PhysicsParamSetDefaultNonContactERP(b3SharedMemoryCommandHandle commandHan command->m_physSimParamArgs.m_defaultNonContactERP = defaultNonContactERP; return 0; } -int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandle, double frictionERP) +B3_SHARED_API int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandle, double frictionERP) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS); @@ -495,7 +495,7 @@ int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandl } -B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -522,12 +522,12 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3InitResetSimulationCommand(b3Phy } -b3SharedMemoryCommandHandle b3JointControlCommandInit(b3PhysicsClientHandle physClient, int controlMode) +B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit(b3PhysicsClientHandle physClient, int controlMode) { return b3JointControlCommandInit2(physClient,0,controlMode); } -b3SharedMemoryCommandHandle b3JointControlCommandInit2( b3PhysicsClientHandle physClient, int bodyUniqueId, int controlMode) +B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit2( b3PhysicsClientHandle physClient, int bodyUniqueId, int controlMode) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -545,7 +545,7 @@ b3SharedMemoryCommandHandle b3JointControlCommandInit2( b3PhysicsClientHandle ph return (b3SharedMemoryCommandHandle) command; } -int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, int qIndex, double value) +B3_SHARED_API int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, int qIndex, double value) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -558,7 +558,7 @@ int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, return 0; } -int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) +B3_SHARED_API int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -571,7 +571,7 @@ int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, return 0; } -int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) +B3_SHARED_API int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -584,7 +584,7 @@ int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, return 0; } -int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) +B3_SHARED_API int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -598,7 +598,7 @@ int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, } -int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) +B3_SHARED_API int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -611,7 +611,7 @@ int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int return 0; } -int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) +B3_SHARED_API int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -624,7 +624,7 @@ int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandl return 0; } -b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -637,7 +637,7 @@ b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandl return (b3SharedMemoryCommandHandle) command; } -int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle commandHandle, int computeLinkVelocity) +B3_SHARED_API int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle commandHandle, int computeLinkVelocity) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -650,7 +650,7 @@ int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle c } -int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, b3JointSensorState *state) +B3_SHARED_API int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, b3JointSensorState *state) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -683,7 +683,7 @@ int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle return 0; } -int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int linkIndex, b3LinkState *state) +B3_SHARED_API int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int linkIndex, b3LinkState *state) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -730,7 +730,7 @@ int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle return 0; } -b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -747,7 +747,7 @@ b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHan return 0; } -int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle,double radius) +B3_SHARED_API int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle,double radius) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -768,7 +768,7 @@ int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle,do return -1; } -int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,double halfExtents[3]) +B3_SHARED_API int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,double halfExtents[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -791,7 +791,7 @@ int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,doubl return -1; } -int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle,double radius, double height) +B3_SHARED_API int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle,double radius, double height) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -813,7 +813,7 @@ int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle,d return -1; } -int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle,double radius, double height) +B3_SHARED_API int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle,double radius, double height) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -836,7 +836,7 @@ int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle, } -int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, double planeNormal[3], double planeConstant) +B3_SHARED_API int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, double planeNormal[3], double planeConstant) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -860,7 +860,7 @@ int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, do return -1; } -int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,const char* fileName, double meshScale[3]) +B3_SHARED_API int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,const char* fileName, double meshScale[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -885,7 +885,7 @@ int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,cons return -1; } -void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, int flags) +B3_SHARED_API void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, int flags) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; @@ -901,7 +901,7 @@ void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle,int shap } -void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, double childPosition[3], double childOrientation[4]) +B3_SHARED_API void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, double childPosition[3], double childOrientation[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -923,7 +923,7 @@ void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle command } -int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -936,7 +936,7 @@ int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle) } -b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -952,7 +952,7 @@ b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle return 0; } -int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -964,7 +964,7 @@ int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle) return -1; } -b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -983,7 +983,7 @@ b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle p return 0; } -int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, double basePosition[3], double baseOrientation[4] , double baseInertialFramePosition[3], double baseInertialFrameOrientation[4]) +B3_SHARED_API int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, double basePosition[3], double baseOrientation[4] , double baseInertialFramePosition[3], double baseInertialFrameOrientation[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1036,7 +1036,7 @@ int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass return -2; } -int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double linkMass, double linkCollisionShapeIndex, +B3_SHARED_API int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double linkMass, double linkCollisionShapeIndex, double linkVisualShapeIndex, double linkPosition[3], double linkOrientation[4], @@ -1102,7 +1102,7 @@ int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double link //useMaximalCoordinates are disabled by default, enabling them is experimental and not fully supported yet -void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandHandle) +B3_SHARED_API void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandHandle) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1113,7 +1113,7 @@ void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandH } } -int b3GetStatusMultiBodyUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusMultiBodyUniqueId(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -1125,7 +1125,7 @@ int b3GetStatusMultiBodyUniqueId(b3SharedMemoryStatusHandle statusHandle) return -1; } -b3SharedMemoryCommandHandle b3CreateBoxShapeCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateBoxShapeCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1137,7 +1137,7 @@ b3SharedMemoryCommandHandle b3CreateBoxShapeCommandInit(b3PhysicsClientHandle ph return (b3SharedMemoryCommandHandle) command; } -int b3CreateBoxCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ) +B3_SHARED_API int b3CreateBoxCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1151,7 +1151,7 @@ int b3CreateBoxCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle } -int b3CreateBoxCommandSetHalfExtents(b3SharedMemoryCommandHandle commandHandle, double halfExtentsX,double halfExtentsY,double halfExtentsZ) +B3_SHARED_API int b3CreateBoxCommandSetHalfExtents(b3SharedMemoryCommandHandle commandHandle, double halfExtentsX,double halfExtentsY,double halfExtentsZ) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1166,7 +1166,7 @@ int b3CreateBoxCommandSetHalfExtents(b3SharedMemoryCommandHandle commandHandle, } -int b3CreateBoxCommandSetMass(b3SharedMemoryCommandHandle commandHandle, double mass) +B3_SHARED_API int b3CreateBoxCommandSetMass(b3SharedMemoryCommandHandle commandHandle, double mass) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1177,7 +1177,7 @@ int b3CreateBoxCommandSetMass(b3SharedMemoryCommandHandle commandHandle, double } -int b3CreateBoxCommandSetCollisionShapeType(b3SharedMemoryCommandHandle commandHandle, int collisionShapeType) +B3_SHARED_API int b3CreateBoxCommandSetCollisionShapeType(b3SharedMemoryCommandHandle commandHandle, int collisionShapeType) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1188,7 +1188,7 @@ int b3CreateBoxCommandSetCollisionShapeType(b3SharedMemoryCommandHandle commandH return 0; } -int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, double red,double green,double blue, double alpha) +B3_SHARED_API int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, double red,double green,double blue, double alpha) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1201,7 +1201,7 @@ int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, do return 0; } -int b3CreateBoxCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW) +B3_SHARED_API int b3CreateBoxCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1215,7 +1215,7 @@ int b3CreateBoxCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHan return 0; } -b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physClient, int bodyIndex) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physClient, int bodyIndex) { PhysicsClient* cl = (PhysicsClient* ) physClient; @@ -1235,7 +1235,7 @@ b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physCl return (b3SharedMemoryCommandHandle) command; } -int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ) +B3_SHARED_API int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1252,7 +1252,7 @@ int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle return 0; } -int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW) +B3_SHARED_API int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1271,7 +1271,7 @@ int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHan return 0; } -int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, double linVel[3]) +B3_SHARED_API int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, double linVel[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1288,7 +1288,7 @@ int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle command return 0; } -int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, double angVel[3]) +B3_SHARED_API int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, double angVel[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1305,7 +1305,7 @@ int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle comman return 0; } -int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* jointPositions) +B3_SHARED_API int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* jointPositions) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1324,7 +1324,7 @@ int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHand -int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointPosition) +B3_SHARED_API int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointPosition) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1341,7 +1341,7 @@ int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3Shar return 0; } -int b3CreatePoseCommandSetJointVelocities(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int numJointVelocities, const double* jointVelocities) +B3_SHARED_API int b3CreatePoseCommandSetJointVelocities(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int numJointVelocities, const double* jointVelocities) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1359,7 +1359,7 @@ int b3CreatePoseCommandSetJointVelocities(b3PhysicsClientHandle physClient, b3Sh return 0; } -int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointVelocity) +B3_SHARED_API int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointVelocity) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1378,7 +1378,7 @@ int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle physClient, b3Shar -b3SharedMemoryCommandHandle b3CreateSensorCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateSensorCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1394,7 +1394,7 @@ b3SharedMemoryCommandHandle b3CreateSensorCommandInit(b3PhysicsClientHandle phys } -int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle commandHandle, int jointIndex, int enable) +B3_SHARED_API int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle commandHandle, int jointIndex, int enable) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1408,7 +1408,7 @@ int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle c return 0; } -int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, int linkIndex, int enable) +B3_SHARED_API int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, int linkIndex, int enable) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1423,14 +1423,14 @@ int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, in -void b3DisconnectSharedMemory(b3PhysicsClientHandle physClient) +B3_SHARED_API void b3DisconnectSharedMemory(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; cl->disconnectSharedMemory(); delete cl; } -b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl && cl->isConnected()) @@ -1444,7 +1444,7 @@ b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHandle physClien -int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; //b3Assert(status); @@ -1455,7 +1455,7 @@ int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle) return CMD_INVALID_STATUS; } -int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity) +B3_SHARED_API int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity) { int numBodies = 0; const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; @@ -1484,7 +1484,7 @@ int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyInd return numBodies; } -int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -1518,7 +1518,7 @@ int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle) return bodyId; } -b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1531,7 +1531,7 @@ b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHan return (b3SharedMemoryCommandHandle) command; } -int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[3], double aabbMax[3]) +B3_SHARED_API int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[3], double aabbMax[3]) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; const b3SendCollisionInfoArgs &args = status->m_sendCollisionInfoArgs; @@ -1566,7 +1566,7 @@ int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, doub return 0; } -int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, +B3_SHARED_API int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, int* numDegreeOfFreedomQ, int* numDegreeOfFreedomU, @@ -1604,7 +1604,7 @@ int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, return true; } -int b3CanSubmitCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API int b3CanSubmitCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -1614,7 +1614,7 @@ int b3CanSubmitCommand(b3PhysicsClientHandle physClient) return false; } -int b3SubmitClientCommand(b3PhysicsClientHandle physClient, const b3SharedMemoryCommandHandle commandHandle) +B3_SHARED_API int b3SubmitClientCommand(b3PhysicsClientHandle physClient, const b3SharedMemoryCommandHandle commandHandle) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; PhysicsClient* cl = (PhysicsClient* ) physClient; @@ -1667,19 +1667,19 @@ B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3Ph ///return the total number of bodies in the simulation -int b3GetNumBodies(b3PhysicsClientHandle physClient) +B3_SHARED_API int b3GetNumBodies(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getNumBodies(); } -int b3GetNumUserConstraints(b3PhysicsClientHandle physClient) +B3_SHARED_API int b3GetNumUserConstraints(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getNumUserConstraints(); } -int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* infoPtr) +B3_SHARED_API int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* infoPtr) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3UserConstraint constraintInfo1; @@ -1699,21 +1699,21 @@ int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniq } /// return the user constraint id, given the index in range [0 , b3GetNumUserConstraints() ) -int b3GetUserConstraintId(b3PhysicsClientHandle physClient, int serialIndex) +B3_SHARED_API int b3GetUserConstraintId(b3PhysicsClientHandle physClient, int serialIndex) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getUserConstraintId(serialIndex); } /// return the body unique id, given the index in range [0 , b3GetNumBodies() ) -int b3GetBodyUniqueId(b3PhysicsClientHandle physClient, int serialIndex) +B3_SHARED_API int b3GetBodyUniqueId(b3PhysicsClientHandle physClient, int serialIndex) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getBodyUniqueId(serialIndex); } ///given a body unique id, return the body information. See b3BodyInfo in SharedMemoryPublic.h -int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3BodyInfo* info) +B3_SHARED_API int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3BodyInfo* info) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getBodyInfo(bodyUniqueId,*info); @@ -1721,19 +1721,19 @@ int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3B -int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyId) +B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyId) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getNumJoints(bodyId); } -int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyIndex, int jointIndex, struct b3JointInfo* info) +B3_SHARED_API int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyIndex, int jointIndex, struct b3JointInfo* info) { PhysicsClient* cl = (PhysicsClient* ) physClient; return cl->getJointInfo(bodyIndex, jointIndex, *info); } -b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex) +B3_SHARED_API b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1746,7 +1746,7 @@ b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle p return (b3SharedMemoryCommandHandle) command; } -int b3GetDynamicsInfo(b3SharedMemoryStatusHandle statusHandle, struct b3DynamicsInfo* info) +B3_SHARED_API int b3GetDynamicsInfo(b3SharedMemoryStatusHandle statusHandle, struct b3DynamicsInfo* info) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; const b3DynamicsInfo &dynamicsInfo = status->m_dynamicsInfo; @@ -1759,7 +1759,7 @@ int b3GetDynamicsInfo(b3SharedMemoryStatusHandle statusHandle, struct b3Dynamics return true; } -b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1774,7 +1774,7 @@ b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo(b3PhysicsClientHandle physC return (b3SharedMemoryCommandHandle) command; } -int b3ChangeDynamicsInfoSetMass(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double mass) +B3_SHARED_API int b3ChangeDynamicsInfoSetMass(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double mass) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1786,7 +1786,7 @@ int b3ChangeDynamicsInfoSetMass(b3SharedMemoryCommandHandle commandHandle, int b return 0; } -int b3ChangeDynamicsInfoSetLateralFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction) +B3_SHARED_API int b3ChangeDynamicsInfoSetLateralFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1797,7 +1797,7 @@ int b3ChangeDynamicsInfoSetLateralFriction(b3SharedMemoryCommandHandle commandHa return 0; } -int b3ChangeDynamicsInfoSetSpinningFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction) +B3_SHARED_API int b3ChangeDynamicsInfoSetSpinningFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1808,7 +1808,7 @@ int b3ChangeDynamicsInfoSetSpinningFriction(b3SharedMemoryCommandHandle commandH return 0; } -int b3ChangeDynamicsInfoSetRollingFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction) +B3_SHARED_API int b3ChangeDynamicsInfoSetRollingFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1821,7 +1821,7 @@ int b3ChangeDynamicsInfoSetRollingFriction(b3SharedMemoryCommandHandle commandHa } -int b3ChangeDynamicsInfoSetRestitution(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double restitution) +B3_SHARED_API int b3ChangeDynamicsInfoSetRestitution(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double restitution) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1831,7 +1831,7 @@ int b3ChangeDynamicsInfoSetRestitution(b3SharedMemoryCommandHandle commandHandle command->m_updateFlags |= CHANGE_DYNAMICS_INFO_SET_RESTITUTION; return 0; } -int b3ChangeDynamicsInfoSetLinearDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double linearDamping) +B3_SHARED_API int b3ChangeDynamicsInfoSetLinearDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double linearDamping) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1843,7 +1843,7 @@ int b3ChangeDynamicsInfoSetLinearDamping(b3SharedMemoryCommandHandle commandHand } -int b3ChangeDynamicsInfoSetAngularDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double angularDamping) +B3_SHARED_API int b3ChangeDynamicsInfoSetAngularDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double angularDamping) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1853,7 +1853,7 @@ int b3ChangeDynamicsInfoSetAngularDamping(b3SharedMemoryCommandHandle commandHan return 0; } -int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex,double contactStiffness, double contactDamping) +B3_SHARED_API int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex,double contactStiffness, double contactDamping) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1865,7 +1865,7 @@ int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemoryCommandHandl return 0; } -int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex, int frictionAnchor) +B3_SHARED_API int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex, int frictionAnchor) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO); @@ -1878,7 +1878,7 @@ int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHan -b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, struct b3JointInfo* info) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, struct b3JointInfo* info) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1904,7 +1904,7 @@ b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHan return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -1917,7 +1917,7 @@ b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHa return (b3SharedMemoryCommandHandle)command; } -int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double pivotInB[3]) +B3_SHARED_API int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double pivotInB[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1932,7 +1932,7 @@ int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHan command->m_userConstraintArguments.m_childFrame[2] = pivotInB[2]; return 0; } -int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double frameOrnInB[4]) +B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double frameOrnInB[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1949,7 +1949,7 @@ int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHan return 0; } -int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce) +B3_SHARED_API int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1961,7 +1961,7 @@ int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHan return 0; } -int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio) +B3_SHARED_API int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1974,7 +1974,7 @@ int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHa return 0; } -int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink) +B3_SHARED_API int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -1988,7 +1988,7 @@ int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle command } -b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2002,7 +2002,7 @@ b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHa return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3InitRemoveBodyCommand(b3PhysicsClientHandle physClient, int bodyUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveBodyCommand(b3PhysicsClientHandle physClient, int bodyUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2019,7 +2019,7 @@ b3SharedMemoryCommandHandle b3InitRemoveBodyCommand(b3PhysicsClientHandle physCl return (b3SharedMemoryCommandHandle)command; } -int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -2034,7 +2034,7 @@ int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle) } -b3SharedMemoryCommandHandle b3PickBody(b3PhysicsClientHandle physClient, double rayFromWorldX, +B3_SHARED_API b3SharedMemoryCommandHandle b3PickBody(b3PhysicsClientHandle physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) { @@ -2053,7 +2053,7 @@ b3SharedMemoryCommandHandle b3PickBody(b3PhysicsClientHandle physClient, double return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3MovePickedBody(b3PhysicsClientHandle physClient, double rayFromWorldX, +B3_SHARED_API b3SharedMemoryCommandHandle b3MovePickedBody(b3PhysicsClientHandle physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) @@ -2073,7 +2073,7 @@ b3SharedMemoryCommandHandle b3MovePickedBody(b3PhysicsClientHandle physClient, d return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3RemovePickingConstraint(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3RemovePickingConstraint(b3PhysicsClientHandle physClient) { PhysicsClient *cl = (PhysicsClient *)physClient; b3Assert(cl); @@ -2084,7 +2084,7 @@ b3SharedMemoryCommandHandle b3RemovePickingConstraint(b3PhysicsClientHandle phys return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle physClient, double rayFromWorldX, +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) { @@ -2105,7 +2105,7 @@ b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle phy return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient *cl = (PhysicsClient *)physClient; b3Assert(cl); @@ -2118,7 +2118,7 @@ b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandl return (b3SharedMemoryCommandHandle)command; } -void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[3], const double rayToWorld[3]) +B3_SHARED_API void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[3], const double rayToWorld[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2140,7 +2140,7 @@ void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const doubl } -void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo) +B3_SHARED_API void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -2151,7 +2151,7 @@ void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastI ///If you re-connected to an existing server, or server changed otherwise, sync the body info -b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2163,7 +2163,7 @@ b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle phys return (b3SharedMemoryCommandHandle) command; } -b3SharedMemoryCommandHandle b3InitRequestDebugLinesCommand(b3PhysicsClientHandle physClient, int debugMode) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestDebugLinesCommand(b3PhysicsClientHandle physClient, int debugMode) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2176,7 +2176,7 @@ b3SharedMemoryCommandHandle b3InitRequestDebugLinesCommand(b3PhysicsClientHandle command->m_requestDebugLinesArguments.m_startingLineIndex = 0; return (b3SharedMemoryCommandHandle) command; } -void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* lines) +B3_SHARED_API void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* lines) { PhysicsClient* cl = (PhysicsClient* ) physClient; @@ -2194,7 +2194,7 @@ void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* l /// Add/remove user-specific debug lines and debug text messages -b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, double fromXYZ[3], double toXYZ[3], double colorRGB[3], double lineWidth, double lifeTime) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, double fromXYZ[3], double toXYZ[3], double colorRGB[3], double lineWidth, double lifeTime) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2225,7 +2225,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle p return (b3SharedMemoryCommandHandle) command; } -b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, double positionXYZ[3], double colorRGB[3], double textSize, double lifeTime) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, double positionXYZ[3], double colorRGB[3], double textSize, double lifeTime) { PhysicsClient* cl = (PhysicsClient* ) physClient; @@ -2263,7 +2263,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle p return (b3SharedMemoryCommandHandle) command; } -void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, int optionFlags) +B3_SHARED_API void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, int optionFlags) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2273,7 +2273,7 @@ void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, in command->m_updateFlags |= USER_DEBUG_HAS_OPTION_FLAGS; } -void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, double orientation[4]) +B3_SHARED_API void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, double orientation[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2288,7 +2288,7 @@ void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, do } -void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex) +B3_SHARED_API void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2300,7 +2300,7 @@ void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, i } -b3SharedMemoryCommandHandle b3InitUserDebugAddParameter(b3PhysicsClientHandle physClient, const char* txt, double rangeMin, double rangeMax, double startValue) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugAddParameter(b3PhysicsClientHandle physClient, const char* txt, double rangeMin, double rangeMax, double startValue) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2325,7 +2325,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugAddParameter(b3PhysicsClientHandle ph return (b3SharedMemoryCommandHandle)command; } -b3SharedMemoryCommandHandle b3InitUserDebugReadParameter(b3PhysicsClientHandle physClient, int debugItemUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugReadParameter(b3PhysicsClientHandle physClient, int debugItemUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2338,7 +2338,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugReadParameter(b3PhysicsClientHandle p return (b3SharedMemoryCommandHandle) command; } -int b3GetStatusDebugParameterValue(b3SharedMemoryStatusHandle statusHandle, double* paramValue) +B3_SHARED_API int b3GetStatusDebugParameterValue(b3SharedMemoryStatusHandle statusHandle, double* paramValue) { const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; btAssert(status->m_type == CMD_USER_DEBUG_DRAW_PARAMETER_COMPLETED); @@ -2351,7 +2351,7 @@ int b3GetStatusDebugParameterValue(b3SharedMemoryStatusHandle statusHandle, doub } -b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle physClient, int debugItemUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle physClient, int debugItemUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2365,7 +2365,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle phys } -b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2377,7 +2377,7 @@ b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle p return (b3SharedMemoryCommandHandle) command; } -int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; btAssert(status->m_type == CMD_USER_DEBUG_DRAW_COMPLETED); @@ -2387,7 +2387,7 @@ int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle) return status->m_userDebugDrawArgs.m_debugItemUniqueId; } -b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -2401,7 +2401,7 @@ b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle phys -void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, double objectColorRGB[3]) +B3_SHARED_API void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, double objectColorRGB[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2414,7 +2414,7 @@ void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int object command->m_userDebugDrawArgs.m_objectDebugColorRGB[2] = objectColorRGB[2]; } -void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex) +B3_SHARED_API void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2429,7 +2429,7 @@ void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int obj ///request an image from a simulated camera, using a software renderer. -b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2442,7 +2442,7 @@ b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physC return (b3SharedMemoryCommandHandle) command; } -void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandle, int renderer) +B3_SHARED_API void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandle, int renderer) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2454,7 +2454,7 @@ void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandl } } -void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle commandHandle, float viewMatrix[16], float projectionMatrix[16]) +B3_SHARED_API void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle commandHandle, float viewMatrix[16], float projectionMatrix[16]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2467,7 +2467,7 @@ void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle commandHa command->m_updateFlags |= REQUEST_PIXEL_ARGS_HAS_CAMERA_MATRICES; } -void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[3]) +B3_SHARED_API void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2479,7 +2479,7 @@ void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHa command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_LIGHT_DIRECTION; } -void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[3]) +B3_SHARED_API void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2491,7 +2491,7 @@ void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_LIGHT_COLOR; } -void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance) +B3_SHARED_API void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2500,7 +2500,7 @@ void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHan command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_LIGHT_DISTANCE; } -void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle commandHandle, float lightAmbientCoeff) +B3_SHARED_API void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle commandHandle, float lightAmbientCoeff) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2509,7 +2509,7 @@ void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle comman command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_AMBIENT_COEFF; } -void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle commandHandle, float lightDiffuseCoeff) +B3_SHARED_API void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle commandHandle, float lightDiffuseCoeff) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2518,7 +2518,7 @@ void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle comman command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_DIFFUSE_COEFF; } -void b3RequestCameraImageSetLightSpecularCoeff(b3SharedMemoryCommandHandle commandHandle, float lightSpecularCoeff) +B3_SHARED_API void b3RequestCameraImageSetLightSpecularCoeff(b3SharedMemoryCommandHandle commandHandle, float lightSpecularCoeff) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2527,7 +2527,7 @@ void b3RequestCameraImageSetLightSpecularCoeff(b3SharedMemoryCommandHandle comma command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_SPECULAR_COEFF; } -void b3RequestCameraImageSetShadow(b3SharedMemoryCommandHandle commandHandle, int hasShadow) +B3_SHARED_API void b3RequestCameraImageSetShadow(b3SharedMemoryCommandHandle commandHandle, int hasShadow) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2536,7 +2536,7 @@ void b3RequestCameraImageSetShadow(b3SharedMemoryCommandHandle commandHandle, in command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_SHADOW; } -void b3ComputePositionFromViewMatrix(const float viewMatrix[16], float cameraPosition[3], float cameraTargetPosition[3], float cameraUp[3]) +B3_SHARED_API void b3ComputePositionFromViewMatrix(const float viewMatrix[16], float cameraPosition[3], float cameraTargetPosition[3], float cameraUp[3]) { b3Matrix3x3 r(viewMatrix[0], viewMatrix[4], viewMatrix[8], viewMatrix[1], viewMatrix[5], viewMatrix[9], viewMatrix[2], viewMatrix[6], viewMatrix[10]); b3Vector3 p = b3MakeVector3(viewMatrix[12], viewMatrix[13], viewMatrix[14]); @@ -2560,7 +2560,7 @@ void b3ComputePositionFromViewMatrix(const float viewMatrix[16], float cameraPos cameraUp[2] = u[2]; } -void b3ComputeViewMatrixFromPositions(const float cameraPosition[3], const float cameraTargetPosition[3], const float cameraUp[3], float viewMatrix[16]) +B3_SHARED_API void b3ComputeViewMatrixFromPositions(const float cameraPosition[3], const float cameraTargetPosition[3], const float cameraUp[3], float viewMatrix[16]) { b3Vector3 eye = b3MakeVector3(cameraPosition[0], cameraPosition[1], cameraPosition[2]); b3Vector3 center = b3MakeVector3(cameraTargetPosition[0], cameraTargetPosition[1], cameraTargetPosition[2]); @@ -2593,7 +2593,7 @@ void b3ComputeViewMatrixFromPositions(const float cameraPosition[3], const float } -void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[3], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[16]) +B3_SHARED_API void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[3], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[16]) { b3Vector3 camUpVector; b3Vector3 camForward; @@ -2649,7 +2649,7 @@ void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[3], fl } -void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[16]) +B3_SHARED_API void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[16]) { projectionMatrix[0 * 4 + 0] = (float(2) * nearVal) / (right - left); projectionMatrix[0 * 4 + 1] = float(0); @@ -2673,7 +2673,7 @@ void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, } -void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[16]) +B3_SHARED_API void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[16]) { float yScale = 1.0 / tan((3.141592538 / 180.0) * fov / 2); float xScale = yScale / aspect; @@ -2700,7 +2700,7 @@ void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float } -void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[3], float distance, float yaw, float pitch, float roll, int upAxis) +B3_SHARED_API void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[3], float distance, float yaw, float pitch, float roll, int upAxis) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2714,7 +2714,7 @@ void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandl -void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, const float cameraPosition[3], const float cameraTargetPosition[3], const float cameraUp[3]) +B3_SHARED_API void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, const float cameraPosition[3], const float cameraTargetPosition[3], const float cameraUp[3]) { float viewMatrix[16]; b3ComputeViewMatrixFromPositions(cameraPosition, cameraTargetPosition, cameraUp, viewMatrix); @@ -2729,7 +2729,7 @@ void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle commandHandle } -void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float left, float right, float bottom, float top, float nearVal, float farVal) +B3_SHARED_API void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float left, float right, float bottom, float top, float nearVal, float farVal) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; @@ -2741,7 +2741,7 @@ void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle command command->m_updateFlags |= REQUEST_PIXEL_ARGS_HAS_CAMERA_MATRICES; } -void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float fov, float aspect, float nearVal, float farVal) +B3_SHARED_API void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float fov, float aspect, float nearVal, float farVal) { @@ -2754,7 +2754,7 @@ void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle comm command->m_updateFlags |= REQUEST_PIXEL_ARGS_HAS_CAMERA_MATRICES; } -void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle commandHandle, int width, int height ) +B3_SHARED_API void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle commandHandle, int width, int height ) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2764,7 +2764,7 @@ void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle commandH command->m_updateFlags |= REQUEST_PIXEL_ARGS_SET_PIXEL_WIDTH_HEIGHT; } -void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImageData* imageData) +B3_SHARED_API void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImageData* imageData) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -2774,7 +2774,7 @@ void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImage } ///request an contact point information -b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2791,7 +2791,7 @@ b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClient return (b3SharedMemoryCommandHandle) command; } -void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA) +B3_SHARED_API void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2799,7 +2799,7 @@ void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int body command->m_requestContactPointArguments.m_objectAIndexFilter = bodyUniqueIdA; } -void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA) +B3_SHARED_API void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2808,7 +2808,7 @@ void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int link command->m_requestContactPointArguments.m_linkIndexAIndexFilter= linkIndexA; } -void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB) +B3_SHARED_API void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2817,12 +2817,12 @@ void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int link command->m_requestContactPointArguments.m_linkIndexBIndexFilter = linkIndexB; } -void b3SetClosestDistanceFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA) +B3_SHARED_API void b3SetClosestDistanceFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA) { b3SetContactFilterLinkA(commandHandle, linkIndexA); } -void b3SetClosestDistanceFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB) +B3_SHARED_API void b3SetClosestDistanceFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB) { b3SetContactFilterLinkB(commandHandle, linkIndexB); } @@ -2830,7 +2830,7 @@ void b3SetClosestDistanceFilterLinkB(b3SharedMemoryCommandHandle commandHandle, -void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB) +B3_SHARED_API void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2840,7 +2840,7 @@ void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int body ///compute the closest points between two bodies -b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle physClient) { b3SharedMemoryCommandHandle commandHandle =b3InitRequestContactPointInformation(physClient); struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; @@ -2851,17 +2851,17 @@ b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle phy return commandHandle; } -void b3SetClosestDistanceFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA) +B3_SHARED_API void b3SetClosestDistanceFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA) { b3SetContactFilterBodyA(commandHandle,bodyUniqueIdA); } -void b3SetClosestDistanceFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB) +B3_SHARED_API void b3SetClosestDistanceFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB) { b3SetContactFilterBodyB(commandHandle,bodyUniqueIdB); } -void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, double distance) +B3_SHARED_API void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, double distance) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2872,7 +2872,7 @@ void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, do ///get all the bodies that touch a given axis aligned bounding box specified in world space (min and max coordinates) -b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[3], const double aabbMax[3]) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[3], const double aabbMax[3]) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -2892,7 +2892,7 @@ b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physCli return (b3SharedMemoryCommandHandle)command; } -void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOverlapData* data) +B3_SHARED_API void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOverlapData* data) { PhysicsClient* cl = (PhysicsClient*)physClient; if (cl) @@ -2903,7 +2903,7 @@ void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOver -void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData) +B3_SHARED_API void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -2912,7 +2912,7 @@ void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3Con } } -void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo) +B3_SHARED_API void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo) { b3GetContactPointInformation(physClient,contactPointInfo); } @@ -2920,7 +2920,7 @@ void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3Con //request visual shape information -b3SharedMemoryCommandHandle b3InitRequestVisualShapeInformation(b3PhysicsClientHandle physClient, int bodyUniqueIdA) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestVisualShapeInformation(b3PhysicsClientHandle physClient, int bodyUniqueIdA) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2934,7 +2934,7 @@ b3SharedMemoryCommandHandle b3InitRequestVisualShapeInformation(b3PhysicsClientH return (b3SharedMemoryCommandHandle) command; } -void b3GetVisualShapeInformation(b3PhysicsClientHandle physClient, struct b3VisualShapeInformation* visualShapeInfo) +B3_SHARED_API void b3GetVisualShapeInformation(b3PhysicsClientHandle physClient, struct b3VisualShapeInformation* visualShapeInfo) { PhysicsClient* cl = (PhysicsClient*)physClient; if (cl) @@ -2943,7 +2943,7 @@ void b3GetVisualShapeInformation(b3PhysicsClientHandle physClient, struct b3Visu } } -b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHandle physClient, int textureUniqueId, int width, int height, const char* rgbPixels) +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHandle physClient, int textureUniqueId, int width, int height, const char* rgbPixels) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2962,7 +2962,7 @@ b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHand } -b3SharedMemoryCommandHandle b3InitLoadTexture(b3PhysicsClientHandle physClient, const char* filename) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitLoadTexture(b3PhysicsClientHandle physClient, const char* filename) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -2982,7 +2982,7 @@ b3SharedMemoryCommandHandle b3InitLoadTexture(b3PhysicsClientHandle physClient, return (b3SharedMemoryCommandHandle) command; } -int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle) { int uid = -1; const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; @@ -2994,7 +2994,7 @@ int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle) return uid; } -b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -3015,7 +3015,7 @@ b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physCl return (b3SharedMemoryCommandHandle) command; } -void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, double rgbaColor[4]) +B3_SHARED_API void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, double rgbaColor[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3031,7 +3031,7 @@ void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, dou } } -void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, double specularColor[3]) +B3_SHARED_API void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, double specularColor[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3046,7 +3046,7 @@ void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, } } -b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3Assert(cl); @@ -3060,7 +3060,7 @@ b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandl return (b3SharedMemoryCommandHandle) command; } -void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[3], const double position[3], int flag) +B3_SHARED_API void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[3], const double position[3], int flag) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3077,7 +3077,7 @@ void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUni command->m_externalForceArguments.m_numForcesAndTorques++; } -void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[3], int flag) +B3_SHARED_API void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[3], int flag) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3097,7 +3097,7 @@ void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUn ///compute the forces to achieve an acceleration, given a state q and qdot using inverse dynamics -b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, +B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations) { PhysicsClient* cl = (PhysicsClient*)physClient; @@ -3120,7 +3120,7 @@ b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit(b3PhysicsClien return (b3SharedMemoryCommandHandle)command; } -int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHandle statusHandle, +B3_SHARED_API int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, int* dofCount, double* jointForces) @@ -3151,7 +3151,7 @@ int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHandle statusHandl return true; } -b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, int linkIndex, const double* localPosition, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations) +B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, int linkIndex, const double* localPosition, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3178,7 +3178,7 @@ b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle } -int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian) +B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian) { const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; btAssert(status->m_type == CMD_CALCULATED_JACOBIAN_COMPLETED); @@ -3205,7 +3205,7 @@ int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJ } ///compute the joint positions to move the end effector to a desired target using inverse kinematics -b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex) +B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3221,7 +3221,7 @@ b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsCli } -void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[3]) +B3_SHARED_API void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3235,7 +3235,7 @@ void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHand } -void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[3], const double targetOrientation[4]) +B3_SHARED_API void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[3], const double targetOrientation[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3254,7 +3254,7 @@ void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemory } -void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[3], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose) +B3_SHARED_API void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[3], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3275,7 +3275,7 @@ void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle } } -void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[3], const double targetOrientation[4], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose) +B3_SHARED_API void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[3], const double targetOrientation[4], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3302,7 +3302,7 @@ void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHan } -void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* jointDampingCoeff) +B3_SHARED_API void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* jointDampingCoeff) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3315,7 +3315,7 @@ void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle com } } -int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle statusHandle, +B3_SHARED_API int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, int* dofCount, double* jointPositions) @@ -3345,7 +3345,7 @@ int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle status return true; } -b3SharedMemoryCommandHandle b3RequestVREventsCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestVREventsCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3358,7 +3358,7 @@ b3SharedMemoryCommandHandle b3RequestVREventsCommandInit(b3PhysicsClientHandle p return (b3SharedMemoryCommandHandle)command; } -void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter) +B3_SHARED_API void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3368,7 +3368,7 @@ void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, in } } -void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* vrEventsData) +B3_SHARED_API void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* vrEventsData) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -3377,7 +3377,7 @@ void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* } } -b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3392,7 +3392,7 @@ b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle } -int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double rootPos[3]) +B3_SHARED_API int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double rootPos[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3405,7 +3405,7 @@ int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double } -int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, double rootOrn[4]) +B3_SHARED_API int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, double rootOrn[4]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3419,7 +3419,7 @@ int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, doub return 0; } -int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId) +B3_SHARED_API int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3429,7 +3429,7 @@ int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int o return 0; } -int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, int flag) +B3_SHARED_API int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, int flag) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3440,7 +3440,7 @@ int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, i } -b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3454,7 +3454,7 @@ b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit(b3PhysicsClientHa return (b3SharedMemoryCommandHandle)command; } -void b3GetKeyboardEventsData(b3PhysicsClientHandle physClient, struct b3KeyboardEventsData* keyboardEventsData) +B3_SHARED_API void b3GetKeyboardEventsData(b3PhysicsClientHandle physClient, struct b3KeyboardEventsData* keyboardEventsData) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -3463,7 +3463,7 @@ void b3GetKeyboardEventsData(b3PhysicsClientHandle physClient, struct b3Keyboard } } -b3SharedMemoryCommandHandle b3RequestMouseEventsCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestMouseEventsCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3477,7 +3477,7 @@ b3SharedMemoryCommandHandle b3RequestMouseEventsCommandInit(b3PhysicsClientHandl return (b3SharedMemoryCommandHandle)command; } -void b3GetMouseEventsData(b3PhysicsClientHandle physClient, struct b3MouseEventsData* mouseEventsData) +B3_SHARED_API void b3GetMouseEventsData(b3PhysicsClientHandle physClient, struct b3MouseEventsData* mouseEventsData) { PhysicsClient* cl = (PhysicsClient* ) physClient; if (cl) @@ -3489,7 +3489,7 @@ void b3GetMouseEventsData(b3PhysicsClientHandle physClient, struct b3MouseEvents -b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name) +B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3514,7 +3514,7 @@ b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle phy return (b3SharedMemoryCommandHandle)command; } -void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration) +B3_SHARED_API void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3525,7 +3525,7 @@ void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle comma } } -b3SharedMemoryCommandHandle b3StateLoggingCommandInit(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3StateLoggingCommandInit(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3542,7 +3542,7 @@ b3SharedMemoryCommandHandle b3StateLoggingCommandInit(b3PhysicsClientHandle phys } -int b3StateLoggingStart(b3SharedMemoryCommandHandle commandHandle, int loggingType, const char* fileName) +B3_SHARED_API int b3StateLoggingStart(b3SharedMemoryCommandHandle commandHandle, int loggingType, const char* fileName) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3564,7 +3564,7 @@ int b3StateLoggingStart(b3SharedMemoryCommandHandle commandHandle, int loggingTy return 0; } -int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle) +B3_SHARED_API int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; b3Assert(status); @@ -3576,7 +3576,7 @@ int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle) return -1; } -int b3StateLoggingAddLoggingObjectUniqueId(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId) +B3_SHARED_API int b3StateLoggingAddLoggingObjectUniqueId(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3592,7 +3592,7 @@ int b3StateLoggingAddLoggingObjectUniqueId(b3SharedMemoryCommandHandle commandHa return 0; } -int b3StateLoggingSetLinkIndexA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA) +B3_SHARED_API int b3StateLoggingSetLinkIndexA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3605,7 +3605,7 @@ int b3StateLoggingSetLinkIndexA(b3SharedMemoryCommandHandle commandHandle, int l return 0; } -int b3StateLoggingSetLinkIndexB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB) +B3_SHARED_API int b3StateLoggingSetLinkIndexB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3618,7 +3618,7 @@ int b3StateLoggingSetLinkIndexB(b3SharedMemoryCommandHandle commandHandle, int l return 0; } -int b3StateLoggingSetBodyAUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyAUniqueId) +B3_SHARED_API int b3StateLoggingSetBodyAUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyAUniqueId) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3631,7 +3631,7 @@ int b3StateLoggingSetBodyAUniqueId(b3SharedMemoryCommandHandle commandHandle, in return 0; } -int b3StateLoggingSetBodyBUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyBUniqueId) +B3_SHARED_API int b3StateLoggingSetBodyBUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyBUniqueId) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3644,7 +3644,7 @@ int b3StateLoggingSetBodyBUniqueId(b3SharedMemoryCommandHandle commandHandle, in return 0; } -int b3StateLoggingSetMaxLogDof(b3SharedMemoryCommandHandle commandHandle, int maxLogDof) +B3_SHARED_API int b3StateLoggingSetMaxLogDof(b3SharedMemoryCommandHandle commandHandle, int maxLogDof) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3657,7 +3657,7 @@ int b3StateLoggingSetMaxLogDof(b3SharedMemoryCommandHandle commandHandle, int ma return 0; } -int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int logFlags) +B3_SHARED_API int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int logFlags) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3673,7 +3673,7 @@ int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int log -int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter) +B3_SHARED_API int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3686,7 +3686,7 @@ int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, return 0; } -int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUid) +B3_SHARED_API int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUid) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3701,7 +3701,7 @@ int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUid ///configure the 3D OpenGL debug visualizer (enable/disable GUI widgets, shadows, position camera etc) -b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3715,7 +3715,7 @@ b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandl return (b3SharedMemoryCommandHandle)command; } -void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandle commandHandle, int flag, int enabled) +B3_SHARED_API void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandle commandHandle, int flag, int enabled) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3728,7 +3728,7 @@ void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandl } } -void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[3]) +B3_SHARED_API void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[3]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -3746,7 +3746,7 @@ void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle comman } } -b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3PhysicsClientHandle physClient) +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3761,7 +3761,7 @@ b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3Physics } -int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, b3OpenGLVisualizerCameraInfo* camera) +B3_SHARED_API int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, b3OpenGLVisualizerCameraInfo* camera) { const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle; //b3Assert(status); @@ -3773,7 +3773,7 @@ int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, b return 0; } -void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds) +B3_SHARED_API void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3785,7 +3785,7 @@ void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds) } -double b3GetTimeOut(b3PhysicsClientHandle physClient) +B3_SHARED_API double b3GetTimeOut(b3PhysicsClientHandle physClient) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3796,7 +3796,7 @@ double b3GetTimeOut(b3PhysicsClientHandle physClient) return -1; } -b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle physClient, char* path) +B3_SHARED_API b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle physClient, char* path) { PhysicsClient* cl = (PhysicsClient*)physClient; b3Assert(cl); @@ -3815,7 +3815,7 @@ b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle phys } -void b3MultiplyTransforms(const double posA[3], const double ornA[4], const double posB[3], const double ornB[4], double outPos[3], double outOrn[4]) +B3_SHARED_API void b3MultiplyTransforms(const double posA[3], const double ornA[4], const double posB[3], const double ornB[4], double outPos[3], double outOrn[4]) { b3Transform trA; b3Transform trB; @@ -3834,7 +3834,7 @@ void b3MultiplyTransforms(const double posA[3], const double ornA[4], const doub outOrn[3] = orn[3]; } -void b3InvertTransform(const double pos[3], const double orn[4], double outPos[3], double outOrn[4]) +B3_SHARED_API void b3InvertTransform(const double pos[3], const double orn[4], double outPos[3], double outOrn[4]) { b3Transform tr; tr.setOrigin(b3MakeVector3(pos[0],pos[1],pos[2])); diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index a370df102..af297ea68 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -41,10 +41,10 @@ extern "C" { ///b3DisconnectSharedMemory will disconnect the client from the server and cleanup memory. -void b3DisconnectSharedMemory(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3DisconnectSharedMemory(b3PhysicsClientHandle physClient); ///There can only be 1 outstanding command. Check if a command can be send. -int b3CanSubmitCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3CanSubmitCommand(b3PhysicsClientHandle physClient); ///blocking submit command and wait for status B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle); @@ -52,19 +52,19 @@ B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3Ph ///In general it is better to use b3SubmitClientCommandAndWaitStatus. b3SubmitClientCommand is a non-blocking submit ///command, which requires checking for the status manually, using b3ProcessServerStatus. Also, before sending the ///next command, make sure to check if you can send a command using 'b3CanSubmitCommand'. -int b3SubmitClientCommand(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle); +B3_SHARED_API int b3SubmitClientCommand(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle); ///non-blocking check status -b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHandle physClient); +B3_SHARED_API b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHandle physClient); /// Get the physics server return status type. See EnumSharedMemoryServerStatus in SharedMemoryPublic.h for error codes. -int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle); -int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity); +B3_SHARED_API int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity); -int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle); -int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, +B3_SHARED_API int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, int* numDegreeOfFreedomQ, int* numDegreeOfFreedomU, @@ -74,200 +74,200 @@ int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle, const double* jointReactionForces[]); -b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId); -int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[/*3*/], double aabbMax[/*3*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId); +B3_SHARED_API int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[/*3*/], double aabbMax[/*3*/]); ///If you re-connected to an existing server, or server changed otherwise, sync the body info and user constraints etc. -b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient); -b3SharedMemoryCommandHandle b3InitRemoveBodyCommand(b3PhysicsClientHandle physClient, int bodyUniqueId); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveBodyCommand(b3PhysicsClientHandle physClient, int bodyUniqueId); ///return the total number of bodies in the simulation -int b3GetNumBodies(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3GetNumBodies(b3PhysicsClientHandle physClient); /// return the body unique id, given the index in range [0 , b3GetNumBodies() ) -int b3GetBodyUniqueId(b3PhysicsClientHandle physClient, int serialIndex); +B3_SHARED_API int b3GetBodyUniqueId(b3PhysicsClientHandle physClient, int serialIndex); ///given a body unique id, return the body information. See b3BodyInfo in SharedMemoryPublic.h -int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3BodyInfo* info); +B3_SHARED_API int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3BodyInfo* info); ///give a unique body index (after loading the body) return the number of joints. -int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyIndex); +B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyIndex); ///given a body and joint index, return the joint information. See b3JointInfo in SharedMemoryPublic.h -int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyIndex, int jointIndex, struct b3JointInfo* info); +B3_SHARED_API int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyIndex, int jointIndex, struct b3JointInfo* info); -b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex); +B3_SHARED_API b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex); ///given a body unique id and link index, return the dynamics information. See b3DynamicsInfo in SharedMemoryPublic.h -int b3GetDynamicsInfo(b3SharedMemoryStatusHandle statusHandle, struct b3DynamicsInfo* info); +B3_SHARED_API int b3GetDynamicsInfo(b3SharedMemoryStatusHandle statusHandle, struct b3DynamicsInfo* info); -b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo(b3PhysicsClientHandle physClient); -int b3ChangeDynamicsInfoSetMass(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double mass); -int b3ChangeDynamicsInfoSetLateralFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction); -int b3ChangeDynamicsInfoSetSpinningFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction); -int b3ChangeDynamicsInfoSetRollingFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction); -int b3ChangeDynamicsInfoSetRestitution(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double restitution); -int b3ChangeDynamicsInfoSetLinearDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double linearDamping); -int b3ChangeDynamicsInfoSetAngularDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double angularDamping); -int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex,double contactStiffness, double contactDamping); -int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex, int frictionAnchor); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3ChangeDynamicsInfoSetMass(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double mass); +B3_SHARED_API int b3ChangeDynamicsInfoSetLateralFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction); +B3_SHARED_API int b3ChangeDynamicsInfoSetSpinningFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction); +B3_SHARED_API int b3ChangeDynamicsInfoSetRollingFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction); +B3_SHARED_API int b3ChangeDynamicsInfoSetRestitution(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double restitution); +B3_SHARED_API int b3ChangeDynamicsInfoSetLinearDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double linearDamping); +B3_SHARED_API int b3ChangeDynamicsInfoSetAngularDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId,double angularDamping); +B3_SHARED_API int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex,double contactStiffness, double contactDamping); +B3_SHARED_API int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex, int frictionAnchor); -b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, struct b3JointInfo* info); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, struct b3JointInfo* info); ///return a unique id for the user constraint, after successful creation, or -1 for an invalid constraint id -int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle); ///change parameters of an existing user constraint -b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId); -int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double jointChildPivot[/*3*/]); -int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double jointChildFrameOrn[/*4*/]); -int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce); -int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio); -int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId); +B3_SHARED_API int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double jointChildPivot[/*3*/]); +B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double jointChildFrameOrn[/*4*/]); +B3_SHARED_API int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce); +B3_SHARED_API int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio); +B3_SHARED_API int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink); -b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId); -int b3GetNumUserConstraints(b3PhysicsClientHandle physClient); -int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* info); +B3_SHARED_API int b3GetNumUserConstraints(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* info); /// return the user constraint id, given the index in range [0 , b3GetNumUserConstraints() ) -int b3GetUserConstraintId(b3PhysicsClientHandle physClient, int serialIndex); +B3_SHARED_API int b3GetUserConstraintId(b3PhysicsClientHandle physClient, int serialIndex); ///Request physics debug lines for debug visualization. The flags in debugMode are the same as used in Bullet ///See btIDebugDraw::DebugDrawModes in Bullet/src/LinearMath/btIDebugDraw.h -b3SharedMemoryCommandHandle b3InitRequestDebugLinesCommand(b3PhysicsClientHandle physClient, int debugMode); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestDebugLinesCommand(b3PhysicsClientHandle physClient, int debugMode); ///Get the pointers to the physics debug line information, after b3InitRequestDebugLinesCommand returns ///status CMD_DEBUG_LINES_COMPLETED -void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* lines); +B3_SHARED_API void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* lines); ///configure the 3D OpenGL debug visualizer (enable/disable GUI widgets, shadows, position camera etc) -b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandle physClient); -void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandle commandHandle, int flag, int enabled); -void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[/*3*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandle commandHandle, int flag, int enabled); +B3_SHARED_API void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[/*3*/]); -b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3PhysicsClientHandle physClient); -int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, struct b3OpenGLVisualizerCameraInfo* camera); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, struct b3OpenGLVisualizerCameraInfo* camera); /// Add/remove user-specific debug lines and debug text messages -b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, double fromXYZ[/*3*/], double toXYZ[/*3*/], double colorRGB[/*3*/], double lineWidth, double lifeTime); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, double fromXYZ[/*3*/], double toXYZ[/*3*/], double colorRGB[/*3*/], double lineWidth, double lifeTime); -b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, double positionXYZ[/*3*/], double colorRGB[/*3*/], double textSize, double lifeTime); -void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, int optionFlags); -void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, double orientation[/*4*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, double positionXYZ[/*3*/], double colorRGB[/*3*/], double textSize, double lifeTime); +B3_SHARED_API void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, int optionFlags); +B3_SHARED_API void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, double orientation[/*4*/]); -void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex); +B3_SHARED_API void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex); -b3SharedMemoryCommandHandle b3InitUserDebugAddParameter(b3PhysicsClientHandle physClient, const char* txt, double rangeMin, double rangeMax, double startValue); -b3SharedMemoryCommandHandle b3InitUserDebugReadParameter(b3PhysicsClientHandle physClient, int debugItemUniqueId); -int b3GetStatusDebugParameterValue(b3SharedMemoryStatusHandle statusHandle, double* paramValue); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugAddParameter(b3PhysicsClientHandle physClient, const char* txt, double rangeMin, double rangeMax, double startValue); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugReadParameter(b3PhysicsClientHandle physClient, int debugItemUniqueId); +B3_SHARED_API int b3GetStatusDebugParameterValue(b3SharedMemoryStatusHandle statusHandle, double* paramValue); -b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle physClient, int debugItemUniqueId); -b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle physClient); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle physClient, int debugItemUniqueId); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle physClient); -b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle physClient); -void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, double objectColorRGB[/*3*/]); -void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, double objectColorRGB[/*3*/]); +B3_SHARED_API void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex); ///All debug items unique Ids are positive: a negative unique Id means failure. -int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle); ///request an image from a simulated camera, using a software renderer. -b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient); -void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle command, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]); -void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle command, int width, int height ); -void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[/*3*/]); -void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[/*3*/]); -void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance); -void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle commandHandle, float lightAmbientCoeff); -void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle commandHandle, float lightDiffuseCoeff); -void b3RequestCameraImageSetLightSpecularCoeff(b3SharedMemoryCommandHandle commandHandle, float lightSpecularCoeff); -void b3RequestCameraImageSetShadow(b3SharedMemoryCommandHandle commandHandle, int hasShadow); -void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandle, int renderer); -void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImageData* imageData); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle command, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]); +B3_SHARED_API void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle command, int width, int height ); +B3_SHARED_API void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[/*3*/]); +B3_SHARED_API void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[/*3*/]); +B3_SHARED_API void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance); +B3_SHARED_API void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle commandHandle, float lightAmbientCoeff); +B3_SHARED_API void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle commandHandle, float lightDiffuseCoeff); +B3_SHARED_API void b3RequestCameraImageSetLightSpecularCoeff(b3SharedMemoryCommandHandle commandHandle, float lightSpecularCoeff); +B3_SHARED_API void b3RequestCameraImageSetShadow(b3SharedMemoryCommandHandle commandHandle, int hasShadow); +B3_SHARED_API void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandle, int renderer); +B3_SHARED_API void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImageData* imageData); ///compute a view matrix, helper function for b3RequestCameraImageSetCameraMatrices -void b3ComputeViewMatrixFromPositions(const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/], float viewMatrix[/*16*/]); -void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[/*16*/]); -void b3ComputePositionFromViewMatrix(const float viewMatrix[/*16*/], float cameraPosition[/*3*/], float cameraTargetPosition[/*3*/], float cameraUp[/*3*/]); +B3_SHARED_API void b3ComputeViewMatrixFromPositions(const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/], float viewMatrix[/*16*/]); +B3_SHARED_API void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[/*16*/]); +B3_SHARED_API void b3ComputePositionFromViewMatrix(const float viewMatrix[/*16*/], float cameraPosition[/*3*/], float cameraTargetPosition[/*3*/], float cameraUp[/*3*/]); ///compute a projection matrix, helper function for b3RequestCameraImageSetCameraMatrices -void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[/*16*/]); -void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[/*16*/]); +B3_SHARED_API void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[/*16*/]); +B3_SHARED_API void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[/*16*/]); /* obsolete, please use b3ComputeViewProjectionMatrices */ -void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle command, const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/]); +B3_SHARED_API void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle command, const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/]); /* obsolete, please use b3ComputeViewProjectionMatrices */ -void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis); +B3_SHARED_API void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis); /* obsolete, please use b3ComputeViewProjectionMatrices */ -void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle command, float left, float right, float bottom, float top, float nearVal, float farVal); +B3_SHARED_API void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle command, float left, float right, float bottom, float top, float nearVal, float farVal); /* obsolete, please use b3ComputeViewProjectionMatrices */ -void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle command, float fov, float aspect, float nearVal, float farVal); +B3_SHARED_API void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle command, float fov, float aspect, float nearVal, float farVal); ///request an contact point information -b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient); -void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA); -void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB); -void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); -void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); -void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA); +B3_SHARED_API void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB); +B3_SHARED_API void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); +B3_SHARED_API void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); +B3_SHARED_API void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo); ///compute the closest points between two bodies -b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle physClient); -void b3SetClosestDistanceFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA); -void b3SetClosestDistanceFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); -void b3SetClosestDistanceFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB); -void b3SetClosestDistanceFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); -void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, double distance); -void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3SetClosestDistanceFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA); +B3_SHARED_API void b3SetClosestDistanceFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); +B3_SHARED_API void b3SetClosestDistanceFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB); +B3_SHARED_API void b3SetClosestDistanceFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); +B3_SHARED_API void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, double distance); +B3_SHARED_API void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo); ///get all the bodies that touch a given axis aligned bounding box specified in world space (min and max coordinates) -b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[/*3*/],const double aabbMax[/*3*/]); -void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOverlapData* data); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[/*3*/],const double aabbMax[/*3*/]); +B3_SHARED_API void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOverlapData* data); //request visual shape information -b3SharedMemoryCommandHandle b3InitRequestVisualShapeInformation(b3PhysicsClientHandle physClient, int bodyUniqueIdA); -void b3GetVisualShapeInformation(b3PhysicsClientHandle physClient, struct b3VisualShapeInformation* visualShapeInfo); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestVisualShapeInformation(b3PhysicsClientHandle physClient, int bodyUniqueIdA); +B3_SHARED_API void b3GetVisualShapeInformation(b3PhysicsClientHandle physClient, struct b3VisualShapeInformation* visualShapeInfo); -b3SharedMemoryCommandHandle b3InitLoadTexture(b3PhysicsClientHandle physClient, const char* filename); -int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitLoadTexture(b3PhysicsClientHandle physClient, const char* filename); +B3_SHARED_API int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle); -b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHandle physClient, int textureUniqueId, int width, int height, const char* rgbPixels); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHandle physClient, int textureUniqueId, int width, int height, const char* rgbPixels); -b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId); -void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, double rgbaColor[/*4*/]); -void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, double specularColor[/*3*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId); +B3_SHARED_API void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, double rgbaColor[/*4*/]); +B3_SHARED_API void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, double specularColor[/*3*/]); -b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle physClient); -int b3PhysicsParamSetGravity(b3SharedMemoryCommandHandle commandHandle, double gravx,double gravy, double gravz); -int b3PhysicsParamSetTimeStep(b3SharedMemoryCommandHandle commandHandle, double timeStep); -int b3PhysicsParamSetDefaultContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultContactERP); -int b3PhysicsParamSetDefaultNonContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultNonContactERP); -int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandle, double frictionERP); +B3_SHARED_API b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3PhysicsParamSetGravity(b3SharedMemoryCommandHandle commandHandle, double gravx,double gravy, double gravz); +B3_SHARED_API int b3PhysicsParamSetTimeStep(b3SharedMemoryCommandHandle commandHandle, double timeStep); +B3_SHARED_API int b3PhysicsParamSetDefaultContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultContactERP); +B3_SHARED_API int b3PhysicsParamSetDefaultNonContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultNonContactERP); +B3_SHARED_API int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandle, double frictionERP); -int b3PhysicsParamSetNumSubSteps(b3SharedMemoryCommandHandle commandHandle, int numSubSteps); -int b3PhysicsParamSetRealTimeSimulation(b3SharedMemoryCommandHandle commandHandle, int enableRealTimeSimulation); -int b3PhysicsParamSetNumSolverIterations(b3SharedMemoryCommandHandle commandHandle, int numSolverIterations); -int b3PhysicsParamSetCollisionFilterMode(b3SharedMemoryCommandHandle commandHandle, int filterMode); +B3_SHARED_API int b3PhysicsParamSetNumSubSteps(b3SharedMemoryCommandHandle commandHandle, int numSubSteps); +B3_SHARED_API int b3PhysicsParamSetRealTimeSimulation(b3SharedMemoryCommandHandle commandHandle, int enableRealTimeSimulation); +B3_SHARED_API int b3PhysicsParamSetNumSolverIterations(b3SharedMemoryCommandHandle commandHandle, int numSolverIterations); +B3_SHARED_API int b3PhysicsParamSetCollisionFilterMode(b3SharedMemoryCommandHandle commandHandle, int filterMode); -int b3PhysicsParamSetUseSplitImpulse(b3SharedMemoryCommandHandle commandHandle, int useSplitImpulse); -int b3PhysicsParamSetSplitImpulsePenetrationThreshold(b3SharedMemoryCommandHandle commandHandle, double splitImpulsePenetrationThreshold); -int b3PhysicsParamSetContactBreakingThreshold(b3SharedMemoryCommandHandle commandHandle, double contactBreakingThreshold); -int b3PhysicsParamSetMaxNumCommandsPer1ms(b3SharedMemoryCommandHandle commandHandle, int maxNumCmdPer1ms); -int b3PhysicsParamSetEnableFileCaching(b3SharedMemoryCommandHandle commandHandle, int enableFileCaching); -int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle commandHandle, double restitutionVelocityThreshold); +B3_SHARED_API int b3PhysicsParamSetUseSplitImpulse(b3SharedMemoryCommandHandle commandHandle, int useSplitImpulse); +B3_SHARED_API int b3PhysicsParamSetSplitImpulsePenetrationThreshold(b3SharedMemoryCommandHandle commandHandle, double splitImpulsePenetrationThreshold); +B3_SHARED_API int b3PhysicsParamSetContactBreakingThreshold(b3SharedMemoryCommandHandle commandHandle, double contactBreakingThreshold); +B3_SHARED_API int b3PhysicsParamSetMaxNumCommandsPer1ms(b3SharedMemoryCommandHandle commandHandle, int maxNumCmdPer1ms); +B3_SHARED_API int b3PhysicsParamSetEnableFileCaching(b3SharedMemoryCommandHandle commandHandle, int enableFileCaching); +B3_SHARED_API int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle commandHandle, double restitutionVelocityThreshold); //b3PhysicsParamSetInternalSimFlags is for internal/temporary/easter-egg/experimental demo purposes //Use at own risk: magic things may or my not happen when calling this API -int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHandle, int flags); +B3_SHARED_API int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHandle, int flags); B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient); @@ -287,90 +287,90 @@ B3_SHARED_API int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle -b3SharedMemoryCommandHandle b3LoadBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName); -b3SharedMemoryCommandHandle b3SaveBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName); -b3SharedMemoryCommandHandle b3LoadMJCFCommandInit(b3PhysicsClientHandle physClient, const char* fileName); -void b3LoadMJCFCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags); +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName); +B3_SHARED_API b3SharedMemoryCommandHandle b3SaveBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName); +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadMJCFCommandInit(b3PhysicsClientHandle physClient, const char* fileName); +B3_SHARED_API void b3LoadMJCFCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags); ///compute the forces to achieve an acceleration, given a state q and qdot using inverse dynamics -b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, +B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations); -int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHandle statusHandle, +B3_SHARED_API int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, int* dofCount, double* jointForces); -b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, int linkIndex, const double* localPosition, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations); +B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, int linkIndex, const double* localPosition, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations); -int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian); +B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian); ///compute the joint positions to move the end effector to a desired target using inverse kinematics -b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); -void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/]); -void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/]); -void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); -void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); -void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* jointDampingCoeff); -int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle statusHandle, +B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); +B3_SHARED_API void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/]); +B3_SHARED_API void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/]); +B3_SHARED_API void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); +B3_SHARED_API void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose); +B3_SHARED_API void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* jointDampingCoeff); +B3_SHARED_API int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle statusHandle, int* bodyUniqueId, int* dofCount, double* jointPositions); -b3SharedMemoryCommandHandle b3LoadSdfCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName); -int b3LoadSdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody); -int b3LoadSdfCommandSetUseGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling); +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadSdfCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName); +B3_SHARED_API int b3LoadSdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody); +B3_SHARED_API int b3LoadSdfCommandSetUseGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling); -b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName); +B3_SHARED_API b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName); ///The b3JointControlCommandInit method is obsolete, use b3JointControlCommandInit2 instead -b3SharedMemoryCommandHandle b3JointControlCommandInit(b3PhysicsClientHandle physClient, int controlMode); +B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit(b3PhysicsClientHandle physClient, int controlMode); ///Set joint motor control variables such as desired position/angle, desired velocity, ///applied joint forces, dependent on the control mode (CONTROL_MODE_VELOCITY or CONTROL_MODE_TORQUE) -b3SharedMemoryCommandHandle b3JointControlCommandInit2(b3PhysicsClientHandle physClient, int bodyUniqueId, int controlMode); +B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit2(b3PhysicsClientHandle physClient, int bodyUniqueId, int controlMode); ///Only use when controlMode is CONTROL_MODE_POSITION_VELOCITY_PD -int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, int qIndex, double value); -int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); -int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); +B3_SHARED_API int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, int qIndex, double value); +B3_SHARED_API int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); +B3_SHARED_API int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); ///Only use when controlMode is CONTROL_MODE_VELOCITY -int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); /* find a better name for dof/q/u indices, point to b3JointInfo */ -int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); +B3_SHARED_API int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); /* find a better name for dof/q/u indices, point to b3JointInfo */ +B3_SHARED_API int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); ///Only use if when controlMode is CONTROL_MODE_TORQUE, -int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); +B3_SHARED_API int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); ///the creation of collision shapes and rigid bodies etc is likely going to change, ///but good to have a b3CreateBoxShapeCommandInit for now -b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHandle physClient); -int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle,double radius); -int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,double halfExtents[/*3*/]); -int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle,double radius, double height); -int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle,double radius, double height); -int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, double planeNormal[/*3*/], double planeConstant); -int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,const char* fileName, double meshScale[/*3*/]); -void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, int flags); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle,double radius); +B3_SHARED_API int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle,double halfExtents[/*3*/]); +B3_SHARED_API int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle,double radius, double height); +B3_SHARED_API int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle,double radius, double height); +B3_SHARED_API int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, double planeNormal[/*3*/], double planeConstant); +B3_SHARED_API int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle,const char* fileName, double meshScale[/*3*/]); +B3_SHARED_API void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, int flags); -void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, double childPosition[/*3*/], double childOrientation[/*4*/]); +B3_SHARED_API void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle,int shapeIndex, double childPosition[/*3*/], double childOrientation[/*4*/]); -int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle); -b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle physClient); -int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle); -b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle physClient); -int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, double basePosition[/*3*/], double baseOrientation[/*4*/] , double baseInertialFramePosition[/*3*/], double baseInertialFrameOrientation[/*4*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, double basePosition[/*3*/], double baseOrientation[/*4*/] , double baseInertialFramePosition[/*3*/], double baseInertialFrameOrientation[/*4*/]); -int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double linkMass, double linkCollisionShapeIndex, +B3_SHARED_API int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double linkMass, double linkCollisionShapeIndex, double linkVisualShapeIndex, double linkPosition[/*3*/], double linkOrientation[/*4*/], @@ -382,7 +382,7 @@ int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double link //useMaximalCoordinates are disabled by default, enabling them is experimental and not fully supported yet -void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandHandle); +B3_SHARED_API void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandHandle); //int b3CreateMultiBodyAddLink(b3SharedMemoryCommandHandle commandHandle, int jointType, int parentLinkIndex, double linkMass, int linkCollisionShapeUnique, int linkVisualShapeUniqueId); @@ -390,119 +390,119 @@ void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandH ///create a box of size (1,1,1) at world origin (0,0,0) at orientation quat (0,0,0,1) ///after that, you can optionally adjust the initial position, orientation and size -b3SharedMemoryCommandHandle b3CreateBoxShapeCommandInit(b3PhysicsClientHandle physClient); -int b3CreateBoxCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); -int b3CreateBoxCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); -int b3CreateBoxCommandSetHalfExtents(b3SharedMemoryCommandHandle commandHandle, double halfExtentsX,double halfExtentsY,double halfExtentsZ); -int b3CreateBoxCommandSetMass(b3SharedMemoryCommandHandle commandHandle, double mass); -int b3CreateBoxCommandSetCollisionShapeType(b3SharedMemoryCommandHandle commandHandle, int collisionShapeType); -int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, double red,double green,double blue, double alpha); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateBoxShapeCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3CreateBoxCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); +B3_SHARED_API int b3CreateBoxCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); +B3_SHARED_API int b3CreateBoxCommandSetHalfExtents(b3SharedMemoryCommandHandle commandHandle, double halfExtentsX,double halfExtentsY,double halfExtentsZ); +B3_SHARED_API int b3CreateBoxCommandSetMass(b3SharedMemoryCommandHandle commandHandle, double mass); +B3_SHARED_API int b3CreateBoxCommandSetCollisionShapeType(b3SharedMemoryCommandHandle commandHandle, int collisionShapeType); +B3_SHARED_API int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, double red,double green,double blue, double alpha); ///b3CreatePoseCommandInit will initialize (teleport) the pose of a body/robot. You can individually set the base position, ///base orientation and joint angles. This will set all velocities of base and joints to zero. ///This is not a robot control command using actuators/joint motors, but manual repositioning the robot. -b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); -int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); -int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); -int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, double linVel[/*3*/]); -int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, double angVel[/*3*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); +B3_SHARED_API int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ); +B3_SHARED_API int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX,double startOrnY,double startOrnZ, double startOrnW); +B3_SHARED_API int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, double linVel[/*3*/]); +B3_SHARED_API int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, double angVel[/*3*/]); -int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* jointPositions); -int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointPosition); +B3_SHARED_API int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* jointPositions); +B3_SHARED_API int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointPosition); -int b3CreatePoseCommandSetJointVelocities(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int numJointVelocities, const double* jointVelocities); -int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointVelocity); +B3_SHARED_API int b3CreatePoseCommandSetJointVelocities(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int numJointVelocities, const double* jointVelocities); +B3_SHARED_API int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointVelocity); ///We are currently not reading the sensor information from the URDF file, and programmatically assign sensors. ///This is rather inconsistent, to mix programmatical creation with loading from file. -b3SharedMemoryCommandHandle b3CreateSensorCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId); -int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle commandHandle, int jointIndex, int enable); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateSensorCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId); +B3_SHARED_API int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle commandHandle, int jointIndex, int enable); ///b3CreateSensorEnableIMUForLink is not implemented yet. ///For now, if the IMU is located in the root link, use the root world transform to mimic an IMU. -int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, int linkIndex, int enable); +B3_SHARED_API int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, int linkIndex, int enable); -b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient,int bodyUniqueId); -int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle commandHandle, int computeLinkVelocity); +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient,int bodyUniqueId); +B3_SHARED_API int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle commandHandle, int computeLinkVelocity); -int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, struct b3JointSensorState *state); -int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int linkIndex, struct b3LinkState *state); +B3_SHARED_API int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, struct b3JointSensorState *state); +B3_SHARED_API int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int linkIndex, struct b3LinkState *state); -b3SharedMemoryCommandHandle b3PickBody(b3PhysicsClientHandle physClient, double rayFromWorldX, +B3_SHARED_API b3SharedMemoryCommandHandle b3PickBody(b3PhysicsClientHandle physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ); -b3SharedMemoryCommandHandle b3MovePickedBody(b3PhysicsClientHandle physClient, double rayFromWorldX, +B3_SHARED_API b3SharedMemoryCommandHandle b3MovePickedBody(b3PhysicsClientHandle physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ); -b3SharedMemoryCommandHandle b3RemovePickingConstraint(b3PhysicsClientHandle physClient); +B3_SHARED_API b3SharedMemoryCommandHandle b3RemovePickingConstraint(b3PhysicsClientHandle physClient); -b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle physClient, double rayFromWorldX, +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ); -b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient); -void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[/*3*/], const double rayToWorld[/*3*/]); +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[/*3*/], const double rayToWorld[/*3*/]); -void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo); +B3_SHARED_API void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo); /// Apply external force at the body (or link) center of mass, in world space/Cartesian coordinates. -b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient); -void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[/*3*/], const double position[/*3*/], int flags); -void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[/*3*/], int flags); +B3_SHARED_API b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[/*3*/], const double position[/*3*/], int flags); +B3_SHARED_API void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[/*3*/], int flags); ///experiments of robots interacting with non-rigid objects (such as btSoftBody) -b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physClient); -int b3LoadBunnySetScale(b3SharedMemoryCommandHandle commandHandle, double scale); -int b3LoadBunnySetMass(b3SharedMemoryCommandHandle commandHandle, double mass); -int b3LoadBunnySetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, double collisionMargin); +B3_SHARED_API b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3LoadBunnySetScale(b3SharedMemoryCommandHandle commandHandle, double scale); +B3_SHARED_API int b3LoadBunnySetMass(b3SharedMemoryCommandHandle commandHandle, double mass); +B3_SHARED_API int b3LoadBunnySetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, double collisionMargin); -b3SharedMemoryCommandHandle b3RequestVREventsCommandInit(b3PhysicsClientHandle physClient); -void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter); +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestVREventsCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter); -void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* vrEventsData); +B3_SHARED_API void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* vrEventsData); -b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle physClient); -int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double rootPos[/*3*/]); -int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, double rootOrn[/*4*/]); -int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId); -int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, int flag); +B3_SHARED_API b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, double rootPos[/*3*/]); +B3_SHARED_API int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, double rootOrn[/*4*/]); +B3_SHARED_API int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId); +B3_SHARED_API int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, int flag); -b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit(b3PhysicsClientHandle physClient); -void b3GetKeyboardEventsData(b3PhysicsClientHandle physClient, struct b3KeyboardEventsData* keyboardEventsData); +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3GetKeyboardEventsData(b3PhysicsClientHandle physClient, struct b3KeyboardEventsData* keyboardEventsData); -b3SharedMemoryCommandHandle b3RequestMouseEventsCommandInit(b3PhysicsClientHandle physClient); -void b3GetMouseEventsData(b3PhysicsClientHandle physClient, struct b3MouseEventsData* mouseEventsData); +B3_SHARED_API b3SharedMemoryCommandHandle b3RequestMouseEventsCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3GetMouseEventsData(b3PhysicsClientHandle physClient, struct b3MouseEventsData* mouseEventsData); -b3SharedMemoryCommandHandle b3StateLoggingCommandInit(b3PhysicsClientHandle physClient); -int b3StateLoggingStart(b3SharedMemoryCommandHandle commandHandle, int loggingType, const char* fileName); -int b3StateLoggingAddLoggingObjectUniqueId(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId); -int b3StateLoggingSetMaxLogDof(b3SharedMemoryCommandHandle commandHandle, int maxLogDof); -int b3StateLoggingSetLinkIndexA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); -int b3StateLoggingSetLinkIndexB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); -int b3StateLoggingSetBodyAUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyAUniqueId); -int b3StateLoggingSetBodyBUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyBUniqueId); -int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter); -int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int logFlags); +B3_SHARED_API b3SharedMemoryCommandHandle b3StateLoggingCommandInit(b3PhysicsClientHandle physClient); +B3_SHARED_API int b3StateLoggingStart(b3SharedMemoryCommandHandle commandHandle, int loggingType, const char* fileName); +B3_SHARED_API int b3StateLoggingAddLoggingObjectUniqueId(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId); +B3_SHARED_API int b3StateLoggingSetMaxLogDof(b3SharedMemoryCommandHandle commandHandle, int maxLogDof); +B3_SHARED_API int b3StateLoggingSetLinkIndexA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); +B3_SHARED_API int b3StateLoggingSetLinkIndexB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); +B3_SHARED_API int b3StateLoggingSetBodyAUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyAUniqueId); +B3_SHARED_API int b3StateLoggingSetBodyBUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyBUniqueId); +B3_SHARED_API int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter); +B3_SHARED_API int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int logFlags); -int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle); -int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUniqueId); +B3_SHARED_API int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUniqueId); -b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name); -void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration); +B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name); +B3_SHARED_API void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration); -void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds); -double b3GetTimeOut(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds); +B3_SHARED_API double b3GetTimeOut(b3PhysicsClientHandle physClient); -b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle physClient, char* path); +B3_SHARED_API b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle physClient, char* path); -void b3MultiplyTransforms(const double posA[/*3*/], const double ornA[/*4*/], const double posB[/*3*/], const double ornB[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]); -void b3InvertTransform(const double pos[/*3*/], const double orn[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]); +B3_SHARED_API void b3MultiplyTransforms(const double posA[/*3*/], const double ornA[/*4*/], const double posB[/*3*/], const double ornB[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]); +B3_SHARED_API void b3InvertTransform(const double pos[/*3*/], const double orn[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]); #ifdef __cplusplus } diff --git a/examples/SharedMemory/PhysicsClientTCP_C_API.cpp b/examples/SharedMemory/PhysicsClientTCP_C_API.cpp index e333b967a..6efd39f1e 100644 --- a/examples/SharedMemory/PhysicsClientTCP_C_API.cpp +++ b/examples/SharedMemory/PhysicsClientTCP_C_API.cpp @@ -4,7 +4,7 @@ #include "PhysicsDirect.h" #include -b3PhysicsClientHandle b3ConnectPhysicsTCP(const char* hostName, int port) +B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsTCP(const char* hostName, int port) { TcpNetworkedPhysicsProcessor* tcp = new TcpNetworkedPhysicsProcessor(hostName, port); diff --git a/examples/SharedMemory/PhysicsClientTCP_C_API.h b/examples/SharedMemory/PhysicsClientTCP_C_API.h index dee180377..53216eeec 100644 --- a/examples/SharedMemory/PhysicsClientTCP_C_API.h +++ b/examples/SharedMemory/PhysicsClientTCP_C_API.h @@ -9,7 +9,7 @@ extern "C" { ///send physics commands using TCP networking - b3PhysicsClientHandle b3ConnectPhysicsTCP(const char* hostName, int port); +B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsTCP(const char* hostName, int port); #ifdef __cplusplus diff --git a/examples/SharedMemory/PhysicsClientUDP_C_API.cpp b/examples/SharedMemory/PhysicsClientUDP_C_API.cpp index c3b024c43..50b8b39eb 100644 --- a/examples/SharedMemory/PhysicsClientUDP_C_API.cpp +++ b/examples/SharedMemory/PhysicsClientUDP_C_API.cpp @@ -5,7 +5,7 @@ #include //think more about naming. The b3ConnectPhysicsLoopback -b3PhysicsClientHandle b3ConnectPhysicsUDP(const char* hostName, int port) +B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsUDP(const char* hostName, int port) { UdpNetworkedPhysicsProcessor* udp = new UdpNetworkedPhysicsProcessor(hostName, port); diff --git a/examples/SharedMemory/PhysicsClientUDP_C_API.h b/examples/SharedMemory/PhysicsClientUDP_C_API.h index fdb97bcab..8ea5ef027 100644 --- a/examples/SharedMemory/PhysicsClientUDP_C_API.h +++ b/examples/SharedMemory/PhysicsClientUDP_C_API.h @@ -9,7 +9,7 @@ extern "C" { ///send physics commands using UDP networking - b3PhysicsClientHandle b3ConnectPhysicsUDP(const char* hostName, int port); +B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsUDP(const char* hostName, int port); #ifdef __cplusplus diff --git a/examples/SharedMemory/PhysicsDirectC_API.cpp b/examples/SharedMemory/PhysicsDirectC_API.cpp index 50a89b34f..803d36728 100644 --- a/examples/SharedMemory/PhysicsDirectC_API.cpp +++ b/examples/SharedMemory/PhysicsDirectC_API.cpp @@ -7,7 +7,7 @@ //think more about naming. The b3ConnectPhysicsLoopback -b3PhysicsClientHandle b3ConnectPhysicsDirect() +B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsDirect() { PhysicsServerCommandProcessor* sdk = new PhysicsServerCommandProcessor; diff --git a/examples/SharedMemory/PhysicsDirectC_API.h b/examples/SharedMemory/PhysicsDirectC_API.h index 17681af61..7060bb832 100644 --- a/examples/SharedMemory/PhysicsDirectC_API.h +++ b/examples/SharedMemory/PhysicsDirectC_API.h @@ -9,7 +9,7 @@ extern "C" { ///think more about naming. Directly execute commands without transport (no shared memory, UDP, socket, grpc etc) -b3PhysicsClientHandle b3ConnectPhysicsDirect(); +B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsDirect(); #ifdef __cplusplus From ff15f2e702ee1cc958bbabbda671b20d16ff91cc Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Thu, 21 Sep 2017 23:42:52 -0400 Subject: [PATCH 06/38] cmake python fix for linux #1322 Search did not cover inconsistent lib location defined within python under linux versions https://stackoverflow.com/questions/20582270/distribution-independent-libpython-path --- CMakeLists.txt | 23 ++++++++++++++++++++--- build3/cmake/FindPythonLibs.cmake | 17 +++++++++++------ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e5f009df..8d692e89b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,8 +301,25 @@ IF (APPLE) ENDIF() OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON) - -OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" OFF) +# Optional Python configuration +# builds pybullet automatically if all the requirements are met +SET(PYTHON_VERSION_PYBULLET "2.7" CACHE STRING "Python version pybullet will use.") +SET(Python_ADDITIONAL_VERSIONS 2.7 2.7.3 2.7.12 3 3.0 3.1 3.2 3.3 3.4 3.5 3.6) +SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS}) +SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH}) +OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF) +IF(EXACT_PYTHON_VERSION) + set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED) +ENDIF(EXACT_PYTHON_VERSION) +# first find the python interpreter +FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG}) +# python library should exactly match that of the interpreter +FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT) +SET(DEFAULT_BUILD_PYBULLET OFF) +IF(PYTHONLIBS_FOUND) + SET(DEFAULT_BUILD_PYBULLET ON) +ENDIF(PYTHONLIBS_FOUND) +OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" ${DEFAULT_BUILD_PYBULLET}) OPTION(BUILD_ENET "Set when you want to build apps with enet UDP networking support" ON) OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking support" ON) @@ -310,7 +327,7 @@ OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking IF(BUILD_PYBULLET) FIND_PACKAGE(PythonLibs) - + OPTION(BUILD_PYBULLET_NUMPY "Set when you want to build pybullet with NumPy support" OFF) OPTION(BUILD_PYBULLET_ENET "Set when you want to build pybullet with enet UDP networking support" ON) OPTION(BUILD_PYBULLET_CLSOCKET "Set when you want to build pybullet with enet TCP networking support" ON) diff --git a/build3/cmake/FindPythonLibs.cmake b/build3/cmake/FindPythonLibs.cmake index a0e9bffbe..4f6b878f4 100644 --- a/build3/cmake/FindPythonLibs.cmake +++ b/build3/cmake/FindPythonLibs.cmake @@ -64,7 +64,7 @@ if(EXISTS "${PYTHON_INCLUDE_DIR}" AND EXISTS "${PYTHON_LIBRARY}") else() set(_PYTHON1_VERSIONS 1.6 1.5) set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) - set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0) + set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0) unset(_PYTHON_FIND_OTHER_VERSIONS) if(PythonLibs_FIND_VERSION) @@ -176,14 +176,15 @@ else() FIND_LIBRARY(PYTHON_LIBRARY NAMES ${_PYTHON_LIBRARY_NAMES} PATH_SUFFIXES - python${_PYTHON_SHORT_VERSION}/config - python${_PYTHON_SHORT_VERSION_NO_DOT}/config + "python${_PYTHON_SHORT_VERSION}/config" + "python${_PYTHON_SHORT_VERSION_NO_DOT}/config" PATHS ${_PYTHON_LIBRARY_DIR} - ${_PYTHON_PREFIX}/lib $ - {_PYTHON_PREFIX}/libs + ${_PYTHON_PREFIX}/lib + ${_PYTHON_PREFIX}/libs + ${_PYTHON_LIBRARY_DIR}/x86_64-linux-gnu/ NO_DEFAULT_PATH) - + message(STATUS "PYTHON_LIBRARY:${PYTHON_LIBRARY}") if(WIN32) find_library(PYTHON_DEBUG_LIBRARY NAMES python${_PYTHON_SHORT_VERSION_NO_DOT}_d python @@ -254,6 +255,10 @@ set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}") set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}") include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(PYTHON) +message(STATUS "${PYTHON_LIBRARY}") +if(PYTHON_LIBRARY) + set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") +endif() # SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library. # Unset this, this prefix doesn't match the module prefix, they are different # for historical reasons. From b720bd62905f1ba68947e2caad34e898b1b0bc95 Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Thu, 21 Sep 2017 23:47:31 -0400 Subject: [PATCH 07/38] cmake python fix typos for linux #1322 --- build3/cmake/FindPythonLibs.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build3/cmake/FindPythonLibs.cmake b/build3/cmake/FindPythonLibs.cmake index 4f6b878f4..b0bcd839c 100644 --- a/build3/cmake/FindPythonLibs.cmake +++ b/build3/cmake/FindPythonLibs.cmake @@ -184,7 +184,7 @@ else() ${_PYTHON_PREFIX}/libs ${_PYTHON_LIBRARY_DIR}/x86_64-linux-gnu/ NO_DEFAULT_PATH) - message(STATUS "PYTHON_LIBRARY:${PYTHON_LIBRARY}") + if(WIN32) find_library(PYTHON_DEBUG_LIBRARY NAMES python${_PYTHON_SHORT_VERSION_NO_DOT}_d python @@ -255,8 +255,8 @@ set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}") set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}") include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(PYTHON) -message(STATUS "${PYTHON_LIBRARY}") -if(PYTHON_LIBRARY) + +if(PYTHON_LIBRARY AND NOT PYTHON_LIBRARIES) set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") endif() # SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library. From 312e35964fcc8ab2e6c83119dc83a4fd091294d5 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Fri, 22 Sep 2017 07:53:21 -0700 Subject: [PATCH 08/38] make some code const correct. --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 6 +++--- src/BulletDynamics/Dynamics/btDynamicsWorld.h | 5 +++++ src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 1a1b13275..2469a09e9 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -1053,13 +1053,13 @@ struct GenericRobotStateLogger : public InternalStateLogger std::string m_fileName; FILE* m_logFileHandle; std::string m_structTypes; - btMultiBodyDynamicsWorld* m_dynamicsWorld; + const btMultiBodyDynamicsWorld* m_dynamicsWorld; btAlignedObjectArray m_bodyIdList; bool m_filterObjectUniqueId; int m_maxLogDof; int m_logFlags; - GenericRobotStateLogger(int loggingUniqueId, const std::string& fileName, btMultiBodyDynamicsWorld* dynamicsWorld, int maxLogDof, int logFlags) + GenericRobotStateLogger(int loggingUniqueId, const std::string& fileName, const btMultiBodyDynamicsWorld* dynamicsWorld, int maxLogDof, int logFlags) :m_loggingTimeStamp(0), m_logFileHandle(0), m_dynamicsWorld(dynamicsWorld), @@ -1137,7 +1137,7 @@ struct GenericRobotStateLogger : public InternalStateLogger { for (int i=0;igetNumMultibodies();i++) { - btMultiBody* mb = m_dynamicsWorld->getMultiBody(i); + const btMultiBody* mb = m_dynamicsWorld->getMultiBody(i); int objectUniqueId = mb->getUserIndex2(); if (m_filterObjectUniqueId && m_bodyIdList.findLinearSearch2(objectUniqueId) < 0) { diff --git a/src/BulletDynamics/Dynamics/btDynamicsWorld.h b/src/BulletDynamics/Dynamics/btDynamicsWorld.h index a9ed1978f..42d8fc0de 100644 --- a/src/BulletDynamics/Dynamics/btDynamicsWorld.h +++ b/src/BulletDynamics/Dynamics/btDynamicsWorld.h @@ -135,6 +135,11 @@ public: return m_solverInfo; } + const btContactSolverInfo& getSolverInfo() const + { + return m_solverInfo; + } + ///obsolete, use addAction instead. virtual void addVehicle(btActionInterface* vehicle) {(void)vehicle;} diff --git a/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h b/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h index e5113ae6c..c0c132bbb 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h +++ b/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h @@ -72,6 +72,11 @@ public: return m_multiBodies[mbIndex]; } + const btMultiBody* getMultiBody(int mbIndex) const + { + return m_multiBodies[mbIndex]; + } + virtual void addMultiBodyConstraint( btMultiBodyConstraint* constraint); virtual int getNumMultiBodyConstraints() const From 3783dccaa368529464ee71c3a773b8cb63a80796 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 22 Sep 2017 19:17:57 -0700 Subject: [PATCH 09/38] create a C/C++ plugin system for pybullet / C-API. --- examples/ExampleBrowser/CMakeLists.txt | 1 + examples/ExampleBrowser/premake4.lua | 1 + examples/RobotSimulator/CMakeLists.txt | 2 + examples/RobotSimulator/premake4.lua | 2 + examples/SharedMemory/CMakeLists.txt | 1 + examples/SharedMemory/PhysicsClientC_API.cpp | 95 ++ examples/SharedMemory/PhysicsClientC_API.h | 9 + .../PhysicsClientSharedMemory.cpp | 9 + examples/SharedMemory/PhysicsDirect.cpp | 10 + .../PhysicsServerCommandProcessor.cpp | 42 +- examples/SharedMemory/SharedMemoryCommands.h | 24 + examples/SharedMemory/SharedMemoryPublic.h | 4 + examples/SharedMemory/b3PluginManager.cpp | 151 +++ examples/SharedMemory/b3PluginManager.h | 19 + examples/SharedMemory/plugins/b3PluginAPI.h | 37 + .../plugins/testPlugin/premake4.lua | 42 + .../plugins/testPlugin/testplugin.cpp | 22 + .../plugins/testPlugin/testplugin.h | 19 + examples/SharedMemory/premake4.lua | 7 +- examples/SharedMemory/tcp/premake4.lua | 1 + examples/SharedMemory/udp/premake4.lua | 1 + examples/pybullet/CMakeLists.txt | 3 + examples/pybullet/premake4.lua | 2 + examples/pybullet/pybullet.c | 113 ++ .../pybullet/unity3d/autogen/NativeMethods.cs | 1013 ++++++++--------- setup.py | 1 + test/SharedMemory/CMakeLists.txt | 1 + test/SharedMemory/premake4.lua | 3 + 28 files changed, 1111 insertions(+), 524 deletions(-) create mode 100644 examples/SharedMemory/b3PluginManager.cpp create mode 100644 examples/SharedMemory/b3PluginManager.h create mode 100644 examples/SharedMemory/plugins/b3PluginAPI.h create mode 100644 examples/SharedMemory/plugins/testPlugin/premake4.lua create mode 100644 examples/SharedMemory/plugins/testPlugin/testplugin.cpp create mode 100644 examples/SharedMemory/plugins/testPlugin/testplugin.h diff --git a/examples/ExampleBrowser/CMakeLists.txt b/examples/ExampleBrowser/CMakeLists.txt index e21d33d40..01d0b5c18 100644 --- a/examples/ExampleBrowser/CMakeLists.txt +++ b/examples/ExampleBrowser/CMakeLists.txt @@ -171,6 +171,7 @@ SET(BulletExampleBrowser_SRCS ../SharedMemory/PhysicsServerCommandProcessor.h ../SharedMemory/SharedMemoryCommands.h ../SharedMemory/SharedMemoryPublic.h + ../SharedMemory/b3PluginManager.cpp ../RobotSimulator/b3RobotSimulatorClientAPI.cpp ../RobotSimulator/b3RobotSimulatorClientAPI.h ../BasicDemo/BasicExample.cpp diff --git a/examples/ExampleBrowser/premake4.lua b/examples/ExampleBrowser/premake4.lua index 0ae38bc0f..5aa3b15b5 100644 --- a/examples/ExampleBrowser/premake4.lua +++ b/examples/ExampleBrowser/premake4.lua @@ -109,6 +109,7 @@ project "App_BulletExampleBrowser" "../SharedMemory/PhysicsLoopBackC_API.h", "../SharedMemory/PhysicsServerCommandProcessor.cpp", "../SharedMemory/PhysicsServerCommandProcessor.h", + "../SharedMemory/b3PluginManager.cpp", "../SharedMemory/TinyRendererVisualShapeConverter.cpp", "../SharedMemory/TinyRendererVisualShapeConverter.h", "../SharedMemory/SharedMemoryCommands.h", diff --git a/examples/RobotSimulator/CMakeLists.txt b/examples/RobotSimulator/CMakeLists.txt index 7d35a445e..9549709b0 100644 --- a/examples/RobotSimulator/CMakeLists.txt +++ b/examples/RobotSimulator/CMakeLists.txt @@ -42,6 +42,8 @@ SET(RobotSimulator_SRCS ../../examples/SharedMemory/PhysicsDirectC_API.h ../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp ../../examples/SharedMemory/PhysicsServerCommandProcessor.h + ../../examples/SharedMemory/b3PluginManager.cpp + ../../examples/SharedMemory/PhysicsClientSharedMemory.cpp ../../examples/SharedMemory/PhysicsClientSharedMemory.h ../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp diff --git a/examples/RobotSimulator/premake4.lua b/examples/RobotSimulator/premake4.lua index faa6fb281..368fefd1f 100644 --- a/examples/RobotSimulator/premake4.lua +++ b/examples/RobotSimulator/premake4.lua @@ -20,6 +20,8 @@ myfiles = "../../examples/SharedMemory/PhysicsDirectC_API.h", "../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp", "../../examples/SharedMemory/PhysicsServerCommandProcessor.h", + "../../examples/SharedMemory/b3PluginManager.cpp", + "../../examples/SharedMemory/PhysicsClientSharedMemory.cpp", "../../examples/SharedMemory/PhysicsClientSharedMemory.h", "../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp", diff --git a/examples/SharedMemory/CMakeLists.txt b/examples/SharedMemory/CMakeLists.txt index a369eafa9..5883ce1fa 100644 --- a/examples/SharedMemory/CMakeLists.txt +++ b/examples/SharedMemory/CMakeLists.txt @@ -41,6 +41,7 @@ SET(SharedMemory_SRCS TinyRendererVisualShapeConverter.h SharedMemoryCommands.h SharedMemoryPublic.h + b3PluginManager.cpp ../TinyRenderer/geometry.cpp ../TinyRenderer/model.cpp ../TinyRenderer/tgaimage.cpp diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 9bc362373..5dfaa4e33 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -1631,6 +1631,7 @@ B3_SHARED_API int b3SubmitClientCommand(b3PhysicsClientHandle physClient, const #include "../Utils/b3Clock.h" + B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, const b3SharedMemoryCommandHandle commandHandle) { B3_PROFILE("b3SubmitClientCommandAndWaitStatus"); @@ -1733,6 +1734,100 @@ B3_SHARED_API int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyIndex return cl->getJointInfo(bodyIndex, jointIndex, *info); } + + +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCustomCommand(b3PhysicsClientHandle physClient) +{ + PhysicsClient* cl = (PhysicsClient*)physClient; + b3Assert(cl); + b3Assert(cl->canSubmitCommand()); + struct SharedMemoryCommand* command = cl->getAvailableSharedMemoryCommand(); + b3Assert(command); + command->m_type = CMD_CUSTOM_COMMAND; + command->m_updateFlags = 0; + return (b3SharedMemoryCommandHandle)command; +} + +B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath, int options) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command->m_type == CMD_CUSTOM_COMMAND); + if (command->m_type == CMD_CUSTOM_COMMAND) + { + command->m_updateFlags |= CMD_CUSTOM_COMMAND_LOAD_PLUGIN; + command->m_customCommandArgs.m_pluginPath[0] = 0; + command->m_customCommandArgs.m_options = options; + int len = strlen(pluginPath); + if (lenm_customCommandArgs.m_pluginPath, pluginPath); + } + } +} + + + +B3_SHARED_API int b3GetStatusPluginCommandResult(b3SharedMemoryStatusHandle statusHandle) +{ + int statusUniqueId = -1; + + const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; + b3Assert(status); + b3Assert(status->m_type == CMD_CUSTOM_COMMAND_COMPLETED); + if (status->m_type == CMD_CUSTOM_COMMAND_COMPLETED) + { + statusUniqueId = status->m_customCommandResultArgs.m_executeCommandResult; + } + return statusUniqueId; +} + +B3_SHARED_API int b3GetStatusPluginUniqueId(b3SharedMemoryStatusHandle statusHandle) +{ + int statusUniqueId = -1; + + const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; + b3Assert(status); + b3Assert(status->m_type == CMD_CUSTOM_COMMAND_COMPLETED); + if (status->m_type == CMD_CUSTOM_COMMAND_COMPLETED) + { + statusUniqueId = status->m_customCommandResultArgs.m_pluginUniqueId; + } + return statusUniqueId; +} + +B3_SHARED_API void b3CustomCommandUnloadPlugin(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId) +{ + + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command->m_type == CMD_CUSTOM_COMMAND); + if (command->m_type == CMD_CUSTOM_COMMAND) + { + command->m_updateFlags |= CMD_CUSTOM_COMMAND_UNLOAD_PLUGIN; + command->m_customCommandArgs.m_pluginUniqueId = pluginUniqueId; + } +} +B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, int commandUniqueId, const char* arguments) +{ + + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command->m_type == CMD_CUSTOM_COMMAND); + if (command->m_type == CMD_CUSTOM_COMMAND) + { + command->m_updateFlags |= CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND; + command->m_customCommandArgs.m_pluginUniqueId = pluginUniqueId; + command->m_customCommandArgs.m_commandUniqueId = commandUniqueId; + command->m_customCommandArgs.m_pluginArguments[0] = 0; + int len = strlen(arguments); + if (lenm_customCommandArgs.m_pluginArguments, arguments); + } + + + } +} + + B3_SHARED_API b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex) { PhysicsClient* cl = (PhysicsClient* ) physClient; diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index af297ea68..4dc6624dd 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -60,6 +60,15 @@ B3_SHARED_API b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHa /// Get the physics server return status type. See EnumSharedMemoryServerStatus in SharedMemoryPublic.h for error codes. B3_SHARED_API int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle); +///Plugin system, load and unload a plugin, execute a command +B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCustomCommand(b3PhysicsClientHandle physClient); +B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath, int options); +B3_SHARED_API int b3GetStatusPluginUniqueId(b3SharedMemoryStatusHandle statusHandle); +B3_SHARED_API int b3GetStatusPluginCommandResult(b3SharedMemoryStatusHandle statusHandle); + +B3_SHARED_API void b3CustomCommandUnloadPlugin(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId); +B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, int commandUniqueId, const char* arguments); + B3_SHARED_API int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity); B3_SHARED_API int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle); diff --git a/examples/SharedMemory/PhysicsClientSharedMemory.cpp b/examples/SharedMemory/PhysicsClientSharedMemory.cpp index e5cf7b58d..13b75eb8b 100644 --- a/examples/SharedMemory/PhysicsClientSharedMemory.cpp +++ b/examples/SharedMemory/PhysicsClientSharedMemory.cpp @@ -1200,6 +1200,15 @@ const SharedMemoryStatus* PhysicsClientSharedMemory::processServerStatus() { b3Warning("Request getCollisionInfo failed"); break; } + case CMD_CUSTOM_COMMAND_COMPLETED: + { + break; + } + case CMD_CUSTOM_COMMAND_FAILED: + { + b3Warning("custom plugin command failed"); + break; + } default: { b3Error("Unknown server status %d\n", serverCmd.m_type); diff --git a/examples/SharedMemory/PhysicsDirect.cpp b/examples/SharedMemory/PhysicsDirect.cpp index d26ff70da..2de1acabd 100644 --- a/examples/SharedMemory/PhysicsDirect.cpp +++ b/examples/SharedMemory/PhysicsDirect.cpp @@ -940,6 +940,16 @@ void PhysicsDirect::postProcessStatus(const struct SharedMemoryStatus& serverCmd break; } + case CMD_CUSTOM_COMMAND_COMPLETED: + { + break; + } + case CMD_CUSTOM_COMMAND_FAILED: + { + b3Warning("custom plugin command failed"); + break; + } + default: { //b3Warning("Unknown server status type"); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 1a1b13275..4908c459c 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -37,6 +37,8 @@ #include "LinearMath/btRandom.h" #include "Bullet3Common/b3ResizablePool.h" #include "../Utils/b3Clock.h" +#include "b3PluginManager.h" + #ifdef B3_ENABLE_TINY_AUDIO #include "../TinyAudio/b3SoundEngine.h" #endif @@ -1430,6 +1432,8 @@ struct PhysicsServerCommandProcessorInternalData b3ResizablePool< InternalBodyHandle > m_bodyHandles; b3ResizablePool m_userCollisionShapeHandles; + b3PluginManager m_pluginManager; + bool m_allowRealTimeSimulation; @@ -7968,6 +7972,38 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm break; } + case CMD_CUSTOM_COMMAND: + { + SharedMemoryStatus& serverCmd = serverStatusOut; + serverCmd.m_type = CMD_CUSTOM_COMMAND_FAILED; + serverCmd.m_customCommandResultArgs.m_pluginUniqueId = -1; + + if (clientCmd.m_updateFlags & CMD_CUSTOM_COMMAND_LOAD_PLUGIN) + { + //pluginPath could be registered or load from disk + int pluginUniqueId = m_data->m_pluginManager.loadPlugin(clientCmd.m_customCommandArgs.m_pluginPath); + if (pluginUniqueId>=0) + { + serverCmd.m_customCommandResultArgs.m_pluginUniqueId = pluginUniqueId; + serverCmd.m_type = CMD_CUSTOM_COMMAND_COMPLETED; + } + } + if (clientCmd.m_updateFlags & CMD_CUSTOM_COMMAND_UNLOAD_PLUGIN) + { + m_data->m_pluginManager.unloadPlugin(clientCmd.m_customCommandArgs.m_pluginUniqueId); + serverCmd.m_type = CMD_CUSTOM_COMMAND_COMPLETED; + } + if (clientCmd.m_updateFlags & CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND) + { + int result = m_data->m_pluginManager.executePluginCommand(clientCmd.m_customCommandArgs.m_pluginUniqueId, clientCmd.m_customCommandArgs.m_pluginArguments); + serverCmd.m_customCommandResultArgs.m_executeCommandResult = result; + serverCmd.m_type = CMD_CUSTOM_COMMAND_COMPLETED; + + } + + hasStatus = true; + break; + } default: { BT_PROFILE("CMD_UNKNOWN"); @@ -8186,12 +8222,6 @@ void PhysicsServerCommandProcessor::replayFromLogFile(const char* fileName) } -btVector3 gVRGripperPos(0.7, 0.3, 0.7); -btQuaternion gVRGripperOrn(0,0,0,1); -btVector3 gVRController2Pos(0,0,0.2); -btQuaternion gVRController2Orn(0,0,0,1); -btScalar gVRGripper2Analog = 0; -btScalar gVRGripperAnalog = 0; diff --git a/examples/SharedMemory/SharedMemoryCommands.h b/examples/SharedMemory/SharedMemoryCommands.h index 357314740..cdd2f720c 100644 --- a/examples/SharedMemory/SharedMemoryCommands.h +++ b/examples/SharedMemory/SharedMemoryCommands.h @@ -109,6 +109,28 @@ struct b3SearchPathfArgs char m_path[MAX_FILENAME_LENGTH]; }; +enum CustomCommandEnum +{ + CMD_CUSTOM_COMMAND_LOAD_PLUGIN=1, + CMD_CUSTOM_COMMAND_UNLOAD_PLUGIN=2, + CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND=4, +}; + +struct b3CustomCommand +{ + int m_pluginUniqueId; + int m_commandUniqueId; + int m_options; + char m_pluginPath[MAX_FILENAME_LENGTH]; + char m_pluginArguments[MAX_FILENAME_LENGTH]; +}; + +struct b3CustomCommandResultArgs +{ + int m_pluginUniqueId; + int m_executeCommandResult; + +}; struct BulletDataStreamArgs { @@ -968,6 +990,7 @@ struct SharedMemoryCommand struct b3RequestCollisionInfoArgs m_requestCollisionInfoArgs; struct b3ChangeTextureArgs m_changeTextureArgs; struct b3SearchPathfArgs m_searchPathArgs; + struct b3CustomCommand m_customCommandArgs; }; }; @@ -1039,6 +1062,7 @@ struct SharedMemoryStatus struct b3SendCollisionInfoArgs m_sendCollisionInfoArgs; struct SendMouseEvents m_sendMouseEvents; struct b3LoadTextureResultArgs m_loadTextureResultArguments; + struct b3CustomCommandResultArgs m_customCommandResultArgs; }; }; diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index cfa605bc4..10ada7c50 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -72,6 +72,7 @@ enum EnumSharedMemoryClientCommand CMD_REQUEST_MOUSE_EVENTS_DATA, CMD_CHANGE_TEXTURE, CMD_SET_ADDITIONAL_SEARCH_PATH, + CMD_CUSTOM_COMMAND, //don't go beyond this command! CMD_MAX_CLIENT_COMMANDS, @@ -167,6 +168,9 @@ enum EnumSharedMemoryServerStatus CMD_REQUEST_COLLISION_INFO_FAILED, CMD_REQUEST_MOUSE_EVENTS_DATA_COMPLETED, CMD_CHANGE_TEXTURE_COMMAND_FAILED, + CMD_CUSTOM_COMMAND_COMPLETED, + CMD_CUSTOM_COMMAND_FAILED, + //don't go beyond 'CMD_MAX_SERVER_COMMANDS! CMD_MAX_SERVER_COMMANDS }; diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp new file mode 100644 index 000000000..328a0426c --- /dev/null +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -0,0 +1,151 @@ + +#include "b3PluginManager.h" +#include "Bullet3Common/b3HashMap.h" +#include "Bullet3Common/b3ResizablePool.h" +#include "plugins/b3PluginAPI.h" +#include "SharedMemoryPublic.h" + +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #define VC_EXTRALEAN + #include + + typedef HMODULE B3_DYNLIB_HANDLE; + + #define B3_DYNLIB_OPEN LoadLibrary + #define B3_DYNLIB_CLOSE FreeLibrary + #define B3_DYNLIB_IMPORT GetProcAddress +#else + #include + + typedef void* B3_DYNLIB_HANDLE; + + #define B3_DYNLIB_OPEN(path) dlopen(path, RTLD_NOW | RTLD_GLOBAL) + #define B3_DYNLIB_CLOSE dlclose + #define B3_DYNLIB_IMPORT dlsym +#endif + +struct b3Plugin +{ + B3_DYNLIB_HANDLE m_pluginHandle; + std::string m_pluginPath; + + PFN_INIT m_initFunc; + PFN_EXIT m_exitFunc; + PFN_EXECUTE m_executeCommandFunc; + + void clear() + { + B3_DYNLIB_CLOSE(m_pluginHandle); + m_pluginHandle = 0; + m_initFunc = 0; + m_exitFunc = 0; + m_executeCommandFunc = 0; + } +}; + +typedef b3PoolBodyHandle b3PluginHandle; + +struct b3PluginManagerInternalData +{ + b3ResizablePool m_plugins; + b3HashMap m_pluginMap; +}; + +b3PluginManager::b3PluginManager() +{ + m_data = new b3PluginManagerInternalData; +} + +b3PluginManager::~b3PluginManager() +{ + m_data->m_pluginMap.clear(); + m_data->m_plugins.exitHandles(); + delete m_data; +} + +int b3PluginManager::loadPlugin(const char* pluginPath) +{ + int pluginUniqueId = -1; + + b3Plugin* plugin = m_data->m_pluginMap.find(pluginPath); + if (plugin) + { + //already loaded + } + else + { + pluginUniqueId = m_data->m_plugins.allocHandle(); + b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); + + B3_DYNLIB_HANDLE pluginHandle = B3_DYNLIB_OPEN(pluginPath); + bool ok = false; + if (pluginHandle) + { + + plugin->m_initFunc = (PFN_INIT)B3_DYNLIB_IMPORT(pluginHandle, "initPlugin"); + plugin->m_exitFunc = (PFN_EXIT)B3_DYNLIB_IMPORT(pluginHandle, "exitPlugin"); + plugin->m_executeCommandFunc = (PFN_EXECUTE)B3_DYNLIB_IMPORT(pluginHandle, "executePluginCommand"); + + if (plugin->m_initFunc && plugin->m_exitFunc && plugin->m_executeCommandFunc) + { + int version = plugin->m_initFunc(); + if (version == SHARED_MEMORY_MAGIC_NUMBER) + { + ok = true; + plugin->m_pluginHandle = pluginHandle; + plugin->m_pluginPath = pluginPath; + m_data->m_pluginMap.insert(pluginPath, *plugin); + } + else + { + int expect = SHARED_MEMORY_MAGIC_NUMBER; + b3Warning("Warning: plugin is wrong version: expected %d, got %d\n", expect, version); + } + } + else + { + b3Warning("Loaded plugin but couldn't bind functions"); + } + + if (!ok) + { + B3_DYNLIB_CLOSE(pluginHandle); + } + } + else + { + b3Warning("Warning: couldn't load plugin %s\n", pluginPath); + } + if (!ok) + { + m_data->m_plugins.freeHandle(pluginUniqueId); + pluginUniqueId = -1; + } + } + return pluginUniqueId; +} + +void b3PluginManager::unloadPlugin(int pluginUniqueId) +{ + b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); + if (plugin) + { + plugin->m_exitFunc(); + m_data->m_pluginMap.remove(plugin->m_pluginPath.c_str()); + m_data->m_plugins.freeHandle(pluginUniqueId); + } +} + + +int b3PluginManager::executePluginCommand(int pluginUniqueId, const char* arguments) +{ + int result = -1; + + b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); + if (plugin) + { + result = plugin->m_executeCommandFunc(); + } + return result; +} diff --git a/examples/SharedMemory/b3PluginManager.h b/examples/SharedMemory/b3PluginManager.h new file mode 100644 index 000000000..be8979c95 --- /dev/null +++ b/examples/SharedMemory/b3PluginManager.h @@ -0,0 +1,19 @@ +#ifndef B3_PLUGIN_MANAGER_H +#define B3_PLUGIN_MANAGER_H + +class b3PluginManager +{ + struct b3PluginManagerInternalData* m_data; + + public: + + b3PluginManager(); + virtual ~b3PluginManager(); + + int loadPlugin(const char* pluginPath); + void unloadPlugin(int pluginUniqueId); + int executePluginCommand(int pluginUniqueId, const char* arguments); + +}; + +#endif //B3_PLUGIN_MANAGER_H diff --git a/examples/SharedMemory/plugins/b3PluginAPI.h b/examples/SharedMemory/plugins/b3PluginAPI.h new file mode 100644 index 000000000..7ae6eb337 --- /dev/null +++ b/examples/SharedMemory/plugins/b3PluginAPI.h @@ -0,0 +1,37 @@ +#ifndef B3_PLUGIN_API_H +#define B3_PLUGIN_API_H + +#ifdef _WIN32 +#define B3_SHARED_API __declspec(dllexport) +#elif defined (__GNUC__) +#define B3_SHARED_API __attribute__((visibility("default"))) +#else +#define B3_SHARED_API +#endif + + +#if defined(_WIN32) +#define B3_API_ENTRY +#define B3_API_CALL __stdcall +#define B3_CALLBACK __stdcall +#else +#define B3_API_ENTRY +#define B3_API_CALL +#define B3_CALLBACK +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + /* Plugin API */ + typedef B3_API_ENTRY int (B3_API_CALL * PFN_INIT)(); + typedef B3_API_ENTRY void (B3_API_CALL * PFN_EXIT)(); + typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(); + +#ifdef __cplusplus +} +#endif + +#endif //B3_PLUGIN_API_H diff --git a/examples/SharedMemory/plugins/testPlugin/premake4.lua b/examples/SharedMemory/plugins/testPlugin/premake4.lua new file mode 100644 index 000000000..edc27bacf --- /dev/null +++ b/examples/SharedMemory/plugins/testPlugin/premake4.lua @@ -0,0 +1,42 @@ + + +project ("pybullet_testplugin") + language "C++" + kind "SharedLib" + + includedirs {".","../../../../src", "../../../../examples", + "../../../ThirdPartyLibs"} + defines {"PHYSICS_IN_PROCESS_EXAMPLE_BROWSER"} + hasCL = findOpenCL("clew") + + links{"BulletFileLoader", "Bullet3Common", "LinearMath"} + + + if os.is("MacOSX") then +-- targetextension {"so"} + links{"Cocoa.framework","Python"} + end + + + files { + "testplugin.cpp", + "../../PhysicsClient.cpp", + "../../PhysicsClient.h", + "../../PhysicsClientSharedMemory.cpp", + "../../PhysicsClientSharedMemory.h", + "../../PhysicsClientSharedMemory_C_API.cpp", + "../../PhysicsClientSharedMemory_C_API.h", + "../../PhysicsClientC_API.cpp", + "../../PhysicsClientC_API.h", + "../../Win32SharedMemory.cpp", + "../../Win32SharedMemory.h", + "../../PosixSharedMemory.cpp", + "../../PosixSharedMemory.h", + "../../../Utils/b3Clock.cpp", + "../../../Utils/b3Clock.h", + "../../../Utils/b3ResourcePath.cpp", + "../../../Utils/b3ResourcePath.h", + } + + + diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp new file mode 100644 index 000000000..569632c10 --- /dev/null +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp @@ -0,0 +1,22 @@ + +#include "testplugin.h" +#include "../../SharedMemoryPublic.h" + +#include + +B3_SHARED_API int initPlugin() +{ + printf("hi!\n"); + return SHARED_MEMORY_MAGIC_NUMBER; +} + +B3_SHARED_API int executePluginCommand() +{ + return 42; +} + + +B3_SHARED_API void exitPlugin() +{ + printf("bye!\n"); +} diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.h b/examples/SharedMemory/plugins/testPlugin/testplugin.h new file mode 100644 index 000000000..1c4420a96 --- /dev/null +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.h @@ -0,0 +1,19 @@ +#ifndef TEST_PLUGIN_H +#define TEST_PLUGIN_H + +#include "../b3PluginAPI.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +B3_SHARED_API int initPlugin(); +B3_SHARED_API void exitPlugin(); +B3_SHARED_API int executePluginCommand(); + +#ifdef __cplusplus +}; +#endif + +#endif//#define TEST_PLUGIN_H diff --git a/examples/SharedMemory/premake4.lua b/examples/SharedMemory/premake4.lua index b7d3ab9e7..d729029a8 100644 --- a/examples/SharedMemory/premake4.lua +++ b/examples/SharedMemory/premake4.lua @@ -7,7 +7,7 @@ else kind "ConsoleApp" end -includedirs {".","../../src", "../ThirdPartyLibs",} +includedirs {".","../../src", "../ThirdPartyLibs"} links { "Bullet3Common","BulletInverseDynamicsUtils", "BulletInverseDynamics", "BulletDynamics","BulletCollision", "LinearMath", "BussIK" @@ -53,6 +53,8 @@ myfiles = "SharedMemoryCommandProcessor.h", "PhysicsServerCommandProcessor.cpp", "PhysicsServerCommandProcessor.h", + "b3PluginManager.cpp", + "b3PluginManager.h", "TinyRendererVisualShapeConverter.cpp", "TinyRendererVisualShapeConverter.h", "../TinyRenderer/geometry.cpp", @@ -99,6 +101,7 @@ myfiles = "../ThirdPartyLibs/tinyxml/tinyxmlparser.cpp", "../Importers/ImportMeshUtility/b3ImportMeshUtility.cpp", "../ThirdPartyLibs/stb_image/stb_image.cpp", + } files { @@ -405,4 +408,4 @@ end include "udp" include "tcp" - +include "plugins/testPlugin" diff --git a/examples/SharedMemory/tcp/premake4.lua b/examples/SharedMemory/tcp/premake4.lua index b1d5a73ab..6df7cd949 100644 --- a/examples/SharedMemory/tcp/premake4.lua +++ b/examples/SharedMemory/tcp/premake4.lua @@ -88,6 +88,7 @@ myfiles = "../SharedMemoryPublic.h", "../PhysicsServerCommandProcessor.cpp", "../PhysicsServerCommandProcessor.h", + "../b3PluginManager.cpp", "../TinyRendererVisualShapeConverter.cpp", "../TinyRendererVisualShapeConverter.h", "../../TinyRenderer/geometry.cpp", diff --git a/examples/SharedMemory/udp/premake4.lua b/examples/SharedMemory/udp/premake4.lua index a316d6b1c..3e5e4120b 100644 --- a/examples/SharedMemory/udp/premake4.lua +++ b/examples/SharedMemory/udp/premake4.lua @@ -79,6 +79,7 @@ myfiles = "../SharedMemoryPublic.h", "../PhysicsServerCommandProcessor.cpp", "../PhysicsServerCommandProcessor.h", + "../b3PluginManager.cpp", "../TinyRendererVisualShapeConverter.cpp", "../TinyRendererVisualShapeConverter.h", "../../TinyRenderer/geometry.cpp", diff --git a/examples/pybullet/CMakeLists.txt b/examples/pybullet/CMakeLists.txt index c2f9fd49f..7ca72805b 100644 --- a/examples/pybullet/CMakeLists.txt +++ b/examples/pybullet/CMakeLists.txt @@ -43,6 +43,9 @@ SET(pybullet_SRCS ../../examples/SharedMemory/PhysicsDirectC_API.h ../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp ../../examples/SharedMemory/PhysicsServerCommandProcessor.h + ../../examples/SharedMemory/b3PluginManager.cpp + ../../examples/SharedMemory/b3PluginManager.h + ../../examples/SharedMemory/PhysicsClientSharedMemory.cpp ../../examples/SharedMemory/PhysicsClientSharedMemory.h ../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp diff --git a/examples/pybullet/premake4.lua b/examples/pybullet/premake4.lua index 20b41a49f..a67b7d8b8 100644 --- a/examples/pybullet/premake4.lua +++ b/examples/pybullet/premake4.lua @@ -116,6 +116,8 @@ if not _OPTIONS["no-enet"] then "../../examples/SharedMemory/PhysicsDirectC_API.h", "../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp", "../../examples/SharedMemory/PhysicsServerCommandProcessor.h", + "../../examples/SharedMemory/b3PluginManager.cpp", + "../../examples/SharedMemory/b3PluginManager.h", "../../examples/SharedMemory/PhysicsClientSharedMemory.cpp", "../../examples/SharedMemory/PhysicsClientSharedMemory.h", "../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp", diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index c1f7e2eb2..5cd4c26f5 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -6653,6 +6653,108 @@ static PyObject* pybullet_getEulerFromQuaternion(PyObject* self, return Py_None; } + +static PyObject* pybullet_loadPlugin(PyObject* self, + PyObject* args, PyObject* keywds) +{ + int physicsClientId = 0; + int option = 0; + char* pluginPath = 0; + b3SharedMemoryCommandHandle command = 0; + b3SharedMemoryStatusHandle statusHandle = 0; + int statusType = -1; + + b3PhysicsClientHandle sm = 0; + static char* kwlist[] = { "pluginPath", "option", "physicsClientId", NULL }; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|ii", kwlist, &pluginPath, &option, &physicsClientId)) + { + return NULL; + } + + sm = getPhysicsClient(physicsClientId); + if (sm == 0) + { + PyErr_SetString(SpamError, "Not connected to physics server."); + return NULL; + } + + command = b3CreateCustomCommand(sm); + b3CustomCommandLoadPlugin(command, pluginPath, option); + statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command); + statusType = b3GetStatusPluginUniqueId(statusHandle); + return PyInt_FromLong(statusType); +} + + +static PyObject* pybullet_unloadPlugin(PyObject* self, + PyObject* args, PyObject* keywds) +{ + int physicsClientId = 0; + int pluginUniqueId = -1; + + b3SharedMemoryCommandHandle command = 0; + b3SharedMemoryStatusHandle statusHandle = 0; + int statusType = -1; + + b3PhysicsClientHandle sm = 0; + static char* kwlist[] = { "pluginUniqueId", "physicsClientId", NULL }; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|i", kwlist, &pluginUniqueId,&physicsClientId)) + { + return NULL; + } + + sm = getPhysicsClient(physicsClientId); + if (sm == 0) + { + PyErr_SetString(SpamError, "Not connected to physics server."); + return NULL; + } + + command = b3CreateCustomCommand(sm); + b3CustomCommandUnloadPlugin(command, pluginUniqueId); + statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command); + + Py_INCREF(Py_None); + return Py_None;; +} + +//createCustomCommand for executing commands implemented in a plugin system +static PyObject* pybullet_executePluginCommand(PyObject* self, + PyObject* args, PyObject* keywds) +{ + int physicsClientId = 0; + int pluginUniqueId = -1; + int commandUniqueId = -1; + char* arguments = 0; + + b3PhysicsClientHandle sm = 0; + static char* kwlist[] = { "pluginUniqueId", "commandUniqueId", "arguments", "physicsClientId", NULL }; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "ii|si", kwlist, &pluginUniqueId, &commandUniqueId, &arguments, &physicsClientId)) + { + return NULL; + } + + sm = getPhysicsClient(physicsClientId); + if (sm == 0) + { + PyErr_SetString(SpamError, "Not connected to physics server."); + return NULL; + } + + b3SharedMemoryCommandHandle command=0; + b3SharedMemoryStatusHandle statusHandle=0; + int statusType = -1; + + command = b3CreateCustomCommand(sm); + b3CustomCommandExecutePluginCommand(command, pluginUniqueId, commandUniqueId, arguments); + statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command); + statusType = b3GetStatusPluginCommandResult(statusHandle); + return PyInt_FromLong(statusType); +} + + + + ///Inverse Kinematics binding static PyObject* pybullet_calculateInverseKinematics(PyObject* self, PyObject* args, PyObject* keywds) @@ -6947,6 +7049,7 @@ static PyObject* pybullet_calculateInverseDynamics(PyObject* self, return Py_None; } + static PyMethodDef SpamMethods[] = { {"connect", (PyCFunction)pybullet_connectPhysicsServer, METH_VARARGS | METH_KEYWORDS, @@ -7265,6 +7368,16 @@ static PyMethodDef SpamMethods[] = { "Cast a batch of rays and return the result for each of the rays (first object hit, if any. or -1) " "Takes two arguments (list of from_positions [x,y,z] and a list of to_positions [x,y,z] in Cartesian world coordinates"}, + { "loadPlugin", (PyCFunction)pybullet_loadPlugin, METH_VARARGS | METH_KEYWORDS, + "Load a plugin, could implement custom commands etc." }, + + { "unloadPlugin", (PyCFunction)pybullet_unloadPlugin, METH_VARARGS | METH_KEYWORDS, + "Unload a plugin, given the pluginUniqueId." }, + + { "executePluginCommand", (PyCFunction)pybullet_executePluginCommand, METH_VARARGS | METH_KEYWORDS, + "Execute a command, implemented in a plugin." }, + + {"submitProfileTiming", (PyCFunction)pybullet_submitProfileTiming, METH_VARARGS | METH_KEYWORDS, "Add a custom profile timing that will be visible in performance profile recordings on the physics server." "On the physics server (in GUI and VR mode) you can press 'p' to start and/or stop profile recordings" }, diff --git a/examples/pybullet/unity3d/autogen/NativeMethods.cs b/examples/pybullet/unity3d/autogen/NativeMethods.cs index b0d3521e6..365cffa8c 100644 --- a/examples/pybullet/unity3d/autogen/NativeMethods.cs +++ b/examples/pybullet/unity3d/autogen/NativeMethods.cs @@ -1119,99 +1119,80 @@ public enum eStateLoggingFlags { STATE_LOG_JOINT_TORQUES = (eStateLoggingFlags.STATE_LOG_JOINT_MOTOR_TORQUES + eStateLoggingFlags.STATE_LOG_JOINT_USER_TORQUES), } -[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] -public struct b3PhysicsClientHandle__ { - - /// int - public int unused; -} -[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] -public struct b3SharedMemoryCommandHandle__ { - - /// int - public int unused; -} - -[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] -public struct b3SharedMemoryStatusHandle__ { - - /// int - public int unused; -} public partial class NativeMethods { /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///key: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConnectSharedMemory")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ConnectSharedMemory")] public static extern System.IntPtr b3ConnectSharedMemory(int key) ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///key: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConnectSharedMemory2")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ConnectSharedMemory2")] public static extern System.IntPtr b3ConnectSharedMemory2(int key) ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConnectPhysicsDirect")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ConnectPhysicsDirect")] public static extern System.IntPtr b3ConnectPhysicsDirect() ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///argc: int ///argv: char** - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnect")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateInProcessPhysicsServerAndConnect")] public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnect(int argc, ref System.IntPtr argv) ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///argc: int ///argv: char** - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnectSharedMemory")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateInProcessPhysicsServerAndConnectSharedMemory")] public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, ref System.IntPtr argv) ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///argc: int ///argv: char** - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnectMainThread")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateInProcessPhysicsServerAndConnectMainThread")] public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, ref System.IntPtr argv) ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///argc: int ///argv: char** - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory")] public static extern System.IntPtr b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, ref System.IntPtr argv) ; /// Return Type: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///guiHelperPtr: void* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect")] public static extern System.IntPtr b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(System.IntPtr guiHelperPtr) ; /// Return Type: void ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessRenderSceneInternal")] -public static extern void b3InProcessRenderSceneInternal(ref b3PhysicsClientHandle__ clientHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InProcessRenderSceneInternal")] +public static extern void b3InProcessRenderSceneInternal(System.IntPtr clientHandle) ; /// Return Type: void ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///debugDrawMode: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessDebugDrawInternal")] -public static extern void b3InProcessDebugDrawInternal(ref b3PhysicsClientHandle__ clientHandle, int debugDrawMode) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InProcessDebugDrawInternal")] +public static extern void b3InProcessDebugDrawInternal(System.IntPtr clientHandle, int debugDrawMode) ; /// Return Type: int ///clientHandle: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///x: float ///y: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessMouseMoveCallback")] -public static extern int b3InProcessMouseMoveCallback(ref b3PhysicsClientHandle__ clientHandle, float x, float y) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InProcessMouseMoveCallback")] +public static extern int b3InProcessMouseMoveCallback(System.IntPtr clientHandle, float x, float y) ; /// Return Type: int @@ -1220,60 +1201,60 @@ public static extern int b3InProcessMouseMoveCallback(ref b3PhysicsClientHandle ///state: int ///x: float ///y: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InProcessMouseButtonCallback")] -public static extern int b3InProcessMouseButtonCallback(ref b3PhysicsClientHandle__ clientHandle, int button, int state, float x, float y) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InProcessMouseButtonCallback")] +public static extern int b3InProcessMouseButtonCallback(System.IntPtr clientHandle, int button, int state, float x, float y) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3DisconnectSharedMemory")] -public static extern void b3DisconnectSharedMemory(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3DisconnectSharedMemory")] +public static extern void b3DisconnectSharedMemory(System.IntPtr physClient) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CanSubmitCommand")] -public static extern int b3CanSubmitCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CanSubmitCommand")] +public static extern int b3CanSubmitCommand(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SubmitClientCommandAndWaitStatus")] -public static extern System.IntPtr b3SubmitClientCommandAndWaitStatus(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SubmitClientCommandAndWaitStatus")] +public static extern System.IntPtr b3SubmitClientCommandAndWaitStatus(System.IntPtr physClient, System.IntPtr commandHandle) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SubmitClientCommand")] -public static extern int b3SubmitClientCommand(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SubmitClientCommand")] +public static extern int b3SubmitClientCommand(System.IntPtr physClient, System.IntPtr commandHandle) ; /// Return Type: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ProcessServerStatus")] -public static extern System.IntPtr b3ProcessServerStatus(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ProcessServerStatus")] +public static extern System.IntPtr b3ProcessServerStatus(System.IntPtr physClient) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusType")] -public static extern int b3GetStatusType(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusType")] +public static extern int b3GetStatusType(System.IntPtr statusHandle) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///bodyIndicesOut: int* ///bodyIndicesCapacity: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusBodyIndices")] -public static extern int b3GetStatusBodyIndices(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyIndicesOut, int bodyIndicesCapacity) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusBodyIndices")] +public static extern int b3GetStatusBodyIndices(System.IntPtr statusHandle, ref int bodyIndicesOut, int bodyIndicesCapacity) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusBodyIndex")] -public static extern int b3GetStatusBodyIndex(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusBodyIndex")] +public static extern int b3GetStatusBodyIndex(System.IntPtr statusHandle) ; /// Return Type: int @@ -1285,15 +1266,15 @@ public static extern int b3GetStatusBodyIndex(ref b3SharedMemoryStatusHandle__ ///actualStateQ: double** ///actualStateQdot: double** ///jointReactionForces: double** - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusActualState")] -public static extern int b3GetStatusActualState(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyUniqueId, ref int numDegreeOfFreedomQ, ref int numDegreeOfFreedomU, ref System.IntPtr rootLocalInertialFrame, ref System.IntPtr actualStateQ, ref System.IntPtr actualStateQdot, ref System.IntPtr jointReactionForces) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusActualState")] +public static extern int b3GetStatusActualState(System.IntPtr statusHandle, ref int bodyUniqueId, ref int numDegreeOfFreedomQ, ref int numDegreeOfFreedomU, ref System.IntPtr rootLocalInertialFrame, ref System.IntPtr actualStateQ, ref System.IntPtr actualStateQdot, ref System.IntPtr jointReactionForces) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCollisionInfoCommandInit")] -public static extern System.IntPtr b3RequestCollisionInfoCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCollisionInfoCommandInit")] +public static extern System.IntPtr b3RequestCollisionInfoCommandInit(System.IntPtr physClient, int bodyUniqueId) ; /// Return Type: int @@ -1301,49 +1282,49 @@ public static extern System.IntPtr b3RequestCollisionInfoCommandInit(ref b3Phys ///linkIndex: int ///aabbMin: double* ///aabbMax: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusAABB")] -public static extern int b3GetStatusAABB(ref b3SharedMemoryStatusHandle__ statusHandle, int linkIndex, ref double aabbMin, ref double aabbMax) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusAABB")] +public static extern int b3GetStatusAABB(System.IntPtr statusHandle, int linkIndex, ref double aabbMin, ref double aabbMax) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitSyncBodyInfoCommand")] -public static extern System.IntPtr b3InitSyncBodyInfoCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitSyncBodyInfoCommand")] +public static extern System.IntPtr b3InitSyncBodyInfoCommand(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRemoveBodyCommand")] -public static extern System.IntPtr b3InitRemoveBodyCommand(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRemoveBodyCommand")] +public static extern System.IntPtr b3InitRemoveBodyCommand(System.IntPtr physClient, int bodyUniqueId) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetNumBodies")] -public static extern int b3GetNumBodies(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetNumBodies")] +public static extern int b3GetNumBodies(System.IntPtr physClient) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///serialIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetBodyUniqueId")] -public static extern int b3GetBodyUniqueId(ref b3PhysicsClientHandle__ physClient, int serialIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetBodyUniqueId")] +public static extern int b3GetBodyUniqueId(System.IntPtr physClient, int serialIndex) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int ///info: b3BodyInfo* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetBodyInfo")] -public static extern int b3GetBodyInfo(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, ref b3BodyInfo info) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetBodyInfo")] +public static extern int b3GetBodyInfo(System.IntPtr physClient, int bodyUniqueId, ref b3BodyInfo info) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetNumJoints")] -public static extern int b3GetNumJoints(ref b3PhysicsClientHandle__ physClient, int bodyIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetNumJoints")] +public static extern int b3GetNumJoints(System.IntPtr physClient, int bodyIndex) ; /// Return Type: int @@ -1351,29 +1332,29 @@ public static extern int b3GetNumJoints(ref b3PhysicsClientHandle__ physClient, ///bodyIndex: int ///jointIndex: int ///info: b3JointInfo* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetJointInfo")] -public static extern int b3GetJointInfo(ref b3PhysicsClientHandle__ physClient, int bodyIndex, int jointIndex, ref b3JointInfo info) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetJointInfo")] +public static extern int b3GetJointInfo(System.IntPtr physClient, int bodyIndex, int jointIndex, ref b3JointInfo info) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int ///linkIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDynamicsInfoCommandInit")] -public static extern System.IntPtr b3GetDynamicsInfoCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, int linkIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetDynamicsInfoCommandInit")] +public static extern System.IntPtr b3GetDynamicsInfoCommandInit(System.IntPtr physClient, int bodyUniqueId, int linkIndex) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///info: b3DynamicsInfo* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDynamicsInfo")] -public static extern int b3GetDynamicsInfo(ref b3SharedMemoryStatusHandle__ statusHandle, ref b3DynamicsInfo info) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetDynamicsInfo")] +public static extern int b3GetDynamicsInfo(System.IntPtr statusHandle, ref b3DynamicsInfo info) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeDynamicsInfo")] -public static extern System.IntPtr b3InitChangeDynamicsInfo(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeDynamicsInfo")] +public static extern System.IntPtr b3InitChangeDynamicsInfo(System.IntPtr physClient) ; /// Return Type: int @@ -1381,8 +1362,8 @@ public static extern System.IntPtr b3InitChangeDynamicsInfo(ref b3PhysicsClient ///bodyUniqueId: int ///linkIndex: int ///mass: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetMass")] -public static extern int b3ChangeDynamicsInfoSetMass(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double mass) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetMass")] +public static extern int b3ChangeDynamicsInfoSetMass(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, double mass) ; /// Return Type: int @@ -1390,8 +1371,8 @@ public static extern int b3ChangeDynamicsInfoSetMass(ref b3SharedMemoryCommandH ///bodyUniqueId: int ///linkIndex: int ///lateralFriction: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetLateralFriction")] -public static extern int b3ChangeDynamicsInfoSetLateralFriction(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetLateralFriction")] +public static extern int b3ChangeDynamicsInfoSetLateralFriction(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction) ; /// Return Type: int @@ -1399,8 +1380,8 @@ public static extern int b3ChangeDynamicsInfoSetLateralFriction(ref b3SharedMem ///bodyUniqueId: int ///linkIndex: int ///friction: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetSpinningFriction")] -public static extern int b3ChangeDynamicsInfoSetSpinningFriction(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double friction) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetSpinningFriction")] +public static extern int b3ChangeDynamicsInfoSetSpinningFriction(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, double friction) ; /// Return Type: int @@ -1408,8 +1389,8 @@ public static extern int b3ChangeDynamicsInfoSetSpinningFriction(ref b3SharedMe ///bodyUniqueId: int ///linkIndex: int ///friction: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetRollingFriction")] -public static extern int b3ChangeDynamicsInfoSetRollingFriction(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double friction) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetRollingFriction")] +public static extern int b3ChangeDynamicsInfoSetRollingFriction(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, double friction) ; /// Return Type: int @@ -1417,24 +1398,24 @@ public static extern int b3ChangeDynamicsInfoSetRollingFriction(ref b3SharedMem ///bodyUniqueId: int ///linkIndex: int ///restitution: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetRestitution")] -public static extern int b3ChangeDynamicsInfoSetRestitution(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double restitution) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetRestitution")] +public static extern int b3ChangeDynamicsInfoSetRestitution(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, double restitution) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyUniqueId: int ///linearDamping: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetLinearDamping")] -public static extern int b3ChangeDynamicsInfoSetLinearDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, double linearDamping) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetLinearDamping")] +public static extern int b3ChangeDynamicsInfoSetLinearDamping(System.IntPtr commandHandle, int bodyUniqueId, double linearDamping) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyUniqueId: int ///angularDamping: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetAngularDamping")] -public static extern int b3ChangeDynamicsInfoSetAngularDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, double angularDamping) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetAngularDamping")] +public static extern int b3ChangeDynamicsInfoSetAngularDamping(System.IntPtr commandHandle, int bodyUniqueId, double angularDamping) ; /// Return Type: int @@ -1443,8 +1424,8 @@ public static extern int b3ChangeDynamicsInfoSetAngularDamping(ref b3SharedMemo ///linkIndex: int ///contactStiffness: double ///contactDamping: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetContactStiffnessAndDamping")] -public static extern int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, double contactStiffness, double contactDamping) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetContactStiffnessAndDamping")] +public static extern int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, double contactStiffness, double contactDamping) ; /// Return Type: int @@ -1452,8 +1433,8 @@ public static extern int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(ref ///bodyUniqueId: int ///linkIndex: int ///frictionAnchor: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ChangeDynamicsInfoSetFrictionAnchor")] -public static extern int b3ChangeDynamicsInfoSetFrictionAnchor(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkIndex, int frictionAnchor) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ChangeDynamicsInfoSetFrictionAnchor")] +public static extern int b3ChangeDynamicsInfoSetFrictionAnchor(System.IntPtr commandHandle, int bodyUniqueId, int linkIndex, int frictionAnchor) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -1463,112 +1444,112 @@ public static extern int b3ChangeDynamicsInfoSetFrictionAnchor(ref b3SharedMemo ///childBodyIndex: int ///childJointIndex: int ///info: b3JointInfo* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitCreateUserConstraintCommand")] -public static extern System.IntPtr b3InitCreateUserConstraintCommand(ref b3PhysicsClientHandle__ physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, ref b3JointInfo info) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitCreateUserConstraintCommand")] +public static extern System.IntPtr b3InitCreateUserConstraintCommand(System.IntPtr physClient, int parentBodyIndex, int parentJointIndex, int childBodyIndex, int childJointIndex, ref b3JointInfo info) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusUserConstraintUniqueId")] -public static extern int b3GetStatusUserConstraintUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusUserConstraintUniqueId")] +public static extern int b3GetStatusUserConstraintUniqueId(System.IntPtr statusHandle) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///userConstraintUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintCommand")] -public static extern System.IntPtr b3InitChangeUserConstraintCommand(ref b3PhysicsClientHandle__ physClient, int userConstraintUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeUserConstraintCommand")] +public static extern System.IntPtr b3InitChangeUserConstraintCommand(System.IntPtr physClient, int userConstraintUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///jointChildPivot: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetPivotInB")] -public static extern int b3InitChangeUserConstraintSetPivotInB(ref b3SharedMemoryCommandHandle__ commandHandle, ref double jointChildPivot) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeUserConstraintSetPivotInB")] +public static extern int b3InitChangeUserConstraintSetPivotInB(System.IntPtr commandHandle, ref double jointChildPivot) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///jointChildFrameOrn: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetFrameInB")] -public static extern int b3InitChangeUserConstraintSetFrameInB(ref b3SharedMemoryCommandHandle__ commandHandle, ref double jointChildFrameOrn) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeUserConstraintSetFrameInB")] +public static extern int b3InitChangeUserConstraintSetFrameInB(System.IntPtr commandHandle, ref double jointChildFrameOrn) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///maxAppliedForce: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetMaxForce")] -public static extern int b3InitChangeUserConstraintSetMaxForce(ref b3SharedMemoryCommandHandle__ commandHandle, double maxAppliedForce) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeUserConstraintSetMaxForce")] +public static extern int b3InitChangeUserConstraintSetMaxForce(System.IntPtr commandHandle, double maxAppliedForce) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///gearRatio: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetGearRatio")] -public static extern int b3InitChangeUserConstraintSetGearRatio(ref b3SharedMemoryCommandHandle__ commandHandle, double gearRatio) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeUserConstraintSetGearRatio")] +public static extern int b3InitChangeUserConstraintSetGearRatio(System.IntPtr commandHandle, double gearRatio) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///gearAuxLink: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitChangeUserConstraintSetGearAuxLink")] -public static extern int b3InitChangeUserConstraintSetGearAuxLink(ref b3SharedMemoryCommandHandle__ commandHandle, int gearAuxLink) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitChangeUserConstraintSetGearAuxLink")] +public static extern int b3InitChangeUserConstraintSetGearAuxLink(System.IntPtr commandHandle, int gearAuxLink) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///userConstraintUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRemoveUserConstraintCommand")] -public static extern System.IntPtr b3InitRemoveUserConstraintCommand(ref b3PhysicsClientHandle__ physClient, int userConstraintUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRemoveUserConstraintCommand")] +public static extern System.IntPtr b3InitRemoveUserConstraintCommand(System.IntPtr physClient, int userConstraintUniqueId) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetNumUserConstraints")] -public static extern int b3GetNumUserConstraints(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetNumUserConstraints")] +public static extern int b3GetNumUserConstraints(System.IntPtr physClient) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///constraintUniqueId: int ///info: b3UserConstraint* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetUserConstraintInfo")] -public static extern int b3GetUserConstraintInfo(ref b3PhysicsClientHandle__ physClient, int constraintUniqueId, ref b3UserConstraint info) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetUserConstraintInfo")] +public static extern int b3GetUserConstraintInfo(System.IntPtr physClient, int constraintUniqueId, ref b3UserConstraint info) ; /// Return Type: int ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///serialIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetUserConstraintId")] -public static extern int b3GetUserConstraintId(ref b3PhysicsClientHandle__ physClient, int serialIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetUserConstraintId")] +public static extern int b3GetUserConstraintId(System.IntPtr physClient, int serialIndex) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///debugMode: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestDebugLinesCommand")] -public static extern System.IntPtr b3InitRequestDebugLinesCommand(ref b3PhysicsClientHandle__ physClient, int debugMode) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRequestDebugLinesCommand")] +public static extern System.IntPtr b3InitRequestDebugLinesCommand(System.IntPtr physClient, int debugMode) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///lines: b3DebugLines* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDebugLines")] -public static extern void b3GetDebugLines(ref b3PhysicsClientHandle__ physClient, ref b3DebugLines lines) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetDebugLines")] +public static extern void b3GetDebugLines(System.IntPtr physClient, ref b3DebugLines lines) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitConfigureOpenGLVisualizer")] -public static extern System.IntPtr b3InitConfigureOpenGLVisualizer(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitConfigureOpenGLVisualizer")] +public static extern System.IntPtr b3InitConfigureOpenGLVisualizer(System.IntPtr physClient) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///flag: int ///enabled: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConfigureOpenGLVisualizerSetVisualizationFlags")] -public static extern void b3ConfigureOpenGLVisualizerSetVisualizationFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flag, int enabled) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ConfigureOpenGLVisualizerSetVisualizationFlags")] +public static extern void b3ConfigureOpenGLVisualizerSetVisualizationFlags(System.IntPtr commandHandle, int flag, int enabled) ; /// Return Type: void @@ -1577,21 +1558,21 @@ public static extern void b3ConfigureOpenGLVisualizerSetVisualizationFlags(ref ///cameraPitch: float ///cameraYaw: float ///cameraTargetPosition: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ConfigureOpenGLVisualizerSetViewMatrix")] -public static extern void b3ConfigureOpenGLVisualizerSetViewMatrix(ref b3SharedMemoryCommandHandle__ commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, ref float cameraTargetPosition) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ConfigureOpenGLVisualizerSetViewMatrix")] +public static extern void b3ConfigureOpenGLVisualizerSetViewMatrix(System.IntPtr commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, ref float cameraTargetPosition) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestOpenGLVisualizerCameraCommand")] -public static extern System.IntPtr b3InitRequestOpenGLVisualizerCameraCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRequestOpenGLVisualizerCameraCommand")] +public static extern System.IntPtr b3InitRequestOpenGLVisualizerCameraCommand(System.IntPtr physClient) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///camera: b3OpenGLVisualizerCameraInfo* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusOpenGLVisualizerCamera")] -public static extern int b3GetStatusOpenGLVisualizerCamera(ref b3SharedMemoryStatusHandle__ statusHandle, ref b3OpenGLVisualizerCameraInfo camera) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusOpenGLVisualizerCamera")] +public static extern int b3GetStatusOpenGLVisualizerCamera(System.IntPtr statusHandle, ref b3OpenGLVisualizerCameraInfo camera) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -1601,8 +1582,8 @@ public static extern int b3GetStatusOpenGLVisualizerCamera(ref b3SharedMemorySt ///colorRGB: double* ///lineWidth: double ///lifeTime: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawAddLine3D")] -public static extern System.IntPtr b3InitUserDebugDrawAddLine3D(ref b3PhysicsClientHandle__ physClient, ref double fromXYZ, ref double toXYZ, ref double colorRGB, double lineWidth, double lifeTime) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUserDebugDrawAddLine3D")] +public static extern System.IntPtr b3InitUserDebugDrawAddLine3D(System.IntPtr physClient, ref double fromXYZ, ref double toXYZ, ref double colorRGB, double lineWidth, double lifeTime) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -1612,30 +1593,30 @@ public static extern System.IntPtr b3InitUserDebugDrawAddLine3D(ref b3PhysicsCl ///colorRGB: double* ///textSize: double ///lifeTime: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawAddText3D")] -public static extern System.IntPtr b3InitUserDebugDrawAddText3D(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string txt, ref double positionXYZ, ref double colorRGB, double textSize, double lifeTime) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUserDebugDrawAddText3D")] +public static extern System.IntPtr b3InitUserDebugDrawAddText3D(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string txt, ref double positionXYZ, ref double colorRGB, double textSize, double lifeTime) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///optionFlags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UserDebugTextSetOptionFlags")] -public static extern void b3UserDebugTextSetOptionFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int optionFlags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3UserDebugTextSetOptionFlags")] +public static extern void b3UserDebugTextSetOptionFlags(System.IntPtr commandHandle, int optionFlags) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///orientation: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UserDebugTextSetOrientation")] -public static extern void b3UserDebugTextSetOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, ref double orientation) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3UserDebugTextSetOrientation")] +public static extern void b3UserDebugTextSetOrientation(System.IntPtr commandHandle, ref double orientation) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///objectUniqueId: int ///linkIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UserDebugItemSetParentObject")] -public static extern void b3UserDebugItemSetParentObject(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId, int linkIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3UserDebugItemSetParentObject")] +public static extern void b3UserDebugItemSetParentObject(System.IntPtr commandHandle, int objectUniqueId, int linkIndex) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -1644,41 +1625,41 @@ public static extern void b3UserDebugItemSetParentObject(ref b3SharedMemoryComm ///rangeMin: double ///rangeMax: double ///startValue: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugAddParameter")] -public static extern System.IntPtr b3InitUserDebugAddParameter(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string txt, double rangeMin, double rangeMax, double startValue) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUserDebugAddParameter")] +public static extern System.IntPtr b3InitUserDebugAddParameter(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string txt, double rangeMin, double rangeMax, double startValue) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///debugItemUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugReadParameter")] -public static extern System.IntPtr b3InitUserDebugReadParameter(ref b3PhysicsClientHandle__ physClient, int debugItemUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUserDebugReadParameter")] +public static extern System.IntPtr b3InitUserDebugReadParameter(System.IntPtr physClient, int debugItemUniqueId) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///paramValue: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusDebugParameterValue")] -public static extern int b3GetStatusDebugParameterValue(ref b3SharedMemoryStatusHandle__ statusHandle, ref double paramValue) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusDebugParameterValue")] +public static extern int b3GetStatusDebugParameterValue(System.IntPtr statusHandle, ref double paramValue) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///debugItemUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawRemove")] -public static extern System.IntPtr b3InitUserDebugDrawRemove(ref b3PhysicsClientHandle__ physClient, int debugItemUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUserDebugDrawRemove")] +public static extern System.IntPtr b3InitUserDebugDrawRemove(System.IntPtr physClient, int debugItemUniqueId) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUserDebugDrawRemoveAll")] -public static extern System.IntPtr b3InitUserDebugDrawRemoveAll(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUserDebugDrawRemoveAll")] +public static extern System.IntPtr b3InitUserDebugDrawRemoveAll(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitDebugDrawingCommand")] -public static extern System.IntPtr b3InitDebugDrawingCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitDebugDrawingCommand")] +public static extern System.IntPtr b3InitDebugDrawingCommand(System.IntPtr physClient) ; /// Return Type: void @@ -1686,107 +1667,107 @@ public static extern System.IntPtr b3InitDebugDrawingCommand(ref b3PhysicsClien ///objectUniqueId: int ///linkIndex: int ///objectColorRGB: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetDebugObjectColor")] -public static extern void b3SetDebugObjectColor(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId, int linkIndex, ref double objectColorRGB) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetDebugObjectColor")] +public static extern void b3SetDebugObjectColor(System.IntPtr commandHandle, int objectUniqueId, int linkIndex, ref double objectColorRGB) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///objectUniqueId: int ///linkIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RemoveDebugObjectColor")] -public static extern void b3RemoveDebugObjectColor(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId, int linkIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RemoveDebugObjectColor")] +public static extern void b3RemoveDebugObjectColor(System.IntPtr commandHandle, int objectUniqueId, int linkIndex) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetDebugItemUniqueId")] -public static extern int b3GetDebugItemUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetDebugItemUniqueId")] +public static extern int b3GetDebugItemUniqueId(System.IntPtr statusHandle) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestCameraImage")] -public static extern System.IntPtr b3InitRequestCameraImage(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRequestCameraImage")] +public static extern System.IntPtr b3InitRequestCameraImage(System.IntPtr physClient) ; /// Return Type: void ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///viewMatrix: float* ///projectionMatrix: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetCameraMatrices")] -public static extern void b3RequestCameraImageSetCameraMatrices(ref b3SharedMemoryCommandHandle__ command, ref float viewMatrix, ref float projectionMatrix) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetCameraMatrices")] +public static extern void b3RequestCameraImageSetCameraMatrices(System.IntPtr command, ref float viewMatrix, ref float projectionMatrix) ; /// Return Type: void ///command: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///width: int ///height: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetPixelResolution")] -public static extern void b3RequestCameraImageSetPixelResolution(ref b3SharedMemoryCommandHandle__ command, int width, int height) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetPixelResolution")] +public static extern void b3RequestCameraImageSetPixelResolution(System.IntPtr command, int width, int height) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///lightDirection: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightDirection")] -public static extern void b3RequestCameraImageSetLightDirection(ref b3SharedMemoryCommandHandle__ commandHandle, ref float lightDirection) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetLightDirection")] +public static extern void b3RequestCameraImageSetLightDirection(System.IntPtr commandHandle, ref float lightDirection) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///lightColor: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightColor")] -public static extern void b3RequestCameraImageSetLightColor(ref b3SharedMemoryCommandHandle__ commandHandle, ref float lightColor) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetLightColor")] +public static extern void b3RequestCameraImageSetLightColor(System.IntPtr commandHandle, ref float lightColor) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///lightDistance: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightDistance")] -public static extern void b3RequestCameraImageSetLightDistance(ref b3SharedMemoryCommandHandle__ commandHandle, float lightDistance) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetLightDistance")] +public static extern void b3RequestCameraImageSetLightDistance(System.IntPtr commandHandle, float lightDistance) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///lightAmbientCoeff: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightAmbientCoeff")] -public static extern void b3RequestCameraImageSetLightAmbientCoeff(ref b3SharedMemoryCommandHandle__ commandHandle, float lightAmbientCoeff) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetLightAmbientCoeff")] +public static extern void b3RequestCameraImageSetLightAmbientCoeff(System.IntPtr commandHandle, float lightAmbientCoeff) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///lightDiffuseCoeff: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightDiffuseCoeff")] -public static extern void b3RequestCameraImageSetLightDiffuseCoeff(ref b3SharedMemoryCommandHandle__ commandHandle, float lightDiffuseCoeff) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetLightDiffuseCoeff")] +public static extern void b3RequestCameraImageSetLightDiffuseCoeff(System.IntPtr commandHandle, float lightDiffuseCoeff) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///lightSpecularCoeff: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetLightSpecularCoeff")] -public static extern void b3RequestCameraImageSetLightSpecularCoeff(ref b3SharedMemoryCommandHandle__ commandHandle, float lightSpecularCoeff) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetLightSpecularCoeff")] +public static extern void b3RequestCameraImageSetLightSpecularCoeff(System.IntPtr commandHandle, float lightSpecularCoeff) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///hasShadow: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetShadow")] -public static extern void b3RequestCameraImageSetShadow(ref b3SharedMemoryCommandHandle__ commandHandle, int hasShadow) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetShadow")] +public static extern void b3RequestCameraImageSetShadow(System.IntPtr commandHandle, int hasShadow) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///renderer: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSelectRenderer")] -public static extern void b3RequestCameraImageSelectRenderer(ref b3SharedMemoryCommandHandle__ commandHandle, int renderer) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSelectRenderer")] +public static extern void b3RequestCameraImageSelectRenderer(System.IntPtr commandHandle, int renderer) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///imageData: b3CameraImageData* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetCameraImageData")] -public static extern void b3GetCameraImageData(ref b3PhysicsClientHandle__ physClient, ref b3CameraImageData imageData) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetCameraImageData")] +public static extern void b3GetCameraImageData(System.IntPtr physClient, ref b3CameraImageData imageData) ; /// Return Type: void @@ -1794,7 +1775,7 @@ public static extern void b3GetCameraImageData(ref b3PhysicsClientHandle__ phys ///cameraTargetPosition: float* ///cameraUp: float* ///viewMatrix: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeViewMatrixFromPositions")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ComputeViewMatrixFromPositions")] public static extern void b3ComputeViewMatrixFromPositions(ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp, ref float viewMatrix) ; @@ -1806,7 +1787,7 @@ public static extern void b3ComputeViewMatrixFromPositions(ref float cameraPosi ///roll: float ///upAxis: int ///viewMatrix: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeViewMatrixFromYawPitchRoll")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ComputeViewMatrixFromYawPitchRoll")] public static extern void b3ComputeViewMatrixFromYawPitchRoll(ref float cameraTargetPosition, float distance, float yaw, float pitch, float roll, int upAxis, ref float viewMatrix) ; @@ -1815,7 +1796,7 @@ public static extern void b3ComputeViewMatrixFromYawPitchRoll(ref float cameraT ///cameraPosition: float* ///cameraTargetPosition: float* ///cameraUp: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputePositionFromViewMatrix")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ComputePositionFromViewMatrix")] public static extern void b3ComputePositionFromViewMatrix(ref float viewMatrix, ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp) ; @@ -1827,7 +1808,7 @@ public static extern void b3ComputePositionFromViewMatrix(ref float viewMatrix, ///nearVal: float ///farVal: float ///projectionMatrix: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeProjectionMatrix")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ComputeProjectionMatrix")] public static extern void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, ref float projectionMatrix) ; @@ -1837,7 +1818,7 @@ public static extern void b3ComputeProjectionMatrix(float left, float right, fl ///nearVal: float ///farVal: float ///projectionMatrix: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ComputeProjectionMatrixFOV")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ComputeProjectionMatrixFOV")] public static extern void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, ref float projectionMatrix) ; @@ -1846,8 +1827,8 @@ public static extern void b3ComputeProjectionMatrixFOV(float fov, float aspect, ///cameraPosition: float* ///cameraTargetPosition: float* ///cameraUp: float* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetViewMatrix")] -public static extern void b3RequestCameraImageSetViewMatrix(ref b3SharedMemoryCommandHandle__ command, ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetViewMatrix")] +public static extern void b3RequestCameraImageSetViewMatrix(System.IntPtr command, ref float cameraPosition, ref float cameraTargetPosition, ref float cameraUp) ; /// Return Type: void @@ -1858,8 +1839,8 @@ public static extern void b3RequestCameraImageSetViewMatrix(ref b3SharedMemoryC ///pitch: float ///roll: float ///upAxis: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetViewMatrix2")] -public static extern void b3RequestCameraImageSetViewMatrix2(ref b3SharedMemoryCommandHandle__ commandHandle, ref float cameraTargetPosition, float distance, float yaw, float pitch, float roll, int upAxis) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetViewMatrix2")] +public static extern void b3RequestCameraImageSetViewMatrix2(System.IntPtr commandHandle, ref float cameraTargetPosition, float distance, float yaw, float pitch, float roll, int upAxis) ; /// Return Type: void @@ -1870,8 +1851,8 @@ public static extern void b3RequestCameraImageSetViewMatrix2(ref b3SharedMemory ///top: float ///nearVal: float ///farVal: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetProjectionMatrix")] -public static extern void b3RequestCameraImageSetProjectionMatrix(ref b3SharedMemoryCommandHandle__ command, float left, float right, float bottom, float top, float nearVal, float farVal) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetProjectionMatrix")] +public static extern void b3RequestCameraImageSetProjectionMatrix(System.IntPtr command, float left, float right, float bottom, float top, float nearVal, float farVal) ; /// Return Type: void @@ -1880,139 +1861,139 @@ public static extern void b3RequestCameraImageSetProjectionMatrix(ref b3SharedM ///aspect: float ///nearVal: float ///farVal: float - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestCameraImageSetFOVProjectionMatrix")] -public static extern void b3RequestCameraImageSetFOVProjectionMatrix(ref b3SharedMemoryCommandHandle__ command, float fov, float aspect, float nearVal, float farVal) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestCameraImageSetFOVProjectionMatrix")] +public static extern void b3RequestCameraImageSetFOVProjectionMatrix(System.IntPtr command, float fov, float aspect, float nearVal, float farVal) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestContactPointInformation")] -public static extern System.IntPtr b3InitRequestContactPointInformation(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRequestContactPointInformation")] +public static extern System.IntPtr b3InitRequestContactPointInformation(System.IntPtr physClient) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyUniqueIdA: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterBodyA")] -public static extern void b3SetContactFilterBodyA(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdA) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetContactFilterBodyA")] +public static extern void b3SetContactFilterBodyA(System.IntPtr commandHandle, int bodyUniqueIdA) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyUniqueIdB: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterBodyB")] -public static extern void b3SetContactFilterBodyB(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdB) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetContactFilterBodyB")] +public static extern void b3SetContactFilterBodyB(System.IntPtr commandHandle, int bodyUniqueIdB) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndexA: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterLinkA")] -public static extern void b3SetContactFilterLinkA(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexA) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetContactFilterLinkA")] +public static extern void b3SetContactFilterLinkA(System.IntPtr commandHandle, int linkIndexA) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndexB: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetContactFilterLinkB")] -public static extern void b3SetContactFilterLinkB(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexB) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetContactFilterLinkB")] +public static extern void b3SetContactFilterLinkB(System.IntPtr commandHandle, int linkIndexB) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///contactPointInfo: b3ContactInformation* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetContactPointInformation")] -public static extern void b3GetContactPointInformation(ref b3PhysicsClientHandle__ physClient, ref b3ContactInformation contactPointInfo) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetContactPointInformation")] +public static extern void b3GetContactPointInformation(System.IntPtr physClient, ref b3ContactInformation contactPointInfo) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitClosestDistanceQuery")] -public static extern System.IntPtr b3InitClosestDistanceQuery(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitClosestDistanceQuery")] +public static extern System.IntPtr b3InitClosestDistanceQuery(System.IntPtr physClient) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyUniqueIdA: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterBodyA")] -public static extern void b3SetClosestDistanceFilterBodyA(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdA) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetClosestDistanceFilterBodyA")] +public static extern void b3SetClosestDistanceFilterBodyA(System.IntPtr commandHandle, int bodyUniqueIdA) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndexA: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterLinkA")] -public static extern void b3SetClosestDistanceFilterLinkA(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexA) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetClosestDistanceFilterLinkA")] +public static extern void b3SetClosestDistanceFilterLinkA(System.IntPtr commandHandle, int linkIndexA) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyUniqueIdB: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterBodyB")] -public static extern void b3SetClosestDistanceFilterBodyB(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueIdB) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetClosestDistanceFilterBodyB")] +public static extern void b3SetClosestDistanceFilterBodyB(System.IntPtr commandHandle, int bodyUniqueIdB) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndexB: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceFilterLinkB")] -public static extern void b3SetClosestDistanceFilterLinkB(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexB) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetClosestDistanceFilterLinkB")] +public static extern void b3SetClosestDistanceFilterLinkB(System.IntPtr commandHandle, int linkIndexB) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///distance: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetClosestDistanceThreshold")] -public static extern void b3SetClosestDistanceThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double distance) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetClosestDistanceThreshold")] +public static extern void b3SetClosestDistanceThreshold(System.IntPtr commandHandle, double distance) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///contactPointInfo: b3ContactInformation* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetClosestPointInformation")] -public static extern void b3GetClosestPointInformation(ref b3PhysicsClientHandle__ physClient, ref b3ContactInformation contactPointInfo) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetClosestPointInformation")] +public static extern void b3GetClosestPointInformation(System.IntPtr physClient, ref b3ContactInformation contactPointInfo) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///aabbMin: double* ///aabbMax: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitAABBOverlapQuery")] -public static extern System.IntPtr b3InitAABBOverlapQuery(ref b3PhysicsClientHandle__ physClient, ref double aabbMin, ref double aabbMax) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitAABBOverlapQuery")] +public static extern System.IntPtr b3InitAABBOverlapQuery(System.IntPtr physClient, ref double aabbMin, ref double aabbMax) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///data: b3AABBOverlapData* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetAABBOverlapResults")] -public static extern void b3GetAABBOverlapResults(ref b3PhysicsClientHandle__ physClient, ref b3AABBOverlapData data) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetAABBOverlapResults")] +public static extern void b3GetAABBOverlapResults(System.IntPtr physClient, ref b3AABBOverlapData data) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueIdA: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitRequestVisualShapeInformation")] -public static extern System.IntPtr b3InitRequestVisualShapeInformation(ref b3PhysicsClientHandle__ physClient, int bodyUniqueIdA) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitRequestVisualShapeInformation")] +public static extern System.IntPtr b3InitRequestVisualShapeInformation(System.IntPtr physClient, int bodyUniqueIdA) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///visualShapeInfo: b3VisualShapeInformation* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetVisualShapeInformation")] -public static extern void b3GetVisualShapeInformation(ref b3PhysicsClientHandle__ physClient, ref b3VisualShapeInformation visualShapeInfo) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetVisualShapeInformation")] +public static extern void b3GetVisualShapeInformation(System.IntPtr physClient, ref b3VisualShapeInformation visualShapeInfo) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///filename: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitLoadTexture")] -public static extern System.IntPtr b3InitLoadTexture(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string filename) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitLoadTexture")] +public static extern System.IntPtr b3InitLoadTexture(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string filename) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusTextureUniqueId")] -public static extern int b3GetStatusTextureUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusTextureUniqueId")] +public static extern int b3GetStatusTextureUniqueId(System.IntPtr statusHandle) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2021,8 +2002,8 @@ public static extern int b3GetStatusTextureUniqueId(ref b3SharedMemoryStatusHan ///width: int ///height: int ///rgbPixels: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateChangeTextureCommandInit")] -public static extern System.IntPtr b3CreateChangeTextureCommandInit(ref b3PhysicsClientHandle__ physClient, int textureUniqueId, int width, int height, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string rgbPixels) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateChangeTextureCommandInit")] +public static extern System.IntPtr b3CreateChangeTextureCommandInit(System.IntPtr physClient, int textureUniqueId, int width, int height, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string rgbPixels) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2031,28 +2012,28 @@ public static extern System.IntPtr b3CreateChangeTextureCommandInit(ref b3Physi ///jointIndex: int ///shapeIndex: int ///textureUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitUpdateVisualShape")] -public static extern System.IntPtr b3InitUpdateVisualShape(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitUpdateVisualShape")] +public static extern System.IntPtr b3InitUpdateVisualShape(System.IntPtr physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///rgbaColor: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UpdateVisualShapeRGBAColor")] -public static extern void b3UpdateVisualShapeRGBAColor(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rgbaColor) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3UpdateVisualShapeRGBAColor")] +public static extern void b3UpdateVisualShapeRGBAColor(System.IntPtr commandHandle, ref double rgbaColor) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///specularColor: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3UpdateVisualShapeSpecularColor")] -public static extern void b3UpdateVisualShapeSpecularColor(ref b3SharedMemoryCommandHandle__ commandHandle, ref double specularColor) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3UpdateVisualShapeSpecularColor")] +public static extern void b3UpdateVisualShapeSpecularColor(System.IntPtr commandHandle, ref double specularColor) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitPhysicsParamCommand")] -public static extern System.IntPtr b3InitPhysicsParamCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitPhysicsParamCommand")] +public static extern System.IntPtr b3InitPhysicsParamCommand(System.IntPtr physClient) ; /// Return Type: int @@ -2060,132 +2041,132 @@ public static extern System.IntPtr b3InitPhysicsParamCommand(ref b3PhysicsClien ///gravx: double ///gravy: double ///gravz: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetGravity")] -public static extern int b3PhysicsParamSetGravity(ref b3SharedMemoryCommandHandle__ commandHandle, double gravx, double gravy, double gravz) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetGravity")] +public static extern int b3PhysicsParamSetGravity(System.IntPtr commandHandle, double gravx, double gravy, double gravz) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///timeStep: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetTimeStep")] -public static extern int b3PhysicsParamSetTimeStep(ref b3SharedMemoryCommandHandle__ commandHandle, double timeStep) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetTimeStep")] +public static extern int b3PhysicsParamSetTimeStep(System.IntPtr commandHandle, double timeStep) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///defaultContactERP: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetDefaultContactERP")] -public static extern int b3PhysicsParamSetDefaultContactERP(ref b3SharedMemoryCommandHandle__ commandHandle, double defaultContactERP) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetDefaultContactERP")] +public static extern int b3PhysicsParamSetDefaultContactERP(System.IntPtr commandHandle, double defaultContactERP) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///defaultNonContactERP: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetDefaultNonContactERP")] -public static extern int b3PhysicsParamSetDefaultNonContactERP(ref b3SharedMemoryCommandHandle__ commandHandle, double defaultNonContactERP) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetDefaultNonContactERP")] +public static extern int b3PhysicsParamSetDefaultNonContactERP(System.IntPtr commandHandle, double defaultNonContactERP) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///frictionERP: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetDefaultFrictionERP")] -public static extern int b3PhysicsParamSetDefaultFrictionERP(ref b3SharedMemoryCommandHandle__ commandHandle, double frictionERP) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetDefaultFrictionERP")] +public static extern int b3PhysicsParamSetDefaultFrictionERP(System.IntPtr commandHandle, double frictionERP) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///numSubSteps: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetNumSubSteps")] -public static extern int b3PhysicsParamSetNumSubSteps(ref b3SharedMemoryCommandHandle__ commandHandle, int numSubSteps) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetNumSubSteps")] +public static extern int b3PhysicsParamSetNumSubSteps(System.IntPtr commandHandle, int numSubSteps) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///enableRealTimeSimulation: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetRealTimeSimulation")] -public static extern int b3PhysicsParamSetRealTimeSimulation(ref b3SharedMemoryCommandHandle__ commandHandle, int enableRealTimeSimulation) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetRealTimeSimulation")] +public static extern int b3PhysicsParamSetRealTimeSimulation(System.IntPtr commandHandle, int enableRealTimeSimulation) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///numSolverIterations: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetNumSolverIterations")] -public static extern int b3PhysicsParamSetNumSolverIterations(ref b3SharedMemoryCommandHandle__ commandHandle, int numSolverIterations) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetNumSolverIterations")] +public static extern int b3PhysicsParamSetNumSolverIterations(System.IntPtr commandHandle, int numSolverIterations) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///filterMode: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetCollisionFilterMode")] -public static extern int b3PhysicsParamSetCollisionFilterMode(ref b3SharedMemoryCommandHandle__ commandHandle, int filterMode) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetCollisionFilterMode")] +public static extern int b3PhysicsParamSetCollisionFilterMode(System.IntPtr commandHandle, int filterMode) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///useSplitImpulse: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetUseSplitImpulse")] -public static extern int b3PhysicsParamSetUseSplitImpulse(ref b3SharedMemoryCommandHandle__ commandHandle, int useSplitImpulse) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetUseSplitImpulse")] +public static extern int b3PhysicsParamSetUseSplitImpulse(System.IntPtr commandHandle, int useSplitImpulse) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///splitImpulsePenetrationThreshold: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetSplitImpulsePenetrationThreshold")] -public static extern int b3PhysicsParamSetSplitImpulsePenetrationThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double splitImpulsePenetrationThreshold) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetSplitImpulsePenetrationThreshold")] +public static extern int b3PhysicsParamSetSplitImpulsePenetrationThreshold(System.IntPtr commandHandle, double splitImpulsePenetrationThreshold) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///contactBreakingThreshold: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetContactBreakingThreshold")] -public static extern int b3PhysicsParamSetContactBreakingThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double contactBreakingThreshold) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetContactBreakingThreshold")] +public static extern int b3PhysicsParamSetContactBreakingThreshold(System.IntPtr commandHandle, double contactBreakingThreshold) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///maxNumCmdPer1ms: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetMaxNumCommandsPer1ms")] -public static extern int b3PhysicsParamSetMaxNumCommandsPer1ms(ref b3SharedMemoryCommandHandle__ commandHandle, int maxNumCmdPer1ms) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetMaxNumCommandsPer1ms")] +public static extern int b3PhysicsParamSetMaxNumCommandsPer1ms(System.IntPtr commandHandle, int maxNumCmdPer1ms) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///enableFileCaching: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetEnableFileCaching")] -public static extern int b3PhysicsParamSetEnableFileCaching(ref b3SharedMemoryCommandHandle__ commandHandle, int enableFileCaching) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetEnableFileCaching")] +public static extern int b3PhysicsParamSetEnableFileCaching(System.IntPtr commandHandle, int enableFileCaching) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///restitutionVelocityThreshold: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetRestitutionVelocityThreshold")] -public static extern int b3PhysicsParamSetRestitutionVelocityThreshold(ref b3SharedMemoryCommandHandle__ commandHandle, double restitutionVelocityThreshold) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetRestitutionVelocityThreshold")] +public static extern int b3PhysicsParamSetRestitutionVelocityThreshold(System.IntPtr commandHandle, double restitutionVelocityThreshold) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///flags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PhysicsParamSetInternalSimFlags")] -public static extern int b3PhysicsParamSetInternalSimFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PhysicsParamSetInternalSimFlags")] +public static extern int b3PhysicsParamSetInternalSimFlags(System.IntPtr commandHandle, int flags) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitStepSimulationCommand")] -public static extern System.IntPtr b3InitStepSimulationCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitStepSimulationCommand")] +public static extern System.IntPtr b3InitStepSimulationCommand(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InitResetSimulationCommand")] -public static extern System.IntPtr b3InitResetSimulationCommand(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InitResetSimulationCommand")] +public static extern System.IntPtr b3InitResetSimulationCommand(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///urdfFileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandInit")] -public static extern System.IntPtr b3LoadUrdfCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string urdfFileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandInit")] +public static extern System.IntPtr b3LoadUrdfCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string urdfFileName) ; /// Return Type: int @@ -2193,8 +2174,8 @@ public static extern System.IntPtr b3LoadUrdfCommandInit(ref b3PhysicsClientHan ///startPosX: double ///startPosY: double ///startPosZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetStartPosition")] -public static extern int b3LoadUrdfCommandSetStartPosition(ref b3SharedMemoryCommandHandle__ commandHandle, double startPosX, double startPosY, double startPosZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandSetStartPosition")] +public static extern int b3LoadUrdfCommandSetStartPosition(System.IntPtr commandHandle, double startPosX, double startPosY, double startPosZ) ; /// Return Type: int @@ -2203,64 +2184,64 @@ public static extern int b3LoadUrdfCommandSetStartPosition(ref b3SharedMemoryCo ///startOrnY: double ///startOrnZ: double ///startOrnW: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetStartOrientation")] -public static extern int b3LoadUrdfCommandSetStartOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandSetStartOrientation")] +public static extern int b3LoadUrdfCommandSetStartOrientation(System.IntPtr commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///useMultiBody: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetUseMultiBody")] -public static extern int b3LoadUrdfCommandSetUseMultiBody(ref b3SharedMemoryCommandHandle__ commandHandle, int useMultiBody) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandSetUseMultiBody")] +public static extern int b3LoadUrdfCommandSetUseMultiBody(System.IntPtr commandHandle, int useMultiBody) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///useFixedBase: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetUseFixedBase")] -public static extern int b3LoadUrdfCommandSetUseFixedBase(ref b3SharedMemoryCommandHandle__ commandHandle, int useFixedBase) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandSetUseFixedBase")] +public static extern int b3LoadUrdfCommandSetUseFixedBase(System.IntPtr commandHandle, int useFixedBase) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///flags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetFlags")] -public static extern int b3LoadUrdfCommandSetFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandSetFlags")] +public static extern int b3LoadUrdfCommandSetFlags(System.IntPtr commandHandle, int flags) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///globalScaling: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadUrdfCommandSetGlobalScaling")] -public static extern int b3LoadUrdfCommandSetGlobalScaling(ref b3SharedMemoryCommandHandle__ commandHandle, double globalScaling) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadUrdfCommandSetGlobalScaling")] +public static extern int b3LoadUrdfCommandSetGlobalScaling(System.IntPtr commandHandle, double globalScaling) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///fileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBulletCommandInit")] -public static extern System.IntPtr b3LoadBulletCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadBulletCommandInit")] +public static extern System.IntPtr b3LoadBulletCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///fileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SaveBulletCommandInit")] -public static extern System.IntPtr b3SaveBulletCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SaveBulletCommandInit")] +public static extern System.IntPtr b3SaveBulletCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///fileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadMJCFCommandInit")] -public static extern System.IntPtr b3LoadMJCFCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadMJCFCommandInit")] +public static extern System.IntPtr b3LoadMJCFCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///flags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadMJCFCommandSetFlags")] -public static extern void b3LoadMJCFCommandSetFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int flags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadMJCFCommandSetFlags")] +public static extern void b3LoadMJCFCommandSetFlags(System.IntPtr commandHandle, int flags) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2269,8 +2250,8 @@ public static extern void b3LoadMJCFCommandSetFlags(ref b3SharedMemoryCommandHa ///jointPositionsQ: double* ///jointVelocitiesQdot: double* ///jointAccelerations: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseDynamicsCommandInit")] -public static extern System.IntPtr b3CalculateInverseDynamicsCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex, ref double jointPositionsQ, ref double jointVelocitiesQdot, ref double jointAccelerations) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseDynamicsCommandInit")] +public static extern System.IntPtr b3CalculateInverseDynamicsCommandInit(System.IntPtr physClient, int bodyIndex, ref double jointPositionsQ, ref double jointVelocitiesQdot, ref double jointAccelerations) ; /// Return Type: int @@ -2278,8 +2259,8 @@ public static extern System.IntPtr b3CalculateInverseDynamicsCommandInit(ref b3 ///bodyUniqueId: int* ///dofCount: int* ///jointForces: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusInverseDynamicsJointForces")] -public static extern int b3GetStatusInverseDynamicsJointForces(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyUniqueId, ref int dofCount, ref double jointForces) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusInverseDynamicsJointForces")] +public static extern int b3GetStatusInverseDynamicsJointForces(System.IntPtr statusHandle, ref int bodyUniqueId, ref int dofCount, ref double jointForces) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2290,31 +2271,31 @@ public static extern int b3GetStatusInverseDynamicsJointForces(ref b3SharedMemo ///jointPositionsQ: double* ///jointVelocitiesQdot: double* ///jointAccelerations: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateJacobianCommandInit")] -public static extern System.IntPtr b3CalculateJacobianCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex, int linkIndex, ref double localPosition, ref double jointPositionsQ, ref double jointVelocitiesQdot, ref double jointAccelerations) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateJacobianCommandInit")] +public static extern System.IntPtr b3CalculateJacobianCommandInit(System.IntPtr physClient, int bodyIndex, int linkIndex, ref double localPosition, ref double jointPositionsQ, ref double jointVelocitiesQdot, ref double jointAccelerations) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///linearJacobian: double* ///angularJacobian: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusJacobian")] -public static extern int b3GetStatusJacobian(ref b3SharedMemoryStatusHandle__ statusHandle, ref double linearJacobian, ref double angularJacobian) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusJacobian")] +public static extern int b3GetStatusJacobian(System.IntPtr statusHandle, ref double linearJacobian, ref double angularJacobian) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsCommandInit")] -public static extern System.IntPtr b3CalculateInverseKinematicsCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseKinematicsCommandInit")] +public static extern System.IntPtr b3CalculateInverseKinematicsCommandInit(System.IntPtr physClient, int bodyIndex) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///endEffectorLinkIndex: int ///targetPosition: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsAddTargetPurePosition")] -public static extern void b3CalculateInverseKinematicsAddTargetPurePosition(ref b3SharedMemoryCommandHandle__ commandHandle, int endEffectorLinkIndex, ref double targetPosition) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseKinematicsAddTargetPurePosition")] +public static extern void b3CalculateInverseKinematicsAddTargetPurePosition(System.IntPtr commandHandle, int endEffectorLinkIndex, ref double targetPosition) ; /// Return Type: void @@ -2322,8 +2303,8 @@ public static extern void b3CalculateInverseKinematicsAddTargetPurePosition(ref ///endEffectorLinkIndex: int ///targetPosition: double* ///targetOrientation: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsAddTargetPositionWithOrientation")] -public static extern void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, int endEffectorLinkIndex, ref double targetPosition, ref double targetOrientation) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseKinematicsAddTargetPositionWithOrientation")] +public static extern void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(System.IntPtr commandHandle, int endEffectorLinkIndex, ref double targetPosition, ref double targetOrientation) ; /// Return Type: void @@ -2335,8 +2316,8 @@ public static extern void b3CalculateInverseKinematicsAddTargetPositionWithOrie ///upperLimit: double* ///jointRange: double* ///restPose: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsPosWithNullSpaceVel")] -public static extern void b3CalculateInverseKinematicsPosWithNullSpaceVel(ref b3SharedMemoryCommandHandle__ commandHandle, int numDof, int endEffectorLinkIndex, ref double targetPosition, ref double lowerLimit, ref double upperLimit, ref double jointRange, ref double restPose) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseKinematicsPosWithNullSpaceVel")] +public static extern void b3CalculateInverseKinematicsPosWithNullSpaceVel(System.IntPtr commandHandle, int numDof, int endEffectorLinkIndex, ref double targetPosition, ref double lowerLimit, ref double upperLimit, ref double jointRange, ref double restPose) ; /// Return Type: void @@ -2349,16 +2330,16 @@ public static extern void b3CalculateInverseKinematicsPosWithNullSpaceVel(ref b ///upperLimit: double* ///jointRange: double* ///restPose: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsPosOrnWithNullSpaceVel")] -public static extern void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(ref b3SharedMemoryCommandHandle__ commandHandle, int numDof, int endEffectorLinkIndex, ref double targetPosition, ref double targetOrientation, ref double lowerLimit, ref double upperLimit, ref double jointRange, ref double restPose) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseKinematicsPosOrnWithNullSpaceVel")] +public static extern void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(System.IntPtr commandHandle, int numDof, int endEffectorLinkIndex, ref double targetPosition, ref double targetOrientation, ref double lowerLimit, ref double upperLimit, ref double jointRange, ref double restPose) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///numDof: int ///jointDampingCoeff: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CalculateInverseKinematicsSetJointDamping")] -public static extern void b3CalculateInverseKinematicsSetJointDamping(ref b3SharedMemoryCommandHandle__ commandHandle, int numDof, ref double jointDampingCoeff) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CalculateInverseKinematicsSetJointDamping")] +public static extern void b3CalculateInverseKinematicsSetJointDamping(System.IntPtr commandHandle, int numDof, ref double jointDampingCoeff) ; /// Return Type: int @@ -2366,159 +2347,159 @@ public static extern void b3CalculateInverseKinematicsSetJointDamping(ref b3Sha ///bodyUniqueId: int* ///dofCount: int* ///jointPositions: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusInverseKinematicsJointPositions")] -public static extern int b3GetStatusInverseKinematicsJointPositions(ref b3SharedMemoryStatusHandle__ statusHandle, ref int bodyUniqueId, ref int dofCount, ref double jointPositions) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusInverseKinematicsJointPositions")] +public static extern int b3GetStatusInverseKinematicsJointPositions(System.IntPtr statusHandle, ref int bodyUniqueId, ref int dofCount, ref double jointPositions) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///sdfFileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadSdfCommandInit")] -public static extern System.IntPtr b3LoadSdfCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string sdfFileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadSdfCommandInit")] +public static extern System.IntPtr b3LoadSdfCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string sdfFileName) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///useMultiBody: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadSdfCommandSetUseMultiBody")] -public static extern int b3LoadSdfCommandSetUseMultiBody(ref b3SharedMemoryCommandHandle__ commandHandle, int useMultiBody) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadSdfCommandSetUseMultiBody")] +public static extern int b3LoadSdfCommandSetUseMultiBody(System.IntPtr commandHandle, int useMultiBody) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///globalScaling: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadSdfCommandSetUseGlobalScaling")] -public static extern int b3LoadSdfCommandSetUseGlobalScaling(ref b3SharedMemoryCommandHandle__ commandHandle, double globalScaling) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadSdfCommandSetUseGlobalScaling")] +public static extern int b3LoadSdfCommandSetUseGlobalScaling(System.IntPtr commandHandle, double globalScaling) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///sdfFileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SaveWorldCommandInit")] -public static extern System.IntPtr b3SaveWorldCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string sdfFileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SaveWorldCommandInit")] +public static extern System.IntPtr b3SaveWorldCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string sdfFileName) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///controlMode: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlCommandInit")] -public static extern System.IntPtr b3JointControlCommandInit(ref b3PhysicsClientHandle__ physClient, int controlMode) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlCommandInit")] +public static extern System.IntPtr b3JointControlCommandInit(System.IntPtr physClient, int controlMode) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int ///controlMode: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlCommandInit2")] -public static extern System.IntPtr b3JointControlCommandInit2(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId, int controlMode) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlCommandInit2")] +public static extern System.IntPtr b3JointControlCommandInit2(System.IntPtr physClient, int bodyUniqueId, int controlMode) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///qIndex: int ///value: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetDesiredPosition")] -public static extern int b3JointControlSetDesiredPosition(ref b3SharedMemoryCommandHandle__ commandHandle, int qIndex, double value) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlSetDesiredPosition")] +public static extern int b3JointControlSetDesiredPosition(System.IntPtr commandHandle, int qIndex, double value) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///dofIndex: int ///value: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetKp")] -public static extern int b3JointControlSetKp(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlSetKp")] +public static extern int b3JointControlSetKp(System.IntPtr commandHandle, int dofIndex, double value) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///dofIndex: int ///value: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetKd")] -public static extern int b3JointControlSetKd(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlSetKd")] +public static extern int b3JointControlSetKd(System.IntPtr commandHandle, int dofIndex, double value) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///dofIndex: int ///value: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetDesiredVelocity")] -public static extern int b3JointControlSetDesiredVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlSetDesiredVelocity")] +public static extern int b3JointControlSetDesiredVelocity(System.IntPtr commandHandle, int dofIndex, double value) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///dofIndex: int ///value: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetMaximumForce")] -public static extern int b3JointControlSetMaximumForce(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlSetMaximumForce")] +public static extern int b3JointControlSetMaximumForce(System.IntPtr commandHandle, int dofIndex, double value) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///dofIndex: int ///value: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3JointControlSetDesiredForceTorque")] -public static extern int b3JointControlSetDesiredForceTorque(ref b3SharedMemoryCommandHandle__ commandHandle, int dofIndex, double value) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3JointControlSetDesiredForceTorque")] +public static extern int b3JointControlSetDesiredForceTorque(System.IntPtr commandHandle, int dofIndex, double value) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeCommandInit")] -public static extern System.IntPtr b3CreateCollisionShapeCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeCommandInit")] +public static extern System.IntPtr b3CreateCollisionShapeCommandInit(System.IntPtr physClient) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///radius: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddSphere")] -public static extern int b3CreateCollisionShapeAddSphere(ref b3SharedMemoryCommandHandle__ commandHandle, double radius) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeAddSphere")] +public static extern int b3CreateCollisionShapeAddSphere(System.IntPtr commandHandle, double radius) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///halfExtents: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddBox")] -public static extern int b3CreateCollisionShapeAddBox(ref b3SharedMemoryCommandHandle__ commandHandle, ref double halfExtents) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeAddBox")] +public static extern int b3CreateCollisionShapeAddBox(System.IntPtr commandHandle, ref double halfExtents) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///radius: double ///height: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddCapsule")] -public static extern int b3CreateCollisionShapeAddCapsule(ref b3SharedMemoryCommandHandle__ commandHandle, double radius, double height) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeAddCapsule")] +public static extern int b3CreateCollisionShapeAddCapsule(System.IntPtr commandHandle, double radius, double height) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///radius: double ///height: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddCylinder")] -public static extern int b3CreateCollisionShapeAddCylinder(ref b3SharedMemoryCommandHandle__ commandHandle, double radius, double height) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeAddCylinder")] +public static extern int b3CreateCollisionShapeAddCylinder(System.IntPtr commandHandle, double radius, double height) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///planeNormal: double* ///planeConstant: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddPlane")] -public static extern int b3CreateCollisionShapeAddPlane(ref b3SharedMemoryCommandHandle__ commandHandle, ref double planeNormal, double planeConstant) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeAddPlane")] +public static extern int b3CreateCollisionShapeAddPlane(System.IntPtr commandHandle, ref double planeNormal, double planeConstant) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///fileName: char* ///meshScale: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeAddMesh")] -public static extern int b3CreateCollisionShapeAddMesh(ref b3SharedMemoryCommandHandle__ commandHandle, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName, ref double meshScale) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeAddMesh")] +public static extern int b3CreateCollisionShapeAddMesh(System.IntPtr commandHandle, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName, ref double meshScale) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///shapeIndex: int ///flags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionSetFlag")] -public static extern void b3CreateCollisionSetFlag(ref b3SharedMemoryCommandHandle__ commandHandle, int shapeIndex, int flags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionSetFlag")] +public static extern void b3CreateCollisionSetFlag(System.IntPtr commandHandle, int shapeIndex, int flags) ; /// Return Type: void @@ -2526,32 +2507,32 @@ public static extern void b3CreateCollisionSetFlag(ref b3SharedMemoryCommandHan ///shapeIndex: int ///childPosition: double* ///childOrientation: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateCollisionShapeSetChildTransform")] -public static extern void b3CreateCollisionShapeSetChildTransform(ref b3SharedMemoryCommandHandle__ commandHandle, int shapeIndex, ref double childPosition, ref double childOrientation) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateCollisionShapeSetChildTransform")] +public static extern void b3CreateCollisionShapeSetChildTransform(System.IntPtr commandHandle, int shapeIndex, ref double childPosition, ref double childOrientation) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusCollisionShapeUniqueId")] -public static extern int b3GetStatusCollisionShapeUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusCollisionShapeUniqueId")] +public static extern int b3GetStatusCollisionShapeUniqueId(System.IntPtr statusHandle) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateVisualShapeCommandInit")] -public static extern System.IntPtr b3CreateVisualShapeCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateVisualShapeCommandInit")] +public static extern System.IntPtr b3CreateVisualShapeCommandInit(System.IntPtr physClient) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusVisualShapeUniqueId")] -public static extern int b3GetStatusVisualShapeUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusVisualShapeUniqueId")] +public static extern int b3GetStatusVisualShapeUniqueId(System.IntPtr statusHandle) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyCommandInit")] -public static extern System.IntPtr b3CreateMultiBodyCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateMultiBodyCommandInit")] +public static extern System.IntPtr b3CreateMultiBodyCommandInit(System.IntPtr physClient) ; /// Return Type: int @@ -2563,8 +2544,8 @@ public static extern System.IntPtr b3CreateMultiBodyCommandInit(ref b3PhysicsCl ///baseOrientation: double* ///baseInertialFramePosition: double* ///baseInertialFrameOrientation: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyBase")] -public static extern int b3CreateMultiBodyBase(ref b3SharedMemoryCommandHandle__ commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, ref double basePosition, ref double baseOrientation, ref double baseInertialFramePosition, ref double baseInertialFrameOrientation) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateMultiBodyBase")] +public static extern int b3CreateMultiBodyBase(System.IntPtr commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, ref double basePosition, ref double baseOrientation, ref double baseInertialFramePosition, ref double baseInertialFrameOrientation) ; /// Return Type: int @@ -2579,20 +2560,20 @@ public static extern int b3CreateMultiBodyBase(ref b3SharedMemoryCommandHandle_ ///linkParentIndex: int ///linkJointType: int ///linkJointAxis: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyLink")] -public static extern int b3CreateMultiBodyLink(ref b3SharedMemoryCommandHandle__ commandHandle, double linkMass, double linkCollisionShapeIndex, double linkVisualShapeIndex, ref double linkPosition, ref double linkOrientation, ref double linkInertialFramePosition, ref double linkInertialFrameOrientation, int linkParentIndex, int linkJointType, ref double linkJointAxis) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateMultiBodyLink")] +public static extern int b3CreateMultiBodyLink(System.IntPtr commandHandle, double linkMass, double linkCollisionShapeIndex, double linkVisualShapeIndex, ref double linkPosition, ref double linkOrientation, ref double linkInertialFramePosition, ref double linkInertialFrameOrientation, int linkParentIndex, int linkJointType, ref double linkJointAxis) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateMultiBodyUseMaximalCoordinates")] -public static extern void b3CreateMultiBodyUseMaximalCoordinates(ref b3SharedMemoryCommandHandle__ commandHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateMultiBodyUseMaximalCoordinates")] +public static extern void b3CreateMultiBodyUseMaximalCoordinates(System.IntPtr commandHandle) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxShapeCommandInit")] -public static extern System.IntPtr b3CreateBoxShapeCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxShapeCommandInit")] +public static extern System.IntPtr b3CreateBoxShapeCommandInit(System.IntPtr physClient) ; /// Return Type: int @@ -2600,8 +2581,8 @@ public static extern System.IntPtr b3CreateBoxShapeCommandInit(ref b3PhysicsCli ///startPosX: double ///startPosY: double ///startPosZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetStartPosition")] -public static extern int b3CreateBoxCommandSetStartPosition(ref b3SharedMemoryCommandHandle__ commandHandle, double startPosX, double startPosY, double startPosZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxCommandSetStartPosition")] +public static extern int b3CreateBoxCommandSetStartPosition(System.IntPtr commandHandle, double startPosX, double startPosY, double startPosZ) ; /// Return Type: int @@ -2610,8 +2591,8 @@ public static extern int b3CreateBoxCommandSetStartPosition(ref b3SharedMemoryC ///startOrnY: double ///startOrnZ: double ///startOrnW: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetStartOrientation")] -public static extern int b3CreateBoxCommandSetStartOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxCommandSetStartOrientation")] +public static extern int b3CreateBoxCommandSetStartOrientation(System.IntPtr commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; /// Return Type: int @@ -2619,22 +2600,22 @@ public static extern int b3CreateBoxCommandSetStartOrientation(ref b3SharedMemo ///halfExtentsX: double ///halfExtentsY: double ///halfExtentsZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetHalfExtents")] -public static extern int b3CreateBoxCommandSetHalfExtents(ref b3SharedMemoryCommandHandle__ commandHandle, double halfExtentsX, double halfExtentsY, double halfExtentsZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxCommandSetHalfExtents")] +public static extern int b3CreateBoxCommandSetHalfExtents(System.IntPtr commandHandle, double halfExtentsX, double halfExtentsY, double halfExtentsZ) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///mass: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetMass")] -public static extern int b3CreateBoxCommandSetMass(ref b3SharedMemoryCommandHandle__ commandHandle, double mass) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxCommandSetMass")] +public static extern int b3CreateBoxCommandSetMass(System.IntPtr commandHandle, double mass) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///collisionShapeType: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetCollisionShapeType")] -public static extern int b3CreateBoxCommandSetCollisionShapeType(ref b3SharedMemoryCommandHandle__ commandHandle, int collisionShapeType) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxCommandSetCollisionShapeType")] +public static extern int b3CreateBoxCommandSetCollisionShapeType(System.IntPtr commandHandle, int collisionShapeType) ; /// Return Type: int @@ -2643,15 +2624,15 @@ public static extern int b3CreateBoxCommandSetCollisionShapeType(ref b3SharedMe ///green: double ///blue: double ///alpha: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateBoxCommandSetColorRGBA")] -public static extern int b3CreateBoxCommandSetColorRGBA(ref b3SharedMemoryCommandHandle__ commandHandle, double red, double green, double blue, double alpha) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateBoxCommandSetColorRGBA")] +public static extern int b3CreateBoxCommandSetColorRGBA(System.IntPtr commandHandle, double red, double green, double blue, double alpha) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyIndex: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandInit")] -public static extern System.IntPtr b3CreatePoseCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyIndex) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandInit")] +public static extern System.IntPtr b3CreatePoseCommandInit(System.IntPtr physClient, int bodyIndex) ; /// Return Type: int @@ -2659,8 +2640,8 @@ public static extern System.IntPtr b3CreatePoseCommandInit(ref b3PhysicsClientH ///startPosX: double ///startPosY: double ///startPosZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBasePosition")] -public static extern int b3CreatePoseCommandSetBasePosition(ref b3SharedMemoryCommandHandle__ commandHandle, double startPosX, double startPosY, double startPosZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetBasePosition")] +public static extern int b3CreatePoseCommandSetBasePosition(System.IntPtr commandHandle, double startPosX, double startPosY, double startPosZ) ; /// Return Type: int @@ -2669,30 +2650,30 @@ public static extern int b3CreatePoseCommandSetBasePosition(ref b3SharedMemoryC ///startOrnY: double ///startOrnZ: double ///startOrnW: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBaseOrientation")] -public static extern int b3CreatePoseCommandSetBaseOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetBaseOrientation")] +public static extern int b3CreatePoseCommandSetBaseOrientation(System.IntPtr commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linVel: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBaseLinearVelocity")] -public static extern int b3CreatePoseCommandSetBaseLinearVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, ref double linVel) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetBaseLinearVelocity")] +public static extern int b3CreatePoseCommandSetBaseLinearVelocity(System.IntPtr commandHandle, ref double linVel) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///angVel: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetBaseAngularVelocity")] -public static extern int b3CreatePoseCommandSetBaseAngularVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, ref double angVel) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetBaseAngularVelocity")] +public static extern int b3CreatePoseCommandSetBaseAngularVelocity(System.IntPtr commandHandle, ref double angVel) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///numJointPositions: int ///jointPositions: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointPositions")] -public static extern int b3CreatePoseCommandSetJointPositions(ref b3SharedMemoryCommandHandle__ commandHandle, int numJointPositions, ref double jointPositions) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetJointPositions")] +public static extern int b3CreatePoseCommandSetJointPositions(System.IntPtr commandHandle, int numJointPositions, ref double jointPositions) ; /// Return Type: int @@ -2700,8 +2681,8 @@ public static extern int b3CreatePoseCommandSetJointPositions(ref b3SharedMemor ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///jointIndex: int ///jointPosition: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointPosition")] -public static extern int b3CreatePoseCommandSetJointPosition(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle, int jointIndex, double jointPosition) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetJointPosition")] +public static extern int b3CreatePoseCommandSetJointPosition(System.IntPtr physClient, System.IntPtr commandHandle, int jointIndex, double jointPosition) ; /// Return Type: int @@ -2709,8 +2690,8 @@ public static extern int b3CreatePoseCommandSetJointPosition(ref b3PhysicsClien ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///numJointVelocities: int ///jointVelocities: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointVelocities")] -public static extern int b3CreatePoseCommandSetJointVelocities(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle, int numJointVelocities, ref double jointVelocities) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetJointVelocities")] +public static extern int b3CreatePoseCommandSetJointVelocities(System.IntPtr physClient, System.IntPtr commandHandle, int numJointVelocities, ref double jointVelocities) ; /// Return Type: int @@ -2718,45 +2699,45 @@ public static extern int b3CreatePoseCommandSetJointVelocities(ref b3PhysicsCli ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///jointIndex: int ///jointVelocity: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreatePoseCommandSetJointVelocity")] -public static extern int b3CreatePoseCommandSetJointVelocity(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryCommandHandle__ commandHandle, int jointIndex, double jointVelocity) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreatePoseCommandSetJointVelocity")] +public static extern int b3CreatePoseCommandSetJointVelocity(System.IntPtr physClient, System.IntPtr commandHandle, int jointIndex, double jointVelocity) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateSensorCommandInit")] -public static extern System.IntPtr b3CreateSensorCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateSensorCommandInit")] +public static extern System.IntPtr b3CreateSensorCommandInit(System.IntPtr physClient, int bodyUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///jointIndex: int ///enable: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateSensorEnable6DofJointForceTorqueSensor")] -public static extern int b3CreateSensorEnable6DofJointForceTorqueSensor(ref b3SharedMemoryCommandHandle__ commandHandle, int jointIndex, int enable) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateSensorEnable6DofJointForceTorqueSensor")] +public static extern int b3CreateSensorEnable6DofJointForceTorqueSensor(System.IntPtr commandHandle, int jointIndex, int enable) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndex: int ///enable: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateSensorEnableIMUForLink")] -public static extern int b3CreateSensorEnableIMUForLink(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndex, int enable) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateSensorEnableIMUForLink")] +public static extern int b3CreateSensorEnableIMUForLink(System.IntPtr commandHandle, int linkIndex, int enable) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///bodyUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestActualStateCommandInit")] -public static extern System.IntPtr b3RequestActualStateCommandInit(ref b3PhysicsClientHandle__ physClient, int bodyUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestActualStateCommandInit")] +public static extern System.IntPtr b3RequestActualStateCommandInit(System.IntPtr physClient, int bodyUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///computeLinkVelocity: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestActualStateCommandComputeLinkVelocity")] -public static extern int b3RequestActualStateCommandComputeLinkVelocity(ref b3SharedMemoryCommandHandle__ commandHandle, int computeLinkVelocity) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestActualStateCommandComputeLinkVelocity")] +public static extern int b3RequestActualStateCommandComputeLinkVelocity(System.IntPtr commandHandle, int computeLinkVelocity) ; /// Return Type: int @@ -2764,8 +2745,8 @@ public static extern int b3RequestActualStateCommandComputeLinkVelocity(ref b3S ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///jointIndex: int ///state: b3JointSensorState* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetJointState")] -public static extern int b3GetJointState(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryStatusHandle__ statusHandle, int jointIndex, ref b3JointSensorState state) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetJointState")] +public static extern int b3GetJointState(System.IntPtr physClient, System.IntPtr statusHandle, int jointIndex, ref b3JointSensorState state) ; /// Return Type: int @@ -2773,8 +2754,8 @@ public static extern int b3GetJointState(ref b3PhysicsClientHandle__ physClient ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* ///linkIndex: int ///state: b3LinkState* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetLinkState")] -public static extern int b3GetLinkState(ref b3PhysicsClientHandle__ physClient, ref b3SharedMemoryStatusHandle__ statusHandle, int linkIndex, ref b3LinkState state) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetLinkState")] +public static extern int b3GetLinkState(System.IntPtr physClient, System.IntPtr statusHandle, int linkIndex, ref b3LinkState state) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2785,8 +2766,8 @@ public static extern int b3GetLinkState(ref b3PhysicsClientHandle__ physClient, ///rayToWorldX: double ///rayToWorldY: double ///rayToWorldZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3PickBody")] -public static extern System.IntPtr b3PickBody(ref b3PhysicsClientHandle__ physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3PickBody")] +public static extern System.IntPtr b3PickBody(System.IntPtr physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2797,14 +2778,14 @@ public static extern System.IntPtr b3PickBody(ref b3PhysicsClientHandle__ physC ///rayToWorldX: double ///rayToWorldY: double ///rayToWorldZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3MovePickedBody")] -public static extern System.IntPtr b3MovePickedBody(ref b3PhysicsClientHandle__ physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3MovePickedBody")] +public static extern System.IntPtr b3MovePickedBody(System.IntPtr physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RemovePickingConstraint")] -public static extern System.IntPtr b3RemovePickingConstraint(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RemovePickingConstraint")] +public static extern System.IntPtr b3RemovePickingConstraint(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* @@ -2815,35 +2796,35 @@ public static extern System.IntPtr b3RemovePickingConstraint(ref b3PhysicsClien ///rayToWorldX: double ///rayToWorldY: double ///rayToWorldZ: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateRaycastCommandInit")] -public static extern System.IntPtr b3CreateRaycastCommandInit(ref b3PhysicsClientHandle__ physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateRaycastCommandInit")] +public static extern System.IntPtr b3CreateRaycastCommandInit(System.IntPtr physClient, double rayFromWorldX, double rayFromWorldY, double rayFromWorldZ, double rayToWorldX, double rayToWorldY, double rayToWorldZ) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3CreateRaycastBatchCommandInit")] -public static extern System.IntPtr b3CreateRaycastBatchCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3CreateRaycastBatchCommandInit")] +public static extern System.IntPtr b3CreateRaycastBatchCommandInit(System.IntPtr physClient) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///rayFromWorld: double* ///rayToWorld: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RaycastBatchAddRay")] -public static extern void b3RaycastBatchAddRay(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rayFromWorld, ref double rayToWorld) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RaycastBatchAddRay")] +public static extern void b3RaycastBatchAddRay(System.IntPtr commandHandle, ref double rayFromWorld, ref double rayToWorld) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///raycastInfo: b3RaycastInformation* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetRaycastInformation")] -public static extern void b3GetRaycastInformation(ref b3PhysicsClientHandle__ physClient, ref b3RaycastInformation raycastInfo) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetRaycastInformation")] +public static extern void b3GetRaycastInformation(System.IntPtr physClient, ref b3RaycastInformation raycastInfo) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ApplyExternalForceCommandInit")] -public static extern System.IntPtr b3ApplyExternalForceCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ApplyExternalForceCommandInit")] +public static extern System.IntPtr b3ApplyExternalForceCommandInit(System.IntPtr physClient) ; /// Return Type: void @@ -2853,8 +2834,8 @@ public static extern System.IntPtr b3ApplyExternalForceCommandInit(ref b3Physic ///force: double* ///position: double* ///flags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ApplyExternalForce")] -public static extern void b3ApplyExternalForce(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkId, ref double force, ref double position, int flags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ApplyExternalForce")] +public static extern void b3ApplyExternalForce(System.IntPtr commandHandle, int bodyUniqueId, int linkId, ref double force, ref double position, int flags) ; /// Return Type: void @@ -2863,232 +2844,232 @@ public static extern void b3ApplyExternalForce(ref b3SharedMemoryCommandHandle_ ///linkId: int ///torque: double* ///flags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ApplyExternalTorque")] -public static extern void b3ApplyExternalTorque(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyUniqueId, int linkId, ref double torque, int flags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ApplyExternalTorque")] +public static extern void b3ApplyExternalTorque(System.IntPtr commandHandle, int bodyUniqueId, int linkId, ref double torque, int flags) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnyCommandInit")] -public static extern System.IntPtr b3LoadBunnyCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadBunnyCommandInit")] +public static extern System.IntPtr b3LoadBunnyCommandInit(System.IntPtr physClient) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///scale: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnySetScale")] -public static extern int b3LoadBunnySetScale(ref b3SharedMemoryCommandHandle__ commandHandle, double scale) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadBunnySetScale")] +public static extern int b3LoadBunnySetScale(System.IntPtr commandHandle, double scale) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///mass: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnySetMass")] -public static extern int b3LoadBunnySetMass(ref b3SharedMemoryCommandHandle__ commandHandle, double mass) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadBunnySetMass")] +public static extern int b3LoadBunnySetMass(System.IntPtr commandHandle, double mass) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///collisionMargin: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3LoadBunnySetCollisionMargin")] -public static extern int b3LoadBunnySetCollisionMargin(ref b3SharedMemoryCommandHandle__ commandHandle, double collisionMargin) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3LoadBunnySetCollisionMargin")] +public static extern int b3LoadBunnySetCollisionMargin(System.IntPtr commandHandle, double collisionMargin) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestVREventsCommandInit")] -public static extern System.IntPtr b3RequestVREventsCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestVREventsCommandInit")] +public static extern System.IntPtr b3RequestVREventsCommandInit(System.IntPtr physClient) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///deviceTypeFilter: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3VREventsSetDeviceTypeFilter")] -public static extern void b3VREventsSetDeviceTypeFilter(ref b3SharedMemoryCommandHandle__ commandHandle, int deviceTypeFilter) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3VREventsSetDeviceTypeFilter")] +public static extern void b3VREventsSetDeviceTypeFilter(System.IntPtr commandHandle, int deviceTypeFilter) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///vrEventsData: b3VREventsData* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetVREventsData")] -public static extern void b3GetVREventsData(ref b3PhysicsClientHandle__ physClient, ref b3VREventsData vrEventsData) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetVREventsData")] +public static extern void b3GetVREventsData(System.IntPtr physClient, ref b3VREventsData vrEventsData) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraStateCommandInit")] -public static extern System.IntPtr b3SetVRCameraStateCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetVRCameraStateCommandInit")] +public static extern System.IntPtr b3SetVRCameraStateCommandInit(System.IntPtr physClient) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///rootPos: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraRootPosition")] -public static extern int b3SetVRCameraRootPosition(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rootPos) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetVRCameraRootPosition")] +public static extern int b3SetVRCameraRootPosition(System.IntPtr commandHandle, ref double rootPos) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///rootOrn: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraRootOrientation")] -public static extern int b3SetVRCameraRootOrientation(ref b3SharedMemoryCommandHandle__ commandHandle, ref double rootOrn) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetVRCameraRootOrientation")] +public static extern int b3SetVRCameraRootOrientation(System.IntPtr commandHandle, ref double rootOrn) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///objectUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraTrackingObject")] -public static extern int b3SetVRCameraTrackingObject(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetVRCameraTrackingObject")] +public static extern int b3SetVRCameraTrackingObject(System.IntPtr commandHandle, int objectUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///flag: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetVRCameraTrackingObjectFlag")] -public static extern int b3SetVRCameraTrackingObjectFlag(ref b3SharedMemoryCommandHandle__ commandHandle, int flag) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetVRCameraTrackingObjectFlag")] +public static extern int b3SetVRCameraTrackingObjectFlag(System.IntPtr commandHandle, int flag) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestKeyboardEventsCommandInit")] -public static extern System.IntPtr b3RequestKeyboardEventsCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestKeyboardEventsCommandInit")] +public static extern System.IntPtr b3RequestKeyboardEventsCommandInit(System.IntPtr physClient) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///keyboardEventsData: b3KeyboardEventsData* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetKeyboardEventsData")] -public static extern void b3GetKeyboardEventsData(ref b3PhysicsClientHandle__ physClient, ref b3KeyboardEventsData keyboardEventsData) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetKeyboardEventsData")] +public static extern void b3GetKeyboardEventsData(System.IntPtr physClient, ref b3KeyboardEventsData keyboardEventsData) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3RequestMouseEventsCommandInit")] -public static extern System.IntPtr b3RequestMouseEventsCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3RequestMouseEventsCommandInit")] +public static extern System.IntPtr b3RequestMouseEventsCommandInit(System.IntPtr physClient) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///mouseEventsData: b3MouseEventsData* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetMouseEventsData")] -public static extern void b3GetMouseEventsData(ref b3PhysicsClientHandle__ physClient, ref b3MouseEventsData mouseEventsData) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetMouseEventsData")] +public static extern void b3GetMouseEventsData(System.IntPtr physClient, ref b3MouseEventsData mouseEventsData) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingCommandInit")] -public static extern System.IntPtr b3StateLoggingCommandInit(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingCommandInit")] +public static extern System.IntPtr b3StateLoggingCommandInit(System.IntPtr physClient) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///loggingType: int ///fileName: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingStart")] -public static extern int b3StateLoggingStart(ref b3SharedMemoryCommandHandle__ commandHandle, int loggingType, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingStart")] +public static extern int b3StateLoggingStart(System.IntPtr commandHandle, int loggingType, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string fileName) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///objectUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingAddLoggingObjectUniqueId")] -public static extern int b3StateLoggingAddLoggingObjectUniqueId(ref b3SharedMemoryCommandHandle__ commandHandle, int objectUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingAddLoggingObjectUniqueId")] +public static extern int b3StateLoggingAddLoggingObjectUniqueId(System.IntPtr commandHandle, int objectUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///maxLogDof: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetMaxLogDof")] -public static extern int b3StateLoggingSetMaxLogDof(ref b3SharedMemoryCommandHandle__ commandHandle, int maxLogDof) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetMaxLogDof")] +public static extern int b3StateLoggingSetMaxLogDof(System.IntPtr commandHandle, int maxLogDof) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndexA: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetLinkIndexA")] -public static extern int b3StateLoggingSetLinkIndexA(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexA) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetLinkIndexA")] +public static extern int b3StateLoggingSetLinkIndexA(System.IntPtr commandHandle, int linkIndexA) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///linkIndexB: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetLinkIndexB")] -public static extern int b3StateLoggingSetLinkIndexB(ref b3SharedMemoryCommandHandle__ commandHandle, int linkIndexB) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetLinkIndexB")] +public static extern int b3StateLoggingSetLinkIndexB(System.IntPtr commandHandle, int linkIndexB) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyAUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetBodyAUniqueId")] -public static extern int b3StateLoggingSetBodyAUniqueId(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyAUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetBodyAUniqueId")] +public static extern int b3StateLoggingSetBodyAUniqueId(System.IntPtr commandHandle, int bodyAUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///bodyBUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetBodyBUniqueId")] -public static extern int b3StateLoggingSetBodyBUniqueId(ref b3SharedMemoryCommandHandle__ commandHandle, int bodyBUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetBodyBUniqueId")] +public static extern int b3StateLoggingSetBodyBUniqueId(System.IntPtr commandHandle, int bodyBUniqueId) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///deviceTypeFilter: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetDeviceTypeFilter")] -public static extern int b3StateLoggingSetDeviceTypeFilter(ref b3SharedMemoryCommandHandle__ commandHandle, int deviceTypeFilter) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetDeviceTypeFilter")] +public static extern int b3StateLoggingSetDeviceTypeFilter(System.IntPtr commandHandle, int deviceTypeFilter) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///logFlags: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingSetLogFlags")] -public static extern int b3StateLoggingSetLogFlags(ref b3SharedMemoryCommandHandle__ commandHandle, int logFlags) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingSetLogFlags")] +public static extern int b3StateLoggingSetLogFlags(System.IntPtr commandHandle, int logFlags) ; /// Return Type: int ///statusHandle: b3SharedMemoryStatusHandle->b3SharedMemoryStatusHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetStatusLoggingUniqueId")] -public static extern int b3GetStatusLoggingUniqueId(ref b3SharedMemoryStatusHandle__ statusHandle) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetStatusLoggingUniqueId")] +public static extern int b3GetStatusLoggingUniqueId(System.IntPtr statusHandle) ; /// Return Type: int ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///loggingUniqueId: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3StateLoggingStop")] -public static extern int b3StateLoggingStop(ref b3SharedMemoryCommandHandle__ commandHandle, int loggingUniqueId) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3StateLoggingStop")] +public static extern int b3StateLoggingStop(System.IntPtr commandHandle, int loggingUniqueId) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///name: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3ProfileTimingCommandInit")] -public static extern System.IntPtr b3ProfileTimingCommandInit(ref b3PhysicsClientHandle__ physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string name) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3ProfileTimingCommandInit")] +public static extern System.IntPtr b3ProfileTimingCommandInit(System.IntPtr physClient, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string name) ; /// Return Type: void ///commandHandle: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///duration: int - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetProfileTimingDuractionInMicroSeconds")] -public static extern void b3SetProfileTimingDuractionInMicroSeconds(ref b3SharedMemoryCommandHandle__ commandHandle, int duration) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetProfileTimingDuractionInMicroSeconds")] +public static extern void b3SetProfileTimingDuractionInMicroSeconds(System.IntPtr commandHandle, int duration) ; /// Return Type: void ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///timeOutInSeconds: double - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetTimeOut")] -public static extern void b3SetTimeOut(ref b3PhysicsClientHandle__ physClient, double timeOutInSeconds) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetTimeOut")] +public static extern void b3SetTimeOut(System.IntPtr physClient, double timeOutInSeconds) ; /// Return Type: double ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3GetTimeOut")] -public static extern double b3GetTimeOut(ref b3PhysicsClientHandle__ physClient) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3GetTimeOut")] +public static extern double b3GetTimeOut(System.IntPtr physClient) ; /// Return Type: b3SharedMemoryCommandHandle->b3SharedMemoryCommandHandle__* ///physClient: b3PhysicsClientHandle->b3PhysicsClientHandle__* ///path: char* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3SetAdditionalSearchPath")] -public static extern System.IntPtr b3SetAdditionalSearchPath(ref b3PhysicsClientHandle__ physClient, System.IntPtr path) ; + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3SetAdditionalSearchPath")] +public static extern System.IntPtr b3SetAdditionalSearchPath(System.IntPtr physClient, System.IntPtr path) ; /// Return Type: void @@ -3098,7 +3079,7 @@ public static extern System.IntPtr b3SetAdditionalSearchPath(ref b3PhysicsClien ///ornB: double* ///outPos: double* ///outOrn: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3MultiplyTransforms")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3MultiplyTransforms")] public static extern void b3MultiplyTransforms(ref double posA, ref double ornA, ref double posB, ref double ornB, ref double outPos, ref double outOrn) ; @@ -3107,7 +3088,7 @@ public static extern void b3MultiplyTransforms(ref double posA, ref double ornA ///orn: double* ///outPos: double* ///outOrn: double* - [System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="b3InvertTransform")] + [System.Runtime.InteropServices.DllImportAttribute("pybullet_vs2010.dll", EntryPoint="b3InvertTransform")] public static extern void b3InvertTransform(ref double pos, ref double orn, ref double outPos, ref double outOrn) ; } diff --git a/setup.py b/setup.py index ecd208318..4fa65f731 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ sources = ["examples/pybullet/pybullet.c"]\ +["examples/SharedMemory/PhysicsClientUDP_C_API.cpp"]\ +["examples/SharedMemory/PhysicsClientTCP.cpp"]\ +["examples/SharedMemory/PhysicsClientTCP_C_API.cpp"]\ ++["examples/SharedMemory/b3PluginManager.cpp"]\ +["examples/Utils/b3ResourcePath.cpp"]\ +["examples/Utils/RobotLoggingUtil.cpp"]\ +["examples/Utils/ChromeTraceUtil.cpp"]\ diff --git a/test/SharedMemory/CMakeLists.txt b/test/SharedMemory/CMakeLists.txt index 542a52bb3..df2ca3459 100644 --- a/test/SharedMemory/CMakeLists.txt +++ b/test/SharedMemory/CMakeLists.txt @@ -39,6 +39,7 @@ ENDIF() ../../examples/SharedMemory/PhysicsDirectC_API.h ../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp ../../examples/SharedMemory/PhysicsServerCommandProcessor.h + ../../examples/SharedMemory/b3PluginManager.cpp ../../examples/SharedMemory/PhysicsClientSharedMemory.cpp ../../examples/SharedMemory/PhysicsClientSharedMemory.h ../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp diff --git a/test/SharedMemory/premake4.lua b/test/SharedMemory/premake4.lua index 282cc31fc..40c0d6f42 100644 --- a/test/SharedMemory/premake4.lua +++ b/test/SharedMemory/premake4.lua @@ -177,6 +177,7 @@ project ("Test_PhysicsServerLoopBack") "../../examples/SharedMemory/PhysicsServerSharedMemory.h", "../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp", "../../examples/SharedMemory/PhysicsServerCommandProcessor.h", + "../../examples/SharedMemory/b3PluginManager.cpp", "../../examples/SharedMemory/PhysicsLoopBack.cpp", "../../examples/SharedMemory/PhysicsLoopBack.h", "../../examples/SharedMemory/PhysicsLoopBackC_API.cpp", @@ -261,6 +262,7 @@ project ("Test_PhysicsServerLoopBack") "../../examples/SharedMemory/PhysicsDirectC_API.h", "../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp", "../../examples/SharedMemory/PhysicsServerCommandProcessor.h", + "../../examples/SharedMemory/b3PluginManager.cpp", "../../examples/SharedMemory/PhysicsClientSharedMemory.cpp", "../../examples/SharedMemory/PhysicsClientSharedMemory.h", "../../examples/SharedMemory/PhysicsClientC_API.cpp", @@ -370,6 +372,7 @@ project ("Test_PhysicsServerInProcessExampleBrowser") "../../examples/SharedMemory/PhysicsDirectC_API.h", "../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp", "../../examples/SharedMemory/PhysicsServerCommandProcessor.h", + "../../examples/SharedMemory/b3PluginManager.cpp", "../../examples/SharedMemory/PhysicsClientSharedMemory.cpp", "../../examples/SharedMemory/PhysicsClientSharedMemory.h", "../../examples/SharedMemory/PhysicsClientC_API.cpp", From 5f6cd6a42b1e98b091f33209b21eb489478921f1 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 23 Sep 2017 07:26:03 -0700 Subject: [PATCH 10/38] link against DL for dlopen --- test/SharedMemory/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/SharedMemory/CMakeLists.txt b/test/SharedMemory/CMakeLists.txt index df2ca3459..0feab4306 100644 --- a/test/SharedMemory/CMakeLists.txt +++ b/test/SharedMemory/CMakeLists.txt @@ -21,6 +21,9 @@ ENDIF() IF (NOT WIN32) LINK_LIBRARIES( pthread ) + IF (NOT APPLE) + LINK_LIBRARIES(${DL}) + ENDIF() ENDIF() ADD_EXECUTABLE(Test_PhysicsClientServer From 37cfce99b2af99b6523cfbc7331c980147343b09 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 23 Sep 2017 07:52:10 -0700 Subject: [PATCH 11/38] add arguments to plugin system --- Extras/BulletRobotics/CMakeLists.txt | 3 +++ examples/SharedMemory/b3PluginManager.cpp | 2 +- examples/SharedMemory/plugins/b3PluginAPI.h | 6 +++--- examples/SharedMemory/plugins/testPlugin/testplugin.cpp | 3 ++- examples/SharedMemory/plugins/testPlugin/testplugin.h | 2 +- examples/pybullet/pybullet.c | 6 +++--- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Extras/BulletRobotics/CMakeLists.txt b/Extras/BulletRobotics/CMakeLists.txt index a8d238197..3c1b66f53 100644 --- a/Extras/BulletRobotics/CMakeLists.txt +++ b/Extras/BulletRobotics/CMakeLists.txt @@ -32,6 +32,9 @@ SET(BulletRobotics_SRCS ../../examples/SharedMemory/PhysicsDirectC_API.h ../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp ../../examples/SharedMemory/PhysicsServerCommandProcessor.h + ../../examples/SharedMemory/b3PluginManager.cpp + ../../examples/SharedMemory/b3PluginManager.h + ../../examples/SharedMemory/PhysicsClientSharedMemory.cpp ../../examples/SharedMemory/PhysicsClientSharedMemory.h ../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp index 328a0426c..2590a6a96 100644 --- a/examples/SharedMemory/b3PluginManager.cpp +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -145,7 +145,7 @@ int b3PluginManager::executePluginCommand(int pluginUniqueId, const char* argume b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); if (plugin) { - result = plugin->m_executeCommandFunc(); + result = plugin->m_executeCommandFunc(arguments); } return result; } diff --git a/examples/SharedMemory/plugins/b3PluginAPI.h b/examples/SharedMemory/plugins/b3PluginAPI.h index 7ae6eb337..408517ddb 100644 --- a/examples/SharedMemory/plugins/b3PluginAPI.h +++ b/examples/SharedMemory/plugins/b3PluginAPI.h @@ -12,8 +12,8 @@ #if defined(_WIN32) #define B3_API_ENTRY -#define B3_API_CALL __stdcall -#define B3_CALLBACK __stdcall +#define B3_API_CALL __cdecl +#define B3_CALLBACK __cdecl #else #define B3_API_ENTRY #define B3_API_CALL @@ -28,7 +28,7 @@ extern "C" { /* Plugin API */ typedef B3_API_ENTRY int (B3_API_CALL * PFN_INIT)(); typedef B3_API_ENTRY void (B3_API_CALL * PFN_EXIT)(); - typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(); + typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(const char* arguments); #ifdef __cplusplus } diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp index 569632c10..41482212a 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp @@ -10,8 +10,9 @@ B3_SHARED_API int initPlugin() return SHARED_MEMORY_MAGIC_NUMBER; } -B3_SHARED_API int executePluginCommand() +B3_SHARED_API int executePluginCommand(const char* arguments) { + printf("arguments:%s\n",arguments); return 42; } diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.h b/examples/SharedMemory/plugins/testPlugin/testplugin.h index 1c4420a96..2b4809617 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.h +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.h @@ -10,7 +10,7 @@ extern "C" B3_SHARED_API int initPlugin(); B3_SHARED_API void exitPlugin(); -B3_SHARED_API int executePluginCommand(); +B3_SHARED_API int executePluginCommand(const char* arguments); #ifdef __cplusplus }; diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 5cd4c26f5..ef1aad238 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -6726,6 +6726,9 @@ static PyObject* pybullet_executePluginCommand(PyObject* self, int pluginUniqueId = -1; int commandUniqueId = -1; char* arguments = 0; + b3SharedMemoryCommandHandle command=0; + b3SharedMemoryStatusHandle statusHandle=0; + int statusType = -1; b3PhysicsClientHandle sm = 0; static char* kwlist[] = { "pluginUniqueId", "commandUniqueId", "arguments", "physicsClientId", NULL }; @@ -6741,9 +6744,6 @@ static PyObject* pybullet_executePluginCommand(PyObject* self, return NULL; } - b3SharedMemoryCommandHandle command=0; - b3SharedMemoryStatusHandle statusHandle=0; - int statusType = -1; command = b3CreateCustomCommand(sm); b3CustomCommandExecutePluginCommand(command, pluginUniqueId, commandUniqueId, arguments); From 815a56c9bc73ec5a3f9d0644f3d82a7c2fe6a168 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 23 Sep 2017 09:25:00 -0700 Subject: [PATCH 12/38] Allow to load a urdf file in the testplugin.cpp, as first quick test, example pybullet script: import pybullet as p p.connect(p.GUI) pluginUid = p.loadPlugin("E:/develop/bullet3/bin/pybullet_testplugin_vs2010_x64_debug.dll") commandUid = 0 argument = "plane.urdf" p.executePluginCommand(pluginUid,commandUid,argument) p.unloadPlugin(pluginUid) --- .../PhysicsClientSharedMemory.cpp | 2 +- .../PhysicsServerCommandProcessor.cpp | 7 +++--- examples/SharedMemory/b3PluginManager.cpp | 13 +++++++++-- examples/SharedMemory/b3PluginManager.h | 2 +- examples/SharedMemory/plugins/b3PluginAPI.h | 2 +- .../SharedMemory/plugins/b3PluginContext.h | 13 +++++++++++ .../plugins/testPlugin/testplugin.cpp | 22 +++++++++++++++---- .../plugins/testPlugin/testplugin.h | 2 +- 8 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 examples/SharedMemory/plugins/b3PluginContext.h diff --git a/examples/SharedMemory/PhysicsClientSharedMemory.cpp b/examples/SharedMemory/PhysicsClientSharedMemory.cpp index 13b75eb8b..1ea576f65 100644 --- a/examples/SharedMemory/PhysicsClientSharedMemory.cpp +++ b/examples/SharedMemory/PhysicsClientSharedMemory.cpp @@ -78,7 +78,7 @@ struct PhysicsClientSharedMemoryInternalData { m_hasLastServerStatus(false), m_sharedMemoryKey(SHARED_MEMORY_KEY), m_verboseOutput(false), - m_timeOutInSeconds(5) + m_timeOutInSeconds(30) {} void processServerStatus(); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 97be495d9..4d95946ad 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -1516,8 +1516,8 @@ struct PhysicsServerCommandProcessorInternalData b3HashMap m_profileEvents; - PhysicsServerCommandProcessorInternalData() - : + PhysicsServerCommandProcessorInternalData(PhysicsCommandProcessorInterface* proc) + :m_pluginManager(proc), m_allowRealTimeSimulation(false), m_commandLogger(0), m_logPlayback(0), @@ -1647,8 +1647,9 @@ void PhysicsServerCommandProcessor::setGuiHelper(struct GUIHelperInterface* guiH PhysicsServerCommandProcessor::PhysicsServerCommandProcessor() + :m_data(0) { - m_data = new PhysicsServerCommandProcessorInternalData(); + m_data = new PhysicsServerCommandProcessorInternalData(this); createEmptyDynamicsWorld(); diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp index 2590a6a96..7a665b1e4 100644 --- a/examples/SharedMemory/b3PluginManager.cpp +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -4,6 +4,8 @@ #include "Bullet3Common/b3ResizablePool.h" #include "plugins/b3PluginAPI.h" #include "SharedMemoryPublic.h" +#include "PhysicsDirect.h" +#include "plugins/b3PluginContext.h" #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -50,15 +52,19 @@ struct b3PluginManagerInternalData { b3ResizablePool m_plugins; b3HashMap m_pluginMap; + PhysicsDirect* m_physicsDirect; }; -b3PluginManager::b3PluginManager() +b3PluginManager::b3PluginManager(class PhysicsCommandProcessorInterface* physSdk) { m_data = new b3PluginManagerInternalData; + m_data->m_physicsDirect = new PhysicsDirect(physSdk,false); + } b3PluginManager::~b3PluginManager() { + delete m_data->m_physicsDirect; m_data->m_pluginMap.clear(); m_data->m_plugins.exitHandles(); delete m_data; @@ -145,7 +151,10 @@ int b3PluginManager::executePluginCommand(int pluginUniqueId, const char* argume b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); if (plugin) { - result = plugin->m_executeCommandFunc(arguments); + b3PluginContext context; + context.m_arguments = arguments; + context.m_physClient = (b3PhysicsClientHandle) m_data->m_physicsDirect; + result = plugin->m_executeCommandFunc(&context); } return result; } diff --git a/examples/SharedMemory/b3PluginManager.h b/examples/SharedMemory/b3PluginManager.h index be8979c95..9a71b352a 100644 --- a/examples/SharedMemory/b3PluginManager.h +++ b/examples/SharedMemory/b3PluginManager.h @@ -7,7 +7,7 @@ class b3PluginManager public: - b3PluginManager(); + b3PluginManager(class PhysicsCommandProcessorInterface* physSdk); virtual ~b3PluginManager(); int loadPlugin(const char* pluginPath); diff --git a/examples/SharedMemory/plugins/b3PluginAPI.h b/examples/SharedMemory/plugins/b3PluginAPI.h index 408517ddb..de5da762d 100644 --- a/examples/SharedMemory/plugins/b3PluginAPI.h +++ b/examples/SharedMemory/plugins/b3PluginAPI.h @@ -28,7 +28,7 @@ extern "C" { /* Plugin API */ typedef B3_API_ENTRY int (B3_API_CALL * PFN_INIT)(); typedef B3_API_ENTRY void (B3_API_CALL * PFN_EXIT)(); - typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(const char* arguments); + typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(struct b3PluginContext* context); #ifdef __cplusplus } diff --git a/examples/SharedMemory/plugins/b3PluginContext.h b/examples/SharedMemory/plugins/b3PluginContext.h new file mode 100644 index 000000000..873269f39 --- /dev/null +++ b/examples/SharedMemory/plugins/b3PluginContext.h @@ -0,0 +1,13 @@ +#ifndef B3_PLUGIN_CONTEXT_H +#define B3_PLUGIN_CONTEXT_H + +#include "../PhysicsClientC_API.h" + +struct b3PluginContext +{ + const char* m_arguments; + + b3PhysicsClientHandle m_physClient; +}; + +#endif //B3_PLUGIN_CONTEXT_H \ No newline at end of file diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp index 41482212a..1b723d380 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp @@ -1,7 +1,7 @@ #include "testplugin.h" #include "../../SharedMemoryPublic.h" - +#include "../b3PluginContext.h" #include B3_SHARED_API int initPlugin() @@ -10,10 +10,24 @@ B3_SHARED_API int initPlugin() return SHARED_MEMORY_MAGIC_NUMBER; } -B3_SHARED_API int executePluginCommand(const char* arguments) +B3_SHARED_API int executePluginCommand(struct b3PluginContext* context) { - printf("arguments:%s\n",arguments); - return 42; + printf("arguments:%s\n",context->m_arguments); + + b3SharedMemoryStatusHandle statusHandle; + int statusType = -1; + int bodyUniqueId = -1; + + b3SharedMemoryCommandHandle command = + b3LoadUrdfCommandInit(context->m_physClient, context->m_arguments); + + statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, command); + statusType = b3GetStatusType(statusHandle); + if (statusType == CMD_URDF_LOADING_COMPLETED) + { + bodyUniqueId = b3GetStatusBodyIndex(statusHandle); + } + return bodyUniqueId; } diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.h b/examples/SharedMemory/plugins/testPlugin/testplugin.h index 2b4809617..53718693f 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.h +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.h @@ -10,7 +10,7 @@ extern "C" B3_SHARED_API int initPlugin(); B3_SHARED_API void exitPlugin(); -B3_SHARED_API int executePluginCommand(const char* arguments); +B3_SHARED_API int executePluginCommand(struct b3PluginContext* context); #ifdef __cplusplus }; From 5373ca39e14fb86ad24223e226e9d2d5f892bb9a Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 23 Sep 2017 09:26:51 -0700 Subject: [PATCH 13/38] add example snippet for the testPlugin/testplugin.cpp --- .../SharedMemory/plugins/testPlugin/testplugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp index 1b723d380..db3f32fdf 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp @@ -1,4 +1,16 @@ +//test plugin, can load a URDF file, example usage on a Windows machine: + +/* +import pybullet as p +p.connect(p.GUI) +pluginUid = p.loadPlugin("E:/develop/bullet3/bin/pybullet_testplugin_vs2010_x64_debug.dll") +commandUid = 0 +argument = "plane.urdf" +p.executePluginCommand(pluginUid,commandUid,argument) +p.unloadPlugin(pluginUid) +*/ + #include "testplugin.h" #include "../../SharedMemoryPublic.h" #include "../b3PluginContext.h" From 8e496036c6a402edf52bd9b594807adf46e8ed91 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 23 Sep 2017 18:05:23 -0700 Subject: [PATCH 14/38] More work on the C/C++ plugin system for pybullet/C-API: Add preTickPluginCallback/postTickPluginCallback User pointer for b3PluginContext, to store objects (class/struct instances) Pass ints and floats as optional argument for plugin executePluginCommand --- examples/SharedMemory/PhysicsClientC_API.cpp | 55 ++++++-- examples/SharedMemory/PhysicsClientC_API.h | 7 +- .../PhysicsServerCommandProcessor.cpp | 83 ++++++------ .../PhysicsServerCommandProcessor.h | 1 + examples/SharedMemory/SharedMemoryCommands.h | 4 +- examples/SharedMemory/SharedMemoryPublic.h | 13 ++ examples/SharedMemory/b3PluginManager.cpp | 121 ++++++++++++++++-- examples/SharedMemory/b3PluginManager.h | 8 +- examples/SharedMemory/plugins/b3PluginAPI.h | 8 +- .../SharedMemory/plugins/b3PluginContext.h | 10 +- .../plugins/testPlugin/testplugin.cpp | 113 +++++++++++++++- .../plugins/testPlugin/testplugin.h | 13 +- examples/pybullet/pybullet.c | 41 ++++-- 13 files changed, 380 insertions(+), 97 deletions(-) diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 5dfaa4e33..c82cd247f 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -1748,7 +1748,7 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCustomCommand(b3PhysicsClientH return (b3SharedMemoryCommandHandle)command; } -B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath, int options) +B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command->m_type == CMD_CUSTOM_COMMAND); @@ -1756,7 +1756,7 @@ B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle command { command->m_updateFlags |= CMD_CUSTOM_COMMAND_LOAD_PLUGIN; command->m_customCommandArgs.m_pluginPath[0] = 0; - command->m_customCommandArgs.m_options = options; + int len = strlen(pluginPath); if (lenm_customCommandArgs.m_pluginUniqueId = pluginUniqueId; } } -B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, int commandUniqueId, const char* arguments) +B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, const char* textArguments) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; @@ -1815,18 +1815,55 @@ B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHand { command->m_updateFlags |= CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND; command->m_customCommandArgs.m_pluginUniqueId = pluginUniqueId; - command->m_customCommandArgs.m_commandUniqueId = commandUniqueId; - command->m_customCommandArgs.m_pluginArguments[0] = 0; - int len = strlen(arguments); + + command->m_customCommandArgs.m_arguments.m_numInts = 0; + command->m_customCommandArgs.m_arguments.m_numFloats = 0; + command->m_customCommandArgs.m_arguments.m_text[0] = 0; + + int len = strlen(textArguments); + if (lenm_customCommandArgs.m_pluginArguments, arguments); + strcpy(command->m_customCommandArgs.m_arguments.m_text, textArguments); } - - } } +B3_SHARED_API void b3CustomCommandExecuteAddIntArgument(b3SharedMemoryCommandHandle commandHandle, int intVal) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command->m_type == CMD_CUSTOM_COMMAND); + b3Assert(command->m_updateFlags & CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND); + if (command->m_type == CMD_CUSTOM_COMMAND && (command->m_updateFlags & CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND)) + { + int numInts = command->m_customCommandArgs.m_arguments.m_numInts; + if (numIntsm_customCommandArgs.m_arguments.m_ints[numInts]=intVal; + command->m_customCommandArgs.m_arguments.m_numInts++; + } + } +} + +B3_SHARED_API void b3CustomCommandExecuteAddFloatArgument(b3SharedMemoryCommandHandle commandHandle, float floatVal) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command->m_type == CMD_CUSTOM_COMMAND); + b3Assert(command->m_updateFlags & CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND); + if (command->m_type == CMD_CUSTOM_COMMAND && (command->m_updateFlags & CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND)) + { + int numFloats = command->m_customCommandArgs.m_arguments.m_numFloats; + if (numFloatsm_customCommandArgs.m_arguments.m_floats[numFloats]=floatVal; + command->m_customCommandArgs.m_arguments.m_numFloats++; + } + } +} + + + + B3_SHARED_API b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex) { diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index 4dc6624dd..f1e4056f1 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -62,12 +62,15 @@ B3_SHARED_API int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle); ///Plugin system, load and unload a plugin, execute a command B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCustomCommand(b3PhysicsClientHandle physClient); -B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath, int options); +B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath); B3_SHARED_API int b3GetStatusPluginUniqueId(b3SharedMemoryStatusHandle statusHandle); B3_SHARED_API int b3GetStatusPluginCommandResult(b3SharedMemoryStatusHandle statusHandle); B3_SHARED_API void b3CustomCommandUnloadPlugin(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId); -B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, int commandUniqueId, const char* arguments); +B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, const char* textArguments); +B3_SHARED_API void b3CustomCommandExecuteAddIntArgument(b3SharedMemoryCommandHandle commandHandle, int intVal); +B3_SHARED_API void b3CustomCommandExecuteAddFloatArgument(b3SharedMemoryCommandHandle commandHandle, float floatVal); + B3_SHARED_API int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 4d95946ad..8fe802ce7 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -1,5 +1,6 @@ #include "PhysicsServerCommandProcessor.h" + #include "../Importers/ImportURDFDemo/BulletUrdfImporter.h" #include "../Importers/ImportURDFDemo/MyMultiBodyCreator.h" #include "../Importers/ImportURDFDemo/URDF2Bullet.h" @@ -1488,7 +1489,7 @@ struct PhysicsServerCommandProcessorInternalData btAlignedObjectArray m_sdfRecentLoadedBodies; - + btAlignedObjectArray m_stateLoggers; int m_stateLoggersUniqueId; int m_profileTimingLoggingUid; @@ -1541,6 +1542,16 @@ struct PhysicsServerCommandProcessorInternalData m_pickedConstraint(0), m_pickingMultiBodyPoint2Point(0) { + + + + { + //test to statically link a plugin + //#include "plugins/testPlugin/testplugin.h" + //register static plugins: + //m_pluginManager.registerStaticLinkedPlugin("path", initPlugin, exitPlugin, executePluginCommand); + } + m_vrControllerEvents.init(); m_bodyHandles.exitHandles(); @@ -1671,13 +1682,23 @@ PhysicsServerCommandProcessor::~PhysicsServerCommandProcessor() delete m_data; } + +void preTickCallback(btDynamicsWorld *world, btScalar timeStep) +{ + PhysicsServerCommandProcessor* proc = (PhysicsServerCommandProcessor*) world->getWorldUserInfo(); + bool isPreTick = true; + proc->tickPlugins(timeStep, isPreTick); +} + void logCallback(btDynamicsWorld *world, btScalar timeStep) { //handle the logging and playing sounds PhysicsServerCommandProcessor* proc = (PhysicsServerCommandProcessor*) world->getWorldUserInfo(); proc->processCollisionForces(timeStep); - proc->logObjectStates(timeStep); + + bool isPreTick = false; + proc->tickPlugins(timeStep, isPreTick); } @@ -1786,6 +1807,12 @@ void PhysicsServerCommandProcessor::processCollisionForces(btScalar timeStep) #endif//B3_ENABLE_TINY_AUDIO } +void PhysicsServerCommandProcessor::tickPlugins(btScalar timeStep, bool isPreTick) +{ + m_data->m_pluginManager.tickPlugins(timeStep, isPreTick); +} + + void PhysicsServerCommandProcessor::logObjectStates(btScalar timeStep) { for (int i=0;im_stateLoggers.size();i++) @@ -2149,7 +2176,11 @@ void PhysicsServerCommandProcessor::createEmptyDynamicsWorld() { m_data->m_guiHelper->createPhysicsDebugDrawer(m_data->m_dynamicsWorld); } - m_data->m_dynamicsWorld->setInternalTickCallback(logCallback,this); + bool isPreTick=false; + m_data->m_dynamicsWorld->setInternalTickCallback(logCallback,this,isPreTick); + isPreTick = true; + m_data->m_dynamicsWorld->setInternalTickCallback(preTickCallback,this,isPreTick); + #ifdef B3_ENABLE_TINY_AUDIO m_data->m_soundEngine.init(16,true); @@ -2966,27 +2997,11 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm bool hasStatus = false; { - ///we ignore overflow of integer for now - { - - //until we implement a proper ring buffer, we assume always maximum of 1 outstanding commands - - - //const SharedMemoryCommand& clientCmd =m_data->m_testBlock1->m_clientCommands[0]; -#if 1 if (m_data->m_commandLogger) { m_data->m_commandLogger->logCommand(clientCmd); } -#endif - - //m_data->m_testBlock1->m_numProcessedClientCommands++; - - //no timestamp yet - //int timeStamp = 0; - - //catch uninitialized cases serverStatusOut.m_type = CMD_INVALID_STATUS; serverStatusOut.m_numDataStreamBytes = 0; serverStatusOut.m_dataStream = 0; @@ -2994,32 +3009,7 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm //consume the command switch (clientCmd.m_type) { -#if 0 - case CMD_SEND_BULLET_DATA_STREAM: - { - if (m_data->m_verboseOutput) - { - b3Printf("Processed CMD_SEND_BULLET_DATA_STREAM length %d",clientCmd.m_dataStreamArguments.m_streamChunkLength); - } - btBulletWorldImporter* worldImporter = new btBulletWorldImporter(m_data->m_dynamicsWorld); - m_data->m_worldImporters.push_back(worldImporter); - bool completedOk = worldImporter->loadFileFromMemory(m_data->m_testBlock1->m_bulletStreamDataClientToServer,clientCmd.m_dataStreamArguments.m_streamChunkLength); - - if (completedOk) - { - SharedMemoryStatus& status = m_data->createServerStatus(CMD_BULLET_DATA_STREAM_RECEIVED_COMPLETED,clientCmd.m_sequenceNumber,timeStamp); - m_data->m_guiHelper->autogenerateGraphicsObjects(this->m_data->m_dynamicsWorld); - m_data->submitServerStatus(status); - } else - { - SharedMemoryStatus& status = m_data->createServerStatus(CMD_BULLET_DATA_STREAM_RECEIVED_FAILED,clientCmd.m_sequenceNumber,timeStamp); - m_data->submitServerStatus(status); - } - - break; - } -#endif case CMD_STATE_LOGGING: { BT_PROFILE("CMD_STATE_LOGGING"); @@ -7996,7 +7986,8 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm } if (clientCmd.m_updateFlags & CMD_CUSTOM_COMMAND_EXECUTE_PLUGIN_COMMAND) { - int result = m_data->m_pluginManager.executePluginCommand(clientCmd.m_customCommandArgs.m_pluginUniqueId, clientCmd.m_customCommandArgs.m_pluginArguments); + + int result = m_data->m_pluginManager.executePluginCommand(clientCmd.m_customCommandArgs.m_pluginUniqueId, &clientCmd.m_customCommandArgs.m_arguments); serverCmd.m_customCommandResultArgs.m_executeCommandResult = result; serverCmd.m_type = CMD_CUSTOM_COMMAND_COMPLETED; @@ -8245,6 +8236,8 @@ bool PhysicsServerCommandProcessor::isRealTimeSimulationEnabled() const void PhysicsServerCommandProcessor::stepSimulationRealTime(double dtInSec,const struct b3VRControllerEvent* vrControllerEvents, int numVRControllerEvents, const struct b3KeyboardEvent* keyEvents, int numKeyEvents, const struct b3MouseEvent* mouseEvents, int numMouseEvents) { m_data->m_vrControllerEvents.addNewVREvents(vrControllerEvents,numVRControllerEvents); + + for (int i=0;im_stateLoggers.size();i++) { if (m_data->m_stateLoggers[i]->m_loggingType==STATE_LOGGING_VR_CONTROLLERS) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.h b/examples/SharedMemory/PhysicsServerCommandProcessor.h index 65bb0bb6d..d46203419 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.h +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.h @@ -91,6 +91,7 @@ public: virtual void replayLogCommand(char* bufferServerToClient, int bufferSizeInBytes ); //logging of object states (position etc) + void tickPlugins(btScalar timeStep, bool isPreTick); void logObjectStates(btScalar timeStep); void processCollisionForces(btScalar timeStep); diff --git a/examples/SharedMemory/SharedMemoryCommands.h b/examples/SharedMemory/SharedMemoryCommands.h index cdd2f720c..49098e0a0 100644 --- a/examples/SharedMemory/SharedMemoryCommands.h +++ b/examples/SharedMemory/SharedMemoryCommands.h @@ -119,10 +119,8 @@ enum CustomCommandEnum struct b3CustomCommand { int m_pluginUniqueId; - int m_commandUniqueId; - int m_options; + b3PluginArguments m_arguments; char m_pluginPath[MAX_FILENAME_LENGTH]; - char m_pluginArguments[MAX_FILENAME_LENGTH]; }; struct b3CustomCommandResultArgs diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index 10ada7c50..2186f3a78 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -620,6 +620,19 @@ enum eStateLoggingFlags STATE_LOG_JOINT_TORQUES = STATE_LOG_JOINT_MOTOR_TORQUES+STATE_LOG_JOINT_USER_TORQUES, }; +#define B3_MAX_PLUGIN_ARG_SIZE 128 +#define B3_MAX_PLUGIN_ARG_TEXT_LEN 1024 + +struct b3PluginArguments +{ + char m_text[B3_MAX_PLUGIN_ARG_TEXT_LEN]; + int m_numInts; + int m_ints[B3_MAX_PLUGIN_ARG_SIZE]; + int m_numFloats; + int m_floats[B3_MAX_PLUGIN_ARG_SIZE]; + + +}; #endif//SHARED_MEMORY_PUBLIC_H diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp index 7a665b1e4..3210e94b2 100644 --- a/examples/SharedMemory/b3PluginManager.cpp +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -2,7 +2,6 @@ #include "b3PluginManager.h" #include "Bullet3Common/b3HashMap.h" #include "Bullet3Common/b3ResizablePool.h" -#include "plugins/b3PluginAPI.h" #include "SharedMemoryPublic.h" #include "PhysicsDirect.h" #include "plugins/b3PluginContext.h" @@ -30,19 +29,43 @@ struct b3Plugin { B3_DYNLIB_HANDLE m_pluginHandle; + bool m_ownsPluginHandle; std::string m_pluginPath; - + int m_pluginUniqueId; PFN_INIT m_initFunc; PFN_EXIT m_exitFunc; PFN_EXECUTE m_executeCommandFunc; + + PFN_TICK m_preTickFunc; + PFN_TICK m_postTickFunc; + void* m_userPointer; + + b3Plugin() + :m_pluginHandle(0), + m_ownsPluginHandle(false), + m_pluginUniqueId(-1), + m_initFunc(0), + m_exitFunc(0), + m_executeCommandFunc(0), + m_postTickFunc(0), + m_preTickFunc(0), + m_userPointer(0) + { + } void clear() { - B3_DYNLIB_CLOSE(m_pluginHandle); + if (m_ownsPluginHandle) + { + B3_DYNLIB_CLOSE(m_pluginHandle); + } m_pluginHandle = 0; m_initFunc = 0; m_exitFunc = 0; m_executeCommandFunc = 0; + m_preTickFunc = 0; + m_postTickFunc = 0; + m_userPointer = 0; } }; @@ -64,26 +87,33 @@ b3PluginManager::b3PluginManager(class PhysicsCommandProcessorInterface* physSdk b3PluginManager::~b3PluginManager() { + while (m_data->m_pluginMap.size()) + { + b3PluginHandle* plugin = m_data->m_pluginMap.getAtIndex(0); + unloadPlugin(plugin->m_pluginUniqueId); + } delete m_data->m_physicsDirect; m_data->m_pluginMap.clear(); m_data->m_plugins.exitHandles(); delete m_data; } - + + int b3PluginManager::loadPlugin(const char* pluginPath) { int pluginUniqueId = -1; - b3Plugin* plugin = m_data->m_pluginMap.find(pluginPath); - if (plugin) + b3Plugin* pluginOrg = m_data->m_pluginMap.find(pluginPath); + if (pluginOrg) { //already loaded + pluginUniqueId = pluginOrg->m_pluginUniqueId; } else { pluginUniqueId = m_data->m_plugins.allocHandle(); b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); - + plugin->m_pluginUniqueId = pluginUniqueId; B3_DYNLIB_HANDLE pluginHandle = B3_DYNLIB_OPEN(pluginPath); bool ok = false; if (pluginHandle) @@ -92,13 +122,22 @@ int b3PluginManager::loadPlugin(const char* pluginPath) plugin->m_initFunc = (PFN_INIT)B3_DYNLIB_IMPORT(pluginHandle, "initPlugin"); plugin->m_exitFunc = (PFN_EXIT)B3_DYNLIB_IMPORT(pluginHandle, "exitPlugin"); plugin->m_executeCommandFunc = (PFN_EXECUTE)B3_DYNLIB_IMPORT(pluginHandle, "executePluginCommand"); - + plugin->m_preTickFunc = (PFN_TICK)B3_DYNLIB_IMPORT(pluginHandle, "preTickPluginCallback"); + plugin->m_postTickFunc = (PFN_TICK)B3_DYNLIB_IMPORT(pluginHandle, "postTickPluginCallback"); + if (plugin->m_initFunc && plugin->m_exitFunc && plugin->m_executeCommandFunc) { - int version = plugin->m_initFunc(); + + b3PluginContext context; + context.m_userPointer = plugin->m_userPointer; + context.m_physClient = (b3PhysicsClientHandle) m_data->m_physicsDirect; + int version = plugin->m_initFunc(&context); + //keep the user pointer persistent + plugin->m_userPointer = context.m_userPointer; if (version == SHARED_MEMORY_MAGIC_NUMBER) { ok = true; + plugin->m_ownsPluginHandle = true; plugin->m_pluginHandle = pluginHandle; plugin->m_pluginPath = pluginPath; m_data->m_pluginMap.insert(pluginPath, *plugin); @@ -137,14 +176,35 @@ void b3PluginManager::unloadPlugin(int pluginUniqueId) b3PluginHandle* plugin = m_data->m_plugins.getHandle(pluginUniqueId); if (plugin) { - plugin->m_exitFunc(); + b3PluginContext context; + context.m_userPointer = plugin->m_userPointer; + context.m_physClient = (b3PhysicsClientHandle) m_data->m_physicsDirect; + + plugin->m_exitFunc(&context); m_data->m_pluginMap.remove(plugin->m_pluginPath.c_str()); m_data->m_plugins.freeHandle(pluginUniqueId); } } +void b3PluginManager::tickPlugins(double timeStep, bool isPreTick) +{ + for (int i=0;im_pluginMap.size();i++) + { + b3PluginHandle* plugin = m_data->m_pluginMap.getAtIndex(i); -int b3PluginManager::executePluginCommand(int pluginUniqueId, const char* arguments) + PFN_TICK tick = isPreTick? plugin->m_preTickFunc : plugin->m_postTickFunc; + if (tick) + { + b3PluginContext context; + context.m_userPointer = plugin->m_userPointer; + context.m_physClient = (b3PhysicsClientHandle) m_data->m_physicsDirect; + int result = tick(&context); + plugin->m_userPointer = context.m_userPointer; + } + } +} + +int b3PluginManager::executePluginCommand(int pluginUniqueId, const b3PluginArguments* arguments) { int result = -1; @@ -152,9 +212,44 @@ int b3PluginManager::executePluginCommand(int pluginUniqueId, const char* argume if (plugin) { b3PluginContext context; - context.m_arguments = arguments; + context.m_userPointer = plugin->m_userPointer; context.m_physClient = (b3PhysicsClientHandle) m_data->m_physicsDirect; - result = plugin->m_executeCommandFunc(&context); + + result = plugin->m_executeCommandFunc(&context, arguments); + plugin->m_userPointer = context.m_userPointer; } return result; } + + +int b3PluginManager::registerStaticLinkedPlugin(const char* pluginPath, PFN_INIT initFunc,PFN_EXIT exitFunc, PFN_EXECUTE executeCommandFunc, PFN_TICK preTickFunc, PFN_TICK postTickFunc) +{ + + b3Plugin orgPlugin; + + + int pluginUniqueId = m_data->m_plugins.allocHandle(); + b3PluginHandle* pluginHandle = m_data->m_plugins.getHandle(pluginUniqueId); + pluginHandle->m_pluginHandle = 0; + pluginHandle->m_ownsPluginHandle =false; + pluginHandle->m_pluginUniqueId = pluginUniqueId; + pluginHandle->m_executeCommandFunc = executeCommandFunc; + pluginHandle->m_exitFunc = exitFunc; + pluginHandle->m_initFunc = initFunc; + pluginHandle->m_preTickFunc = preTickFunc; + pluginHandle->m_postTickFunc = postTickFunc; + pluginHandle->m_pluginHandle = 0; + pluginHandle->m_pluginPath = pluginPath; + pluginHandle->m_userPointer = 0; + + m_data->m_pluginMap.insert(pluginPath, *pluginHandle); + + { + b3PluginContext context; + context.m_userPointer = 0; + context.m_physClient = (b3PhysicsClientHandle) m_data->m_physicsDirect; + int result = pluginHandle->m_initFunc(&context); + pluginHandle->m_userPointer = context.m_userPointer; + } + return pluginUniqueId; +} diff --git a/examples/SharedMemory/b3PluginManager.h b/examples/SharedMemory/b3PluginManager.h index 9a71b352a..dd02b9630 100644 --- a/examples/SharedMemory/b3PluginManager.h +++ b/examples/SharedMemory/b3PluginManager.h @@ -1,6 +1,8 @@ #ifndef B3_PLUGIN_MANAGER_H #define B3_PLUGIN_MANAGER_H +#include "plugins/b3PluginAPI.h" + class b3PluginManager { struct b3PluginManagerInternalData* m_data; @@ -12,8 +14,10 @@ class b3PluginManager int loadPlugin(const char* pluginPath); void unloadPlugin(int pluginUniqueId); - int executePluginCommand(int pluginUniqueId, const char* arguments); - + int executePluginCommand(int pluginUniqueId, const struct b3PluginArguments* arguments); + void tickPlugins(double timeStep, bool isPreTick); + int registerStaticLinkedPlugin(const char* pluginPath, PFN_INIT initFunc,PFN_EXIT exitFunc, PFN_EXECUTE m_executeCommandFunc, PFN_TICK preTickFunc, PFN_TICK postTickFunc); + }; #endif //B3_PLUGIN_MANAGER_H diff --git a/examples/SharedMemory/plugins/b3PluginAPI.h b/examples/SharedMemory/plugins/b3PluginAPI.h index de5da762d..54387668f 100644 --- a/examples/SharedMemory/plugins/b3PluginAPI.h +++ b/examples/SharedMemory/plugins/b3PluginAPI.h @@ -26,10 +26,10 @@ extern "C" { #endif /* Plugin API */ - typedef B3_API_ENTRY int (B3_API_CALL * PFN_INIT)(); - typedef B3_API_ENTRY void (B3_API_CALL * PFN_EXIT)(); - typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(struct b3PluginContext* context); - + typedef B3_API_ENTRY int (B3_API_CALL * PFN_INIT)(struct b3PluginContext* context); + typedef B3_API_ENTRY void (B3_API_CALL * PFN_EXIT)(struct b3PluginContext* context); + typedef B3_API_ENTRY int (B3_API_CALL * PFN_EXECUTE)(struct b3PluginContext* context, const struct b3PluginArguments* arguments); + typedef B3_API_ENTRY int (B3_API_CALL * PFN_TICK)(struct b3PluginContext* context); #ifdef __cplusplus } #endif diff --git a/examples/SharedMemory/plugins/b3PluginContext.h b/examples/SharedMemory/plugins/b3PluginContext.h index 873269f39..cb8bd754d 100644 --- a/examples/SharedMemory/plugins/b3PluginContext.h +++ b/examples/SharedMemory/plugins/b3PluginContext.h @@ -5,9 +5,17 @@ struct b3PluginContext { - const char* m_arguments; b3PhysicsClientHandle m_physClient; + + //plugin can modify the m_userPointer to store persistent object pointer (class or struct instance etc) + void* m_userPointer; + }; + + + + + #endif //B3_PLUGIN_CONTEXT_H \ No newline at end of file diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp index db3f32fdf..2ba2b6bf2 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.cpp +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.cpp @@ -16,22 +16,119 @@ p.unloadPlugin(pluginUid) #include "../b3PluginContext.h" #include -B3_SHARED_API int initPlugin() +struct MyClass { + int m_testData; + + MyClass() + :m_testData(42) + { + } + virtual ~MyClass() + { + } +}; + +B3_SHARED_API int initPlugin(struct b3PluginContext* context) +{ + MyClass* obj = new MyClass(); + context->m_userPointer = obj; + printf("hi!\n"); return SHARED_MEMORY_MAGIC_NUMBER; } -B3_SHARED_API int executePluginCommand(struct b3PluginContext* context) -{ - printf("arguments:%s\n",context->m_arguments); +B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context) +{ + MyClass* obj = (MyClass* )context->m_userPointer; + + { + b3SharedMemoryCommandHandle commandHandle = b3RequestVREventsCommandInit(context->m_physClient); + int deviceTypeFilter = VR_DEVICE_CONTROLLER; + b3VREventsSetDeviceTypeFilter(commandHandle, deviceTypeFilter); + + b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + int statusType = b3GetStatusType(statusHandle); + if (statusType == CMD_REQUEST_VR_EVENTS_DATA_COMPLETED) + { + struct b3VREventsData vrEvents; + + int i = 0; + b3GetVREventsData(context->m_physClient, &vrEvents); + if (vrEvents.m_numControllerEvents) + { + //this is only for a test, normally you wouldn't print to the console at each simulation substep! + printf("got %d VR controller events!\n", vrEvents.m_numControllerEvents); + } + } + } + { + b3KeyboardEventsData keyboardEventsData; + b3SharedMemoryCommandHandle commandHandle = b3RequestKeyboardEventsCommandInit(context->m_physClient); + b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + b3GetKeyboardEventsData(context->m_physClient, &keyboardEventsData); + if (keyboardEventsData.m_numKeyboardEvents) + { + //this is only for a test, normally you wouldn't print to the console at each simulation substep! + printf("got %d keyboard events\n", keyboardEventsData.m_numKeyboardEvents); + } + } + + { + b3MouseEventsData mouseEventsData; + b3SharedMemoryCommandHandle commandHandle = b3RequestMouseEventsCommandInit(context->m_physClient); + b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + b3GetMouseEventsData(context->m_physClient, &mouseEventsData); + if (mouseEventsData.m_numMouseEvents) + { + //this is only for a test, normally you wouldn't print to the console at each simulation substep! + printf("got %d mouse events\n", mouseEventsData.m_numMouseEvents); + } + } + + return 0; +} + + +B3_SHARED_API int postTickPluginCallback(struct b3PluginContext* context) +{ + MyClass* obj = (MyClass* )context->m_userPointer; + obj->m_testData++; + return 0; +} + +B3_SHARED_API int executePluginCommand(struct b3PluginContext* context, const struct b3PluginArguments* arguments) +{ + printf("text argument:%s\n",arguments->m_text); + printf("int args: ["); + for (int i=0;im_numInts;i++) + { + printf("%d", arguments->m_ints[i]); + if ((i+1)m_numInts) + { + printf(","); + } + } + printf("]\nfloat args: ["); + for (int i=0;im_numFloats;i++) + { + printf("%f", arguments->m_floats[i]); + if ((i+1)m_numFloats) + { + printf(","); + } + } + printf("]\n"); + + MyClass* obj = (MyClass*) context->m_userPointer; + b3SharedMemoryStatusHandle statusHandle; int statusType = -1; int bodyUniqueId = -1; b3SharedMemoryCommandHandle command = - b3LoadUrdfCommandInit(context->m_physClient, context->m_arguments); + b3LoadUrdfCommandInit(context->m_physClient, arguments->m_text); statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, command); statusType = b3GetStatusType(statusHandle); @@ -43,7 +140,11 @@ B3_SHARED_API int executePluginCommand(struct b3PluginContext* context) } -B3_SHARED_API void exitPlugin() +B3_SHARED_API void exitPlugin(struct b3PluginContext* context) { + MyClass* obj = (MyClass*) context->m_userPointer; + delete obj; + context->m_userPointer = 0; + printf("bye!\n"); } diff --git a/examples/SharedMemory/plugins/testPlugin/testplugin.h b/examples/SharedMemory/plugins/testPlugin/testplugin.h index 53718693f..bb14345cc 100644 --- a/examples/SharedMemory/plugins/testPlugin/testplugin.h +++ b/examples/SharedMemory/plugins/testPlugin/testplugin.h @@ -8,9 +8,16 @@ extern "C" { #endif -B3_SHARED_API int initPlugin(); -B3_SHARED_API void exitPlugin(); -B3_SHARED_API int executePluginCommand(struct b3PluginContext* context); +//initPlugin, exitPlugin and executePluginCommand are required, otherwise plugin won't load +B3_SHARED_API int initPlugin(struct b3PluginContext* context); +B3_SHARED_API void exitPlugin(struct b3PluginContext* context); +B3_SHARED_API int executePluginCommand(struct b3PluginContext* context, const struct b3PluginArguments* arguments); + +//preTickPluginCallback and postTickPluginCallback are optional. +B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context); +B3_SHARED_API int postTickPluginCallback(struct b3PluginContext* context); + + #ifdef __cplusplus }; diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index ef1aad238..ed4fc453b 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -6658,15 +6658,15 @@ static PyObject* pybullet_loadPlugin(PyObject* self, PyObject* args, PyObject* keywds) { int physicsClientId = 0; - int option = 0; + char* pluginPath = 0; b3SharedMemoryCommandHandle command = 0; b3SharedMemoryStatusHandle statusHandle = 0; int statusType = -1; b3PhysicsClientHandle sm = 0; - static char* kwlist[] = { "pluginPath", "option", "physicsClientId", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|ii", kwlist, &pluginPath, &option, &physicsClientId)) + static char* kwlist[] = { "pluginPath", "physicsClientId", NULL }; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|i", kwlist, &pluginPath, &physicsClientId)) { return NULL; } @@ -6679,7 +6679,7 @@ static PyObject* pybullet_loadPlugin(PyObject* self, } command = b3CreateCustomCommand(sm); - b3CustomCommandLoadPlugin(command, pluginPath, option); + b3CustomCommandLoadPlugin(command, pluginPath); statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command); statusType = b3GetStatusPluginUniqueId(statusHandle); return PyInt_FromLong(statusType); @@ -6724,15 +6724,16 @@ static PyObject* pybullet_executePluginCommand(PyObject* self, { int physicsClientId = 0; int pluginUniqueId = -1; - int commandUniqueId = -1; - char* arguments = 0; + char* textArgument = 0; b3SharedMemoryCommandHandle command=0; b3SharedMemoryStatusHandle statusHandle=0; int statusType = -1; + PyObject* intArgs=0; + PyObject* floatArgs=0; b3PhysicsClientHandle sm = 0; - static char* kwlist[] = { "pluginUniqueId", "commandUniqueId", "arguments", "physicsClientId", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "ii|si", kwlist, &pluginUniqueId, &commandUniqueId, &arguments, &physicsClientId)) + static char* kwlist[] = { "pluginUniqueId", "textArgument", "intArgs", "floatArgs", "physicsClientId", NULL }; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sOOi", kwlist, &pluginUniqueId, &textArgument, &intArgs, &floatArgs, &physicsClientId)) { return NULL; } @@ -6746,7 +6747,29 @@ static PyObject* pybullet_executePluginCommand(PyObject* self, command = b3CreateCustomCommand(sm); - b3CustomCommandExecutePluginCommand(command, pluginUniqueId, commandUniqueId, arguments); + b3CustomCommandExecutePluginCommand(command, pluginUniqueId, textArgument); + + { + PyObject* seqIntArgs = intArgs?PySequence_Fast(intArgs, "expected a sequence"):0; + PyObject* seqFloatArgs = floatArgs?PySequence_Fast(floatArgs, "expected a sequence"):0; + int numIntArgs = seqIntArgs?PySequence_Size(intArgs):0; + int numFloatArgs = seqIntArgs?PySequence_Size(floatArgs):0; + int i; + for (i=0;i Date: Sat, 23 Sep 2017 19:58:59 -0700 Subject: [PATCH 15/38] [pybullet] Add calculateJacobian. * Add the calculateJacobian method to the pybullet API. * Adjust the shared memory interface to handle fixed/floating bases in the calculateJacobian method. * Fix a few comments. --- .../b3RobotSimulatorClientAPI.cpp | 3 +- examples/SharedMemory/PhysicsClientC_API.cpp | 6 +- examples/SharedMemory/PhysicsClientC_API.h | 5 +- .../PhysicsServerCommandProcessor.cpp | 29 +- examples/pybullet/pybullet.c | 258 ++++++++++++++---- src/BulletInverseDynamics/IDMath.cpp | 2 +- .../details/MultiBodyTreeImpl.cpp | 2 +- 7 files changed, 241 insertions(+), 64 deletions(-) diff --git a/examples/RobotSimulator/b3RobotSimulatorClientAPI.cpp b/examples/RobotSimulator/b3RobotSimulatorClientAPI.cpp index 172a8dfb9..f5556bb60 100644 --- a/examples/RobotSimulator/b3RobotSimulatorClientAPI.cpp +++ b/examples/RobotSimulator/b3RobotSimulatorClientAPI.cpp @@ -988,7 +988,8 @@ bool b3RobotSimulatorClientAPI::getBodyJacobian(int bodyUniqueId, int linkIndex, if (b3GetStatusType(statusHandle) == CMD_CALCULATED_JACOBIAN_COMPLETED) { - b3GetStatusJacobian(statusHandle, linearJacobian, angularJacobian); + int dofCount; + b3GetStatusJacobian(statusHandle, &dofCount, linearJacobian, angularJacobian); return true; } return false; diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 9bc362373..72ffde561 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -3178,13 +3178,17 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3Physi } -B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian) +B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, int* dofCount, double* linearJacobian, double* angularJacobian) { const SharedMemoryStatus* status = (const SharedMemoryStatus*)statusHandle; btAssert(status->m_type == CMD_CALCULATED_JACOBIAN_COMPLETED); if (status->m_type != CMD_CALCULATED_JACOBIAN_COMPLETED) return false; + if (dofCount) + { + *dofCount = status->m_jacobianResultArgs.m_dofCount; + } if (linearJacobian) { for (int i = 0; i < status->m_jacobianResultArgs.m_dofCount*3; i++) diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index af297ea68..d1cb840bb 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -304,7 +304,10 @@ B3_SHARED_API int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHand B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle physClient, int bodyIndex, int linkIndex, const double* localPosition, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations); -B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, double* linearJacobian, double* angularJacobian); +B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle, + int* dofCount, + double* linearJacobian, + double* angularJacobian); ///compute the joint positions to move the end effector to a desired target using inverse kinematics B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyIndex); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 1a1b13275..b7099d07b 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -6623,30 +6623,37 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm if (tree) { int baseDofs = bodyHandle->m_multiBody->hasFixedBase() ? 0 : 6; - const int num_dofs = bodyHandle->m_multiBody->getNumDofs(); - btInverseDynamics::vecx nu(num_dofs+baseDofs), qdot(num_dofs + baseDofs), q(num_dofs + baseDofs), joint_force(num_dofs + baseDofs); - for (int i = 0; i < num_dofs; i++) + const int numDofs = bodyHandle->m_multiBody->getNumDofs(); + btInverseDynamics::vecx q(numDofs + baseDofs); + btInverseDynamics::vecx qdot(numDofs + baseDofs); + btInverseDynamics::vecx nu(numDofs + baseDofs); + btInverseDynamics::vecx joint_force(numDofs + baseDofs); + for (int i = 0; i < numDofs; i++) { q[i + baseDofs] = clientCmd.m_calculateJacobianArguments.m_jointPositionsQ[i]; qdot[i + baseDofs] = clientCmd.m_calculateJacobianArguments.m_jointVelocitiesQdot[i]; - nu[i+baseDofs] = clientCmd.m_calculateJacobianArguments.m_jointAccelerations[i]; + nu[i + baseDofs] = clientCmd.m_calculateJacobianArguments.m_jointAccelerations[i]; } // Set the gravity to correspond to the world gravity btInverseDynamics::vec3 id_grav(m_data->m_dynamicsWorld->getGravity()); - if (-1 != tree->setGravityInWorldFrame(id_grav) && -1 != tree->calculateInverseDynamics(q, qdot, nu, &joint_force)) { - serverCmd.m_jacobianResultArgs.m_dofCount = num_dofs; + serverCmd.m_jacobianResultArgs.m_dofCount = numDofs + baseDofs; // Set jacobian value tree->calculateJacobians(q); - btInverseDynamics::mat3x jac_t(3, num_dofs); - tree->getBodyJacobianTrans(clientCmd.m_calculateJacobianArguments.m_linkIndex+1, &jac_t); + btInverseDynamics::mat3x jac_t(3, numDofs + baseDofs); + btInverseDynamics::mat3x jac_r(3, numDofs + baseDofs); + // Note that inverse dynamics uses zero-based indexing of bodies, not starting from -1 for the base link. + tree->getBodyJacobianTrans(clientCmd.m_calculateJacobianArguments.m_linkIndex + 1, &jac_t); + tree->getBodyJacobianRot(clientCmd.m_calculateJacobianArguments.m_linkIndex + 1, &jac_r); for (int i = 0; i < 3; ++i) { - for (int j = 0; j < num_dofs; ++j) + for (int j = 0; j < (numDofs + baseDofs); ++j) { - serverCmd.m_jacobianResultArgs.m_linearJacobian[i*num_dofs+j] = jac_t(i,j); + int element = (numDofs + baseDofs) * i + j; + serverCmd.m_jacobianResultArgs.m_linearJacobian[element] = jac_t(i,j); + serverCmd.m_jacobianResultArgs.m_angularJacobian[element] = jac_r(i,j); } } serverCmd.m_type = CMD_CALCULATED_JACOBIAN_COMPLETED; @@ -7370,7 +7377,7 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm tree->calculateJacobians(q); btInverseDynamics::mat3x jac_t(3, numDofs); btInverseDynamics::mat3x jac_r(3,numDofs); - // Note that inverse dynamics uses zero-based indexing of bodies, not starting from -1 for the base link. + // Note that inverse dynamics uses zero-based indexing of bodies, not starting from -1 for the base link. tree->getBodyJacobianTrans(endEffectorLinkIndex+1, &jac_t); tree->getBodyJacobianRot(endEffectorLinkIndex+1, &jac_r); for (int i = 0; i < 3; ++i) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index c1f7e2eb2..9290df7dc 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -445,10 +445,10 @@ static PyObject* pybullet_connectPhysicsServer(PyObject* self, PyObject* args, P { printf("Connection terminated, couldn't get body info\n"); b3DisconnectSharedMemory(sm); - sm = 0; + sm = 0; sPhysicsClients1[freeIndex] = 0; - sPhysicsClientsGUI[freeIndex] = 0; - sNumPhysicsClients++; + sPhysicsClientsGUI[freeIndex] = 0; + sNumPhysicsClients++; return PyInt_FromLong(-1); } } @@ -2835,7 +2835,7 @@ static PyObject* pybullet_getJointInfo(PyObject* self, PyObject* args, PyObject* if (info.m_jointName) { PyTuple_SetItem(pyListJointInfo, 1, - PyString_FromString(info.m_jointName)); + PyString_FromString(info.m_jointName)); } else { PyTuple_SetItem(pyListJointInfo, 1, @@ -4754,21 +4754,21 @@ static PyObject* pybullet_loadTexture(PyObject* self, PyObject* args, PyObject* static PyObject* MyConvertContactPoint(struct b3ContactInformation* contactPointPtr) { /* - 0 int m_contactFlags; - 1 int m_bodyUniqueIdA; - 2 int m_bodyUniqueIdB; - 3 int m_linkIndexA; - 4 int m_linkIndexB; - 5 double m_positionOnAInWS[3];//contact point location on object A, - in world space coordinates - 6 double m_positionOnBInWS[3];//contact point location on object - A, in world space coordinates - 7 double m_contactNormalOnBInWS[3];//the separating contact - normal, pointing from object B towards object A - 8 double m_contactDistance;//negative number is penetration, positive - is distance. - 9 double m_normalForce; - */ + 0 int m_contactFlags; + 1 int m_bodyUniqueIdA; + 2 int m_bodyUniqueIdB; + 3 int m_linkIndexA; + 4 int m_linkIndexB; + 5 double m_positionOnAInWS[3];//contact point location on object A, + in world space coordinates + 6 double m_positionOnBInWS[3];//contact point location on object + A, in world space coordinates + 7 double m_contactNormalOnBInWS[3];//the separating contact + normal, pointing from object B towards object A + 8 double m_contactDistance;//negative number is penetration, positive + is distance. + 9 double m_normalForce; + */ int i; @@ -5559,9 +5559,9 @@ static PyObject* pybullet_getContactPointData(PyObject* self, PyObject* args, Py { int bodyUniqueIdA = -1; int bodyUniqueIdB = -1; - int linkIndexA = -2; - int linkIndexB = -2; - + int linkIndexA = -2; + int linkIndexB = -2; + b3SharedMemoryCommandHandle commandHandle; struct b3ContactInformation contactPointData; b3SharedMemoryStatusHandle statusHandle; @@ -5583,24 +5583,24 @@ static PyObject* pybullet_getContactPointData(PyObject* self, PyObject* args, Py } commandHandle = b3InitRequestContactPointInformation(sm); - if (bodyUniqueIdA>=0) - { - b3SetContactFilterBodyA(commandHandle, bodyUniqueIdA); - } - if (bodyUniqueIdB>=0) - { - b3SetContactFilterBodyB(commandHandle, bodyUniqueIdB); - } + if (bodyUniqueIdA>=0) + { + b3SetContactFilterBodyA(commandHandle, bodyUniqueIdA); + } + if (bodyUniqueIdB>=0) + { + b3SetContactFilterBodyB(commandHandle, bodyUniqueIdB); + } - if (linkIndexA>=-1) - { - b3SetContactFilterLinkA( commandHandle, linkIndexA); - } - if (linkIndexB >=-1) - { - b3SetContactFilterLinkB( commandHandle, linkIndexB); - } - + if (linkIndexA>=-1) + { + b3SetContactFilterLinkA( commandHandle, linkIndexA); + } + if (linkIndexB >=-1) + { + b3SetContactFilterLinkB( commandHandle, linkIndexB); + } + statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle); statusType = b3GetStatusType(statusHandle); if (statusType == CMD_CONTACT_POINT_INFORMATION_COMPLETED) @@ -6574,7 +6574,7 @@ static PyObject* pybullet_invertTransform(PyObject* self, PyErr_SetString(SpamError, "Invalid input: expected position [x,y,z] and orientation [x,y,z,w]."); return NULL; } - + /// quaternion <-> euler yaw/pitch/roll convention from URDF/SDF, see Gazebo /// https://github.com/arpg/Gazebo/blob/master/gazebo/math/Quaternion.cc @@ -6831,8 +6831,7 @@ static PyObject* pybullet_calculateInverseKinematics(PyObject* self, /// Given an object id, joint positions, joint velocities and joint /// accelerations, /// compute the joint forces using Inverse Dynamics -static PyObject* pybullet_calculateInverseDynamics(PyObject* self, - PyObject* args, PyObject* keywds) +static PyObject* pybullet_calculateInverseDynamics(PyObject* self, PyObject* args, PyObject* keywds) { { int bodyUniqueId; @@ -6841,14 +6840,21 @@ static PyObject* pybullet_calculateInverseDynamics(PyObject* self, PyObject* objAccelerations; int physicsClientId = 0; b3PhysicsClientHandle sm = 0; - static char* kwlist[] = {"bodyUniqueId", "objPositions", "objVelocities", "objAccelerations", "physicsClientId", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "iOOO|i", kwlist, &bodyUniqueId, &objPositionsQ, - &objVelocitiesQdot, &objAccelerations, &physicsClientId)) + static char* kwlist[] = {"bodyUniqueId", "objPositions", + "objVelocities", "objAccelerations", + "physicsClientId", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "iOOO|i", kwlist, + &bodyUniqueId, &objPositionsQ, + &objVelocitiesQdot, &objAccelerations, + &physicsClientId)) { - static char* kwlist2[] = {"bodyIndex", "objPositions", "objVelocities", "objAccelerations", "physicsClientId", NULL}; + static char* kwlist2[] = {"bodyIndex", "objPositions", + "objVelocities", "objAccelerations", + "physicsClientId", NULL}; PyErr_Clear(); - if (!PyArg_ParseTupleAndKeywords(args, keywds, "iOOO|i", kwlist2, &bodyUniqueId, &objPositionsQ, - &objVelocitiesQdot, &objAccelerations, &physicsClientId)) + if (!PyArg_ParseTupleAndKeywords(args, keywds, "iOOO|i", kwlist2, + &bodyUniqueId, &objPositionsQ, &objVelocitiesQdot, + &objAccelerations, &physicsClientId)) { return NULL; } @@ -6947,6 +6953,147 @@ static PyObject* pybullet_calculateInverseDynamics(PyObject* self, return Py_None; } +/// Given an object id, joint positions, joint velocities and joint +/// accelerations, +/// compute the joint forces using Inverse Dynamics +static PyObject* pybullet_calculateJacobian(PyObject* self, PyObject* args, PyObject* keywds) +{ + { + int bodyUniqueId; + int linkIndex; + PyObject* localPosition; + PyObject* objPositions; + PyObject* objVelocities; + PyObject* objAccelerations; + int physicsClientId = 0; + b3PhysicsClientHandle sm = 0; + static char* kwlist[] = {"bodyUniqueId", "linkIndex", "localPosition", + "objPositions", "objVelocities", + "objAccelerations", "physicsClientId", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiOOOO|i", kwlist, + &bodyUniqueId, &linkIndex, &localPosition, &objPositions, + &objVelocities, &objAccelerations, &physicsClientId)) + { + return NULL; + } + sm = getPhysicsClient(physicsClientId); + if (sm == 0) + { + PyErr_SetString(SpamError, "Not connected to physics server."); + return NULL; + } + + { + int szLoPos = PySequence_Size(localPosition); + int szObPos = PySequence_Size(objPositions); + int szObVel = PySequence_Size(objVelocities); + int szObAcc = PySequence_Size(objAccelerations); + int numJoints = b3GetNumJoints(sm, bodyUniqueId); + if (numJoints && (szLoPos == 3) && (szObPos == numJoints) && + (szObVel == numJoints) && (szObAcc == numJoints)) + { + int byteSizeJoints = sizeof(double) * numJoints; + int byteSizeVec3 = sizeof(double) * 3; + int i; + PyObject* pyResultList = PyTuple_New(2); + double* localPoint = (double*)malloc(byteSizeVec3); + double* jointPositions = (double*)malloc(byteSizeJoints); + double* jointVelocities = (double*)malloc(byteSizeJoints); + double* jointAccelerations = (double*)malloc(byteSizeJoints); + double* linearJacobian = (double*)malloc(3 * byteSizeJoints); + double* angularJacobian = (double*)malloc(3 * byteSizeJoints); + + pybullet_internalSetVectord(localPosition, localPoint); + for (i = 0; i < numJoints; i++) + { + jointPositions[i] = + pybullet_internalGetFloatFromSequence(objPositions, i); + jointVelocities[i] = + pybullet_internalGetFloatFromSequence(objVelocities, i); + jointAccelerations[i] = + pybullet_internalGetFloatFromSequence(objAccelerations, i); + } + { + b3SharedMemoryStatusHandle statusHandle; + b3SharedMemoryCommandHandle commandHandle = + b3CalculateJacobianCommandInit(sm, bodyUniqueId, + linkIndex, localPoint, jointPositions, + jointVelocities, jointAccelerations); + statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle); + int statusType = b3GetStatusType(statusHandle); + if (statusType == CMD_CALCULATED_JACOBIAN_COMPLETED) + { + int dofCount; + b3GetStatusJacobian(statusHandle, &dofCount, NULL, NULL); + if (dofCount) + { + int byteSizeDofCount = sizeof(double) * dofCount; + double* linearJacobian = (double*)malloc(3 * byteSizeDofCount); + double* angularJacobian = (double*)malloc(3 * byteSizeDofCount); + b3GetStatusJacobian(statusHandle, + NULL, + linearJacobian, + angularJacobian); + if (linearJacobian) + { + PyObject* pymat = PyTuple_New(3); + for (int r = 0; r < 3; ++r) { + PyObject* pyrow = PyTuple_New(dofCount); + for (int c = 0; c < dofCount; ++c) { + int element = r * dofCount + c; + PyTuple_SetItem(pyrow, c, + PyFloat_FromDouble(linearJacobian[element])); + } + PyTuple_SetItem(pymat, r, pyrow); + } + PyTuple_SetItem(pyResultList, 0, pymat); + } + if (angularJacobian) + { + PyObject* pymat = PyTuple_New(3); + for (int r = 0; r < 3; ++r) { + PyObject* pyrow = PyTuple_New(dofCount); + for (int c = 0; c < dofCount; ++c) { + int element = r * dofCount + c; + PyTuple_SetItem(pyrow, c, + PyFloat_FromDouble(linearJacobian[element])); + } + PyTuple_SetItem(pymat, r, pyrow); + } + PyTuple_SetItem(pyResultList, 1, pymat); + } + } + } + else + { + PyErr_SetString(SpamError, + "Internal error in calculateJacobian"); + } + } + free(localPoint); + free(jointPositions); + free(jointVelocities); + free(jointAccelerations); + free(linearJacobian); + free(angularJacobian); + if (pyResultList) return pyResultList; + } + else + { + PyErr_SetString(SpamError, + "calculateJacobian [numJoints] needs to be " + "positive, [local position] needs to be of " + "size 3 and [joint positions], " + "[joint velocities], [joint accelerations] " + "need to match the number of joints."); + return NULL; + } + } + } + Py_INCREF(Py_None); + return Py_None; +} + static PyMethodDef SpamMethods[] = { {"connect", (PyCFunction)pybullet_connectPhysicsServer, METH_VARARGS | METH_KEYWORDS, @@ -6985,6 +7132,8 @@ static PyMethodDef SpamMethods[] = { "This is for experimental purposes, use at own risk, magic may or not happen"}, {"loadURDF", (PyCFunction)pybullet_loadURDF, METH_VARARGS | METH_KEYWORDS, + "bodyUniqueId = loadURDF(fileName, basePosition=[0.,0.,0.], baseOrientation=[0.,0.,0.,1.], " + "useMaximalCoordinates=0, useFixedBase=0, flags=0, globalScaling=1.0, physicsClientId=0)\n" "Create a multibody by loading a URDF file."}, {"loadSDF", (PyCFunction)pybullet_loadSDF, METH_VARARGS | METH_KEYWORDS, @@ -7233,6 +7382,19 @@ static PyMethodDef SpamMethods[] = { "Given an object id, joint positions, joint velocities and joint " "accelerations, compute the joint forces using Inverse Dynamics"}, + {"calculateJacobian", (PyCFunction)pybullet_calculateJacobian, METH_VARARGS | METH_KEYWORDS, + "Compute the jacobian for a specified local position on a body and its kinematics.\n" + "Args:\n" + " bodyIndex - a scalar defining the unique object id.\n" + " linkIndex - a scalar identifying the link containing the local point.\n" + " localPosition - a list of [x, y, z] of the coordinates of the local point.\n" + " objPositions - a list of the joint positions.\n" + " objVelocities - a list of the joint velocities.\n" + " objAccelerations - a list of the joint accelerations.\n" + "Returns:\n" + " linearJacobian - a list of the partial linear velocities of the jacobian.\n" + " angularJacobian - a list of the partial angular velocities of the jacobian.\n"}, + {"calculateInverseKinematics", (PyCFunction)pybullet_calculateInverseKinematics, METH_VARARGS | METH_KEYWORDS, "Inverse Kinematics bindings: Given an object id, " diff --git a/src/BulletInverseDynamics/IDMath.cpp b/src/BulletInverseDynamics/IDMath.cpp index 021217a17..ecd62f76d 100644 --- a/src/BulletInverseDynamics/IDMath.cpp +++ b/src/BulletInverseDynamics/IDMath.cpp @@ -69,7 +69,7 @@ idScalar maxAbsMat3x(const mat3x &m) { void mul(const mat33 &a, const mat3x &b, mat3x *result) { if (b.cols() != result->cols()) { - error_message("size missmatch. a.cols()= %d, b.cols()= %d\n", + error_message("size missmatch. b.cols()= %d, result->cols()= %d\n", static_cast(b.cols()), static_cast(result->cols())); abort(); } diff --git a/src/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp b/src/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp index 847e5c6c7..b35c55df6 100644 --- a/src/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp +++ b/src/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp @@ -1013,7 +1013,7 @@ int MultiBodyTree::MultiBodyImpl::getBodyDotJacobianRotU(const int body_index, int MultiBodyTree::MultiBodyImpl::getBodyJacobianTrans(const int body_index, mat3x* world_jac_trans) const{ CHECK_IF_BODY_INDEX_IS_VALID(body_index); const RigidBody &body = m_body_list[body_index]; - mul(body.m_body_T_world.transpose(), body.m_body_Jac_T,world_jac_trans); + mul(body.m_body_T_world.transpose(), body.m_body_Jac_T, world_jac_trans); return 0; } From e95a15dabe31df38f2b9b00ca68b0540520ccbb9 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 23 Sep 2017 20:58:14 -0700 Subject: [PATCH 16/38] Revert "Cmake pybullet fix" --- CMakeLists.txt | 23 +++-------------------- build3/cmake/FindPythonLibs.cmake | 15 +++++---------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d692e89b..8e5f009df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,25 +301,8 @@ IF (APPLE) ENDIF() OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON) -# Optional Python configuration -# builds pybullet automatically if all the requirements are met -SET(PYTHON_VERSION_PYBULLET "2.7" CACHE STRING "Python version pybullet will use.") -SET(Python_ADDITIONAL_VERSIONS 2.7 2.7.3 2.7.12 3 3.0 3.1 3.2 3.3 3.4 3.5 3.6) -SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS}) -SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH}) -OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF) -IF(EXACT_PYTHON_VERSION) - set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED) -ENDIF(EXACT_PYTHON_VERSION) -# first find the python interpreter -FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG}) -# python library should exactly match that of the interpreter -FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT) -SET(DEFAULT_BUILD_PYBULLET OFF) -IF(PYTHONLIBS_FOUND) - SET(DEFAULT_BUILD_PYBULLET ON) -ENDIF(PYTHONLIBS_FOUND) -OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" ${DEFAULT_BUILD_PYBULLET}) + +OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" OFF) OPTION(BUILD_ENET "Set when you want to build apps with enet UDP networking support" ON) OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking support" ON) @@ -327,7 +310,7 @@ OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking IF(BUILD_PYBULLET) FIND_PACKAGE(PythonLibs) - + OPTION(BUILD_PYBULLET_NUMPY "Set when you want to build pybullet with NumPy support" OFF) OPTION(BUILD_PYBULLET_ENET "Set when you want to build pybullet with enet UDP networking support" ON) OPTION(BUILD_PYBULLET_CLSOCKET "Set when you want to build pybullet with enet TCP networking support" ON) diff --git a/build3/cmake/FindPythonLibs.cmake b/build3/cmake/FindPythonLibs.cmake index b0bcd839c..a0e9bffbe 100644 --- a/build3/cmake/FindPythonLibs.cmake +++ b/build3/cmake/FindPythonLibs.cmake @@ -64,7 +64,7 @@ if(EXISTS "${PYTHON_INCLUDE_DIR}" AND EXISTS "${PYTHON_LIBRARY}") else() set(_PYTHON1_VERSIONS 1.6 1.5) set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) - set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0) + set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0) unset(_PYTHON_FIND_OTHER_VERSIONS) if(PythonLibs_FIND_VERSION) @@ -176,13 +176,12 @@ else() FIND_LIBRARY(PYTHON_LIBRARY NAMES ${_PYTHON_LIBRARY_NAMES} PATH_SUFFIXES - "python${_PYTHON_SHORT_VERSION}/config" - "python${_PYTHON_SHORT_VERSION_NO_DOT}/config" + python${_PYTHON_SHORT_VERSION}/config + python${_PYTHON_SHORT_VERSION_NO_DOT}/config PATHS ${_PYTHON_LIBRARY_DIR} - ${_PYTHON_PREFIX}/lib - ${_PYTHON_PREFIX}/libs - ${_PYTHON_LIBRARY_DIR}/x86_64-linux-gnu/ + ${_PYTHON_PREFIX}/lib $ + {_PYTHON_PREFIX}/libs NO_DEFAULT_PATH) if(WIN32) @@ -255,10 +254,6 @@ set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}") set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}") include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(PYTHON) - -if(PYTHON_LIBRARY AND NOT PYTHON_LIBRARIES) - set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") -endif() # SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library. # Unset this, this prefix doesn't match the module prefix, they are different # for historical reasons. From 63ee841bea00c7ddb256e29443c2fd2834813d32 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 23 Sep 2017 21:01:56 -0700 Subject: [PATCH 17/38] trigger build system --- examples/SharedMemory/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/SharedMemory/CMakeLists.txt b/examples/SharedMemory/CMakeLists.txt index 5883ce1fa..c479f7db3 100644 --- a/examples/SharedMemory/CMakeLists.txt +++ b/examples/SharedMemory/CMakeLists.txt @@ -1,5 +1,4 @@ - SET(SharedMemory_SRCS IKTrajectoryHelper.cpp IKTrajectoryHelper.h From b1d6f58981573c3a7ef38278b5bac44c5e7ae426 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sun, 24 Sep 2017 09:16:54 -0700 Subject: [PATCH 18/38] Update pybullet.c fix compile issue --- examples/pybullet/pybullet.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 9290df7dc..630135eae 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -7036,10 +7036,12 @@ static PyObject* pybullet_calculateJacobian(PyObject* self, PyObject* args, PyOb angularJacobian); if (linearJacobian) { + int r; PyObject* pymat = PyTuple_New(3); - for (int r = 0; r < 3; ++r) { + for (r = 0; r < 3; ++r) { + int c; PyObject* pyrow = PyTuple_New(dofCount); - for (int c = 0; c < dofCount; ++c) { + for (c = 0; c < dofCount; ++c) { int element = r * dofCount + c; PyTuple_SetItem(pyrow, c, PyFloat_FromDouble(linearJacobian[element])); @@ -7050,10 +7052,12 @@ static PyObject* pybullet_calculateJacobian(PyObject* self, PyObject* args, PyOb } if (angularJacobian) { + int r; PyObject* pymat = PyTuple_New(3); - for (int r = 0; r < 3; ++r) { + for (r = 0; r < 3; ++r) { + int c; PyObject* pyrow = PyTuple_New(dofCount); - for (int c = 0; c < dofCount; ++c) { + for (c = 0; c < dofCount; ++c) { int element = r * dofCount + c; PyTuple_SetItem(pyrow, c, PyFloat_FromDouble(linearJacobian[element])); From ebf78cb75452e536ba29cb0f2b1ee067fac706f0 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 Sep 2017 10:45:08 -0700 Subject: [PATCH 19/38] manually apply pull request 457 PR #457 Thanks to aaronmjacobs! --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e5f009df..f1d17027b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,7 +449,11 @@ configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/BulletConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake @ONLY ESCAPE_QUOTES ) -install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/UseBullet.cmake +OPTION(INSTALL_CMAKE_FILES "Install generated CMake files" ON) + +IF (INSTALL_CMAKE_FILES) + install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/UseBullet.cmake ${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake DESTINATION ${BULLET_CONFIG_CMAKE_PATH} ) +ENDIF (INSTALL_CMAKE_FILES) From 70974c76da6ed6227ee5b0e28e09e541ba8b7196 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sun, 24 Sep 2017 11:41:24 -0700 Subject: [PATCH 20/38] add a few more contributors (the list is far from complete though) --- AUTHORS.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 556e6f641..1bff63207 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -2,17 +2,21 @@ Bullet Physics is created by Erwin Coumans with contributions from the following AMD Apple +Yunfei Bai Steve Baker Gino van den Bergen +Jeff Bingham Nicola Candussi Erin Catto Lawrence Chai Erwin Coumans -Christer Ericson Disney Animation +Benjamin Ellenberger +Christer Ericson Google Dirk Gregorius Marcus Hennix +Jasmine Hsu MBSim Development Team Takahiro Harada Simon Hobbs @@ -20,6 +24,7 @@ John Hsu Ole Kniemeyer Jay Lee Francisco Leon +lunkhound Vsevolod Klementjev Phil Knight John McCutchan @@ -32,9 +37,9 @@ Russel Smith Sony Jakub Stephien Marten Svanfeldt +Jie Tan Pierre Terdiman Steven Thompson Tamas Umenhoffer -Yunfei Bai If your name is missing, please send an email to erwin.coumans@gmail.com or file an issue at http://github.com/bulletphysics/bullet3 From 97509dc9d0261173ef19a023ee3661a8f4b4f870 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 Sep 2017 16:10:14 -0700 Subject: [PATCH 21/38] add some missing files for premake, thanks to Jeff Bingham for the report --- examples/SharedMemory/tcp/premake4.lua | 2 ++ examples/SharedMemory/udp/premake4.lua | 2 ++ test/SharedMemory/premake4.lua | 1 + 3 files changed, 5 insertions(+) diff --git a/examples/SharedMemory/tcp/premake4.lua b/examples/SharedMemory/tcp/premake4.lua index 6df7cd949..9c940402e 100644 --- a/examples/SharedMemory/tcp/premake4.lua +++ b/examples/SharedMemory/tcp/premake4.lua @@ -89,6 +89,8 @@ myfiles = "../PhysicsServerCommandProcessor.cpp", "../PhysicsServerCommandProcessor.h", "../b3PluginManager.cpp", + "../PhysicsDirect.cpp", + "../PhysicsClient.cpp", "../TinyRendererVisualShapeConverter.cpp", "../TinyRendererVisualShapeConverter.h", "../../TinyRenderer/geometry.cpp", diff --git a/examples/SharedMemory/udp/premake4.lua b/examples/SharedMemory/udp/premake4.lua index 3e5e4120b..26aeebc0b 100644 --- a/examples/SharedMemory/udp/premake4.lua +++ b/examples/SharedMemory/udp/premake4.lua @@ -80,6 +80,8 @@ myfiles = "../PhysicsServerCommandProcessor.cpp", "../PhysicsServerCommandProcessor.h", "../b3PluginManager.cpp", + "../PhysicsDirect.cpp", + "../PhysicsClient.cpp", "../TinyRendererVisualShapeConverter.cpp", "../TinyRendererVisualShapeConverter.h", "../../TinyRenderer/geometry.cpp", diff --git a/test/SharedMemory/premake4.lua b/test/SharedMemory/premake4.lua index 40c0d6f42..85b74ccfb 100644 --- a/test/SharedMemory/premake4.lua +++ b/test/SharedMemory/premake4.lua @@ -178,6 +178,7 @@ project ("Test_PhysicsServerLoopBack") "../../examples/SharedMemory/PhysicsServerCommandProcessor.cpp", "../../examples/SharedMemory/PhysicsServerCommandProcessor.h", "../../examples/SharedMemory/b3PluginManager.cpp", + "../../examples/SharedMemory/PhysicsDirect.cpp", "../../examples/SharedMemory/PhysicsLoopBack.cpp", "../../examples/SharedMemory/PhysicsLoopBack.h", "../../examples/SharedMemory/PhysicsLoopBackC_API.cpp", From ee30ca93c50fa9f43c7ac51c136815e775df51c2 Mon Sep 17 00:00:00 2001 From: Jeffrey Bingham Date: Sun, 24 Sep 2017 14:14:24 -0700 Subject: [PATCH 22/38] [sharedmemory] Fill-out calculateJacobian command. The server command processor actually didn't do anything with the local point that was passed along with the calculateJacobian command. Added in the necessary bit of math to return the corresponding jacobian. Also, fixed a typo in pybullet that was returning the same jacobian for translation and rotation. --- .../PhysicsServerCommandProcessor.cpp | 23 +++++++++++++++++++ examples/pybullet/pybullet.c | 11 ++++++++- src/BulletInverseDynamics/IDMath.cpp | 12 ++++++++++ src/BulletInverseDynamics/IDMath.hpp | 3 ++- 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 47dff31b3..970967b40 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -6639,9 +6639,32 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm tree->calculateJacobians(q); btInverseDynamics::mat3x jac_t(3, numDofs + baseDofs); btInverseDynamics::mat3x jac_r(3, numDofs + baseDofs); + // Note that inverse dynamics uses zero-based indexing of bodies, not starting from -1 for the base link. tree->getBodyJacobianTrans(clientCmd.m_calculateJacobianArguments.m_linkIndex + 1, &jac_t); tree->getBodyJacobianRot(clientCmd.m_calculateJacobianArguments.m_linkIndex + 1, &jac_r); + // Update the translational jacobian based on the desired local point. + // v_pt = v_frame + w x pt + // v_pt = J_t * qd + (J_r * qd) x pt + // v_pt = J_t * qd - pt x (J_r * qd) + // v_pt = J_t * qd - pt_x * J_r * qd) + // v_pt = (J_t - pt_x * J_r) * qd + // J_t_new = J_t - pt_x * J_r + btInverseDynamics::vec3 localPosition; + for (int i = 0; i < 3; ++i) { + localPosition(i) = clientCmd.m_calculateJacobianArguments.m_localPosition[i]; + } + // Only calculate if the localPosition is non-zero. + if (btInverseDynamics::maxAbs(localPosition) > 0.0) { + btInverseDynamics::mat33 skewCrossProduct; + btInverseDynamics::skew(localPosition, &skewCrossProduct); + btInverseDynamics::mat3x jac_l(3, numDofs + baseDofs); + btInverseDynamics::mul(skewCrossProduct, jac_r, &jac_l); + btInverseDynamics::mat3x jac_t_new(3, numDofs + baseDofs); + btInverseDynamics::sub(jac_t, jac_l, &jac_t_new); + jac_t = jac_t_new; + } + // Fill in the result into the shared memory. for (int i = 0; i < 3; ++i) { for (int j = 0; j < (numDofs + baseDofs); ++j) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index dea5e306a..5a4c4cda0 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -7184,7 +7184,7 @@ static PyObject* pybullet_calculateJacobian(PyObject* self, PyObject* args, PyOb for (c = 0; c < dofCount; ++c) { int element = r * dofCount + c; PyTuple_SetItem(pyrow, c, - PyFloat_FromDouble(linearJacobian[element])); + PyFloat_FromDouble(angularJacobian[element])); } PyTuple_SetItem(pymat, r, pyrow); } @@ -7225,31 +7225,40 @@ static PyObject* pybullet_calculateJacobian(PyObject* self, PyObject* args, PyOb static PyMethodDef SpamMethods[] = { {"connect", (PyCFunction)pybullet_connectPhysicsServer, METH_VARARGS | METH_KEYWORDS, + "connect(method, key=SHARED_MEMORY_KEY, options='')\n" + "connect(method, hostname='localhost', port=1234, options='')\n" "Connect to an existing physics server (using shared memory by default)."}, {"disconnect", (PyCFunction)pybullet_disconnectPhysicsServer, METH_VARARGS | METH_KEYWORDS, + "disconnect(physicsClientId=0)\n" "Disconnect from the physics server."}, {"resetSimulation", (PyCFunction)pybullet_resetSimulation, METH_VARARGS | METH_KEYWORDS, + "resetSimulation(physicsClientId=0)\n" "Reset the simulation: remove all objects and start from an empty world."}, {"stepSimulation", (PyCFunction)pybullet_stepSimulation, METH_VARARGS | METH_KEYWORDS, + "stepSimulation(physicsClientId=0)\n" "Step the simulation using forward dynamics."}, {"setGravity", (PyCFunction)pybullet_setGravity, METH_VARARGS | METH_KEYWORDS, + "setGravity(gravX, gravY, gravZ, physicsClientId=0)\n" "Set the gravity acceleration (x,y,z)."}, {"setTimeStep", (PyCFunction)pybullet_setTimeStep, METH_VARARGS | METH_KEYWORDS, + "setTimeStep(timestep, physicsClientId=0)\n" "Set the amount of time to proceed at each call to stepSimulation. (unit " "is seconds, typically range is 0.01 or 0.001)"}, {"setDefaultContactERP", (PyCFunction)pybullet_setDefaultContactERP, METH_VARARGS | METH_KEYWORDS, + "setDefaultContactERP(defaultContactERP, physicsClientId=0)\n" "Set the amount of contact penetration Error Recovery Paramater " "(ERP) in each time step. \ This is an tuning parameter to control resting contact stability. " "This value depends on the time step."}, {"setRealTimeSimulation", (PyCFunction)pybullet_setRealTimeSimulation, METH_VARARGS | METH_KEYWORDS, + "setRealTimeSimulation(enableRealTimeSimulation, physicsClientId=0)\n" "Enable or disable real time simulation (using the real time clock," " RTC) in the physics server. Expects one integer argument, 0 or 1"}, diff --git a/src/BulletInverseDynamics/IDMath.cpp b/src/BulletInverseDynamics/IDMath.cpp index ecd62f76d..99fe20e49 100644 --- a/src/BulletInverseDynamics/IDMath.cpp +++ b/src/BulletInverseDynamics/IDMath.cpp @@ -33,6 +33,18 @@ void setZero(mat33 &m) { m(2, 2) = 0; } +void skew(vec3& v, mat33* result) { + (*result)(0, 0) = 0.0; + (*result)(0, 1) = -v(2); + (*result)(0, 2) = v(1); + (*result)(1, 0) = v(2); + (*result)(1, 1) = 0.0; + (*result)(1, 2) = -v(0); + (*result)(2, 0) = -v(1); + (*result)(2, 1) = v(0); + (*result)(2, 2) = 0.0; +} + idScalar maxAbs(const vecx &v) { idScalar result = 0.0; for (int i = 0; i < v.size(); i++) { diff --git a/src/BulletInverseDynamics/IDMath.hpp b/src/BulletInverseDynamics/IDMath.hpp index 63699712a..b355474d4 100644 --- a/src/BulletInverseDynamics/IDMath.hpp +++ b/src/BulletInverseDynamics/IDMath.hpp @@ -12,7 +12,8 @@ void setZero(vec3& v); void setZero(vecx& v); /// set all elements to zero void setZero(mat33& m); - +/// create a skew symmetric matrix from a vector (useful for cross product abstraction, e.g. v x a = V * a) +void skew(vec3& v, mat33* result); /// return maximum absolute value idScalar maxAbs(const vecx& v); #ifndef ID_LINEAR_MATH_USE_EIGEN From 2d91e1388618c3ccb18723737cb77435cc13bd89 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 Sep 2017 21:37:31 -0700 Subject: [PATCH 23/38] tweak pybullet examples a bit (mac OSX OpenGL runs in mainloop, with python interpreter, so it needs some 'ping' command bump up pybullet to version 1.4.6 --- examples/pybullet/examples/mimicJointConstraint.py | 3 ++- examples/pybullet/examples/quadruped.py | 1 + examples/pybullet/examples/vr_kuka_setup.py | 10 +++++++++- setup.py | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/pybullet/examples/mimicJointConstraint.py b/examples/pybullet/examples/mimicJointConstraint.py index 60a0625d9..968a24354 100644 --- a/examples/pybullet/examples/mimicJointConstraint.py +++ b/examples/pybullet/examples/mimicJointConstraint.py @@ -23,6 +23,7 @@ p.changeConstraint(c,gearRatio=-1, maxForce=10000) p.setRealTimeSimulation(1) while(1): + p.setGravity(0,0,-10) time.sleep(0.01) #p.removeConstraint(c) - \ No newline at end of file + diff --git a/examples/pybullet/examples/quadruped.py b/examples/pybullet/examples/quadruped.py index 19527fa47..7e3ee1262 100644 --- a/examples/pybullet/examples/quadruped.py +++ b/examples/pybullet/examples/quadruped.py @@ -187,6 +187,7 @@ t = 0.0 t_end = t + 15 ref_time = time.time() while (t Date: Sun, 24 Sep 2017 22:39:20 -0700 Subject: [PATCH 24/38] Update b3PluginManager.cpp pre/post tick were wrong order in initializer list --- examples/SharedMemory/b3PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp index 3210e94b2..a11063b43 100644 --- a/examples/SharedMemory/b3PluginManager.cpp +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -48,8 +48,8 @@ struct b3Plugin m_initFunc(0), m_exitFunc(0), m_executeCommandFunc(0), - m_postTickFunc(0), m_preTickFunc(0), + m_postTickFunc(0), m_userPointer(0) { } From d3d1b51c3a7c8b8b3685de4b09baba2a78400830 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 Sep 2017 23:26:06 -0700 Subject: [PATCH 25/38] fix compile warnings --- examples/SharedMemory/PhysicsClientC_API.cpp | 26 ++++++++++---------- examples/SharedMemory/PhysicsClientC_API.h | 20 +++++++-------- examples/SharedMemory/b3PluginManager.cpp | 2 +- examples/SharedMemory/b3PluginManager.h | 2 +- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 7ec282897..a7eb18097 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -1680,20 +1680,20 @@ B3_SHARED_API int b3GetNumUserConstraints(b3PhysicsClientHandle physClient) return cl->getNumUserConstraints(); } -B3_SHARED_API int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* infoPtr) +B3_SHARED_API int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* info) { PhysicsClient* cl = (PhysicsClient* ) physClient; b3UserConstraint constraintInfo1; b3Assert(physClient); - b3Assert(infoPtr); + b3Assert(info); b3Assert(constraintUniqueId>=0); - if (infoPtr==0) + if (info==0) return 0; if (cl->getUserConstraintInfo(constraintUniqueId, constraintInfo1)) { - *infoPtr = constraintInfo1; + *info = constraintInfo1; return 1; } return 0; @@ -2049,7 +2049,7 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3P return (b3SharedMemoryCommandHandle)command; } -B3_SHARED_API int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double pivotInB[3]) +B3_SHARED_API int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, double jointChildPivot[]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2059,12 +2059,12 @@ B3_SHARED_API int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHan command->m_updateFlags |= USER_CONSTRAINT_CHANGE_PIVOT_IN_B; - command->m_userConstraintArguments.m_childFrame[0] = pivotInB[0]; - command->m_userConstraintArguments.m_childFrame[1] = pivotInB[1]; - command->m_userConstraintArguments.m_childFrame[2] = pivotInB[2]; + command->m_userConstraintArguments.m_childFrame[0] = jointChildPivot[0]; + command->m_userConstraintArguments.m_childFrame[1] = jointChildPivot[1]; + command->m_userConstraintArguments.m_childFrame[2] = jointChildPivot[2]; return 0; } -B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double frameOrnInB[4]) +B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, double jointChildFrameOrn[]) { struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; b3Assert(command); @@ -2073,10 +2073,10 @@ B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHan command->m_updateFlags |= USER_CONSTRAINT_CHANGE_FRAME_ORN_IN_B; - command->m_userConstraintArguments.m_childFrame[3] = frameOrnInB[0]; - command->m_userConstraintArguments.m_childFrame[4] = frameOrnInB[1]; - command->m_userConstraintArguments.m_childFrame[5] = frameOrnInB[2]; - command->m_userConstraintArguments.m_childFrame[6] = frameOrnInB[3]; + command->m_userConstraintArguments.m_childFrame[3] = jointChildFrameOrn[0]; + command->m_userConstraintArguments.m_childFrame[4] = jointChildFrameOrn[1]; + command->m_userConstraintArguments.m_childFrame[5] = jointChildFrameOrn[2]; + command->m_userConstraintArguments.m_childFrame[6] = jointChildFrameOrn[3]; return 0; } diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index 3aa31e3d8..4b686cec0 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -104,7 +104,7 @@ B3_SHARED_API int b3GetBodyUniqueId(b3PhysicsClientHandle physClient, int serial B3_SHARED_API int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3BodyInfo* info); ///give a unique body index (after loading the body) return the number of joints. -B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyIndex); +B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyId); ///given a body and joint index, return the joint information. See b3JointInfo in SharedMemoryPublic.h B3_SHARED_API int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyIndex, int jointIndex, struct b3JointInfo* info); @@ -187,8 +187,8 @@ B3_SHARED_API int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle ///request an image from a simulated camera, using a software renderer. B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient); -B3_SHARED_API void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle command, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]); -B3_SHARED_API void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle command, int width, int height ); +B3_SHARED_API void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle commandHandle, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]); +B3_SHARED_API void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle commandHandle, int width, int height ); B3_SHARED_API void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[/*3*/]); B3_SHARED_API void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[/*3*/]); B3_SHARED_API void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance); @@ -210,13 +210,13 @@ B3_SHARED_API void b3ComputeProjectionMatrixFOV(float fov, float aspect, float n /* obsolete, please use b3ComputeViewProjectionMatrices */ -B3_SHARED_API void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle command, const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/]); +B3_SHARED_API void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/]); /* obsolete, please use b3ComputeViewProjectionMatrices */ B3_SHARED_API void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis); /* obsolete, please use b3ComputeViewProjectionMatrices */ -B3_SHARED_API void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle command, float left, float right, float bottom, float top, float nearVal, float farVal); +B3_SHARED_API void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float left, float right, float bottom, float top, float nearVal, float farVal); /* obsolete, please use b3ComputeViewProjectionMatrices */ -B3_SHARED_API void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle command, float fov, float aspect, float nearVal, float farVal); +B3_SHARED_API void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float fov, float aspect, float nearVal, float farVal); ///request an contact point information @@ -225,7 +225,7 @@ B3_SHARED_API void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHa B3_SHARED_API void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB); B3_SHARED_API void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA); B3_SHARED_API void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB); -B3_SHARED_API void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo); +B3_SHARED_API void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData); ///compute the closest points between two bodies B3_SHARED_API b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle physClient); @@ -465,8 +465,8 @@ B3_SHARED_API void b3GetRaycastInformation(b3PhysicsClientHandle physClient, str /// Apply external force at the body (or link) center of mass, in world space/Cartesian coordinates. B3_SHARED_API b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient); -B3_SHARED_API void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[/*3*/], const double position[/*3*/], int flags); -B3_SHARED_API void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[/*3*/], int flags); +B3_SHARED_API void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[/*3*/], const double position[/*3*/], int flag); +B3_SHARED_API void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[/*3*/], int flag); ///experiments of robots interacting with non-rigid objects (such as btSoftBody) B3_SHARED_API b3SharedMemoryCommandHandle b3LoadBunnyCommandInit(b3PhysicsClientHandle physClient); @@ -505,7 +505,7 @@ B3_SHARED_API int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle B3_SHARED_API int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int logFlags); B3_SHARED_API int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle); -B3_SHARED_API int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUniqueId); +B3_SHARED_API int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUid); B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name); diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp index a11063b43..7f6052349 100644 --- a/examples/SharedMemory/b3PluginManager.cpp +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -2,7 +2,7 @@ #include "b3PluginManager.h" #include "Bullet3Common/b3HashMap.h" #include "Bullet3Common/b3ResizablePool.h" -#include "SharedMemoryPublic.h" +#include "PhysicsClientC_API.h" #include "PhysicsDirect.h" #include "plugins/b3PluginContext.h" diff --git a/examples/SharedMemory/b3PluginManager.h b/examples/SharedMemory/b3PluginManager.h index dd02b9630..6d4fa7ef1 100644 --- a/examples/SharedMemory/b3PluginManager.h +++ b/examples/SharedMemory/b3PluginManager.h @@ -16,7 +16,7 @@ class b3PluginManager void unloadPlugin(int pluginUniqueId); int executePluginCommand(int pluginUniqueId, const struct b3PluginArguments* arguments); void tickPlugins(double timeStep, bool isPreTick); - int registerStaticLinkedPlugin(const char* pluginPath, PFN_INIT initFunc,PFN_EXIT exitFunc, PFN_EXECUTE m_executeCommandFunc, PFN_TICK preTickFunc, PFN_TICK postTickFunc); + int registerStaticLinkedPlugin(const char* pluginPath, PFN_INIT initFunc,PFN_EXIT exitFunc, PFN_EXECUTE executeCommandFunc, PFN_TICK preTickFunc, PFN_TICK postTickFunc); }; From 0f30c95734da5c3316816b1d6f52b979d3cf1472 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 25 Sep 2017 07:38:00 -0700 Subject: [PATCH 26/38] fix a compile error on Windows (variables need to be declared together at the start of a block in C) --- examples/pybullet/pybullet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 5a4c4cda0..aa6c4c63c 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -7138,13 +7138,14 @@ static PyObject* pybullet_calculateJacobian(PyObject* self, PyObject* args, PyOb pybullet_internalGetFloatFromSequence(objAccelerations, i); } { - b3SharedMemoryStatusHandle statusHandle; + b3SharedMemoryStatusHandle statusHandle; + int statusType; b3SharedMemoryCommandHandle commandHandle = b3CalculateJacobianCommandInit(sm, bodyUniqueId, linkIndex, localPoint, jointPositions, jointVelocities, jointAccelerations); statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle); - int statusType = b3GetStatusType(statusHandle); + statusType = b3GetStatusType(statusHandle); if (statusType == CMD_CALCULATED_JACOBIAN_COMPLETED) { int dofCount; From 6d68a67c79fe43de235f44315a9f81249a008c0c Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 25 Sep 2017 11:11:48 -0700 Subject: [PATCH 27/38] fix a bug in a changeVisualShape/texture selection, out-of-bounds check was using the wrong array. May fix some internal texture mug bug. --- examples/OpenGLWindow/GLInstancingRenderer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/OpenGLWindow/GLInstancingRenderer.cpp b/examples/OpenGLWindow/GLInstancingRenderer.cpp index b89309aab..a92500af7 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.cpp +++ b/examples/OpenGLWindow/GLInstancingRenderer.cpp @@ -971,10 +971,10 @@ int GLInstancingRenderer::registerTexture(const unsigned char* texels, int width void GLInstancingRenderer::replaceTexture(int shapeIndex, int textureId) { - if (shapeIndex >=0 && shapeIndex < m_data->m_textureHandles.size()) + if ((shapeIndex >=0) && (shapeIndex < m_graphicsInstances.size())) { b3GraphicsInstance* gfxObj = m_graphicsInstances[shapeIndex]; - if (textureId>=0) + if (textureId>=0 && textureId < m_data->m_textureHandles.size()) { gfxObj->m_textureIndex = textureId; gfxObj->m_flags |= eGfxHasTexture; @@ -985,7 +985,7 @@ void GLInstancingRenderer::replaceTexture(int shapeIndex, int textureId) void GLInstancingRenderer::updateTexture(int textureIndex, const unsigned char* texels, bool flipPixelsY) { - if (textureIndex>=0) + if ((textureIndex>=0) && (textureIndex < m_data->m_textureHandles.size())) { glActiveTexture(GL_TEXTURE0); b3Assert(glGetError() ==GL_NO_ERROR); @@ -1027,7 +1027,7 @@ void GLInstancingRenderer::activateTexture(int textureIndex) { glActiveTexture(GL_TEXTURE0); - if (textureIndex>=0) + if (textureIndex>=0 && textureIndex < m_data->m_textureHandles.size()) { glBindTexture(GL_TEXTURE_2D,m_data->m_textureHandles[textureIndex].m_glTexture); } else From 270a036cd741038d4aabfa0fcf5bf98c1aa84069 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 25 Sep 2017 18:14:50 -0700 Subject: [PATCH 28/38] add experimental vrSyncPlugin, that syncs the position/orientation of a vr controller to a gripper (through a constraint) This is in C++ and the sync runs at the simulation speed (240 Hz), so there is less lag than in Python. Modify the pybullet/examples/vr_kuka_setup.py at the end to do this: plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_vrSyncPlugin_vs2010_x64_release.dll") controllerId = 3 p.executePluginCommand(plugin ,"bla", [controllerId,pr2_cid],[50]) --- examples/SharedMemory/PhysicsClientC_API.cpp | 4 +- .../plugins/vrSyncPlugin/premake4.lua | 42 +++++++ .../plugins/vrSyncPlugin/vrSyncPlugin.cpp | 116 ++++++++++++++++++ .../plugins/vrSyncPlugin/vrSyncPlugin.h | 25 ++++ examples/SharedMemory/premake4.lua | 3 + 5 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 examples/SharedMemory/plugins/vrSyncPlugin/premake4.lua create mode 100644 examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp create mode 100644 examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.h diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index a7eb18097..1ad7c41c1 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -1332,7 +1332,7 @@ B3_SHARED_API int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle phys command->m_updateFlags |=INIT_POSE_HAS_JOINT_STATE; b3JointInfo info; b3GetJointInfo(physClient, command->m_initPoseArgs.m_bodyUniqueId,jointIndex, &info); - btAssert((info.m_flags & JOINT_HAS_MOTORIZED_POWER) && info.m_qIndex >=0); + //btAssert((info.m_flags & JOINT_HAS_MOTORIZED_POWER) && info.m_qIndex >=0); if ((info.m_flags & JOINT_HAS_MOTORIZED_POWER) && info.m_qIndex >=0) { command->m_initPoseArgs.m_initialStateQ[info.m_qIndex] = jointPosition; @@ -1367,7 +1367,7 @@ B3_SHARED_API int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle phys command->m_updateFlags |=INIT_POSE_HAS_JOINT_VELOCITY; b3JointInfo info; b3GetJointInfo(physClient, command->m_initPoseArgs.m_bodyUniqueId,jointIndex, &info); - btAssert((info.m_flags & JOINT_HAS_MOTORIZED_POWER) && info.m_uIndex >=0); + //btAssert((info.m_flags & JOINT_HAS_MOTORIZED_POWER) && info.m_uIndex >=0); if ((info.m_flags & JOINT_HAS_MOTORIZED_POWER) && (info.m_uIndex >=0) && (info.m_uIndexm_initPoseArgs.m_initialStateQdot[info.m_uIndex] = jointVelocity; diff --git a/examples/SharedMemory/plugins/vrSyncPlugin/premake4.lua b/examples/SharedMemory/plugins/vrSyncPlugin/premake4.lua new file mode 100644 index 000000000..f23cc6c7e --- /dev/null +++ b/examples/SharedMemory/plugins/vrSyncPlugin/premake4.lua @@ -0,0 +1,42 @@ + + +project ("pybullet_vrSyncPlugin") + language "C++" + kind "SharedLib" + + includedirs {".","../../../../src", "../../../../examples", + "../../../ThirdPartyLibs"} + defines {"PHYSICS_IN_PROCESS_EXAMPLE_BROWSER"} + hasCL = findOpenCL("clew") + + links{"BulletFileLoader", "Bullet3Common", "LinearMath"} + + + if os.is("MacOSX") then +-- targetextension {"so"} + links{"Cocoa.framework","Python"} + end + + + files { + "vrSyncPlugin.cpp", + "../../PhysicsClient.cpp", + "../../PhysicsClient.h", + "../../PhysicsClientSharedMemory.cpp", + "../../PhysicsClientSharedMemory.h", + "../../PhysicsClientSharedMemory_C_API.cpp", + "../../PhysicsClientSharedMemory_C_API.h", + "../../PhysicsClientC_API.cpp", + "../../PhysicsClientC_API.h", + "../../Win32SharedMemory.cpp", + "../../Win32SharedMemory.h", + "../../PosixSharedMemory.cpp", + "../../PosixSharedMemory.h", + "../../../Utils/b3Clock.cpp", + "../../../Utils/b3Clock.h", + "../../../Utils/b3ResourcePath.cpp", + "../../../Utils/b3ResourcePath.h", + } + + + diff --git a/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp b/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp new file mode 100644 index 000000000..ec14a5165 --- /dev/null +++ b/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp @@ -0,0 +1,116 @@ + +//vrSyncPlugin plugin, will query the vr controller events +//and set change the user constraint to match the pose + +//in Python you can load and configure the plugin like this: +//plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_vrSyncPlugin_vs2010_x64_release.dll") +//could also be plugin = p.loadPlugin("vrSyncPlugin.so") on Mac/Linux +//controllerId = 3 +//p.executePluginCommand(plugin ,"bla", [controllerId,pr2_cid],[50]) + +#include "vrSyncPlugin.h" +#include "../../SharedMemoryPublic.h" +#include "../b3PluginContext.h" +#include + +struct MyClass +{ + int m_testData; + + int m_controllerId; + int m_constraintId; + float m_maxForce; + MyClass() + :m_testData(42), + m_controllerId(-1), + m_constraintId(-1), + m_maxForce(0) + { + } + virtual ~MyClass() + { + } +}; + +B3_SHARED_API int initPlugin(struct b3PluginContext* context) +{ + MyClass* obj = new MyClass(); + context->m_userPointer = obj; + + printf("hi vrSyncPlugin!\n"); + return SHARED_MEMORY_MAGIC_NUMBER; +} + + +B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context) +{ + MyClass* obj = (MyClass* )context->m_userPointer; + if (obj->m_controllerId>=0) + { + b3SharedMemoryCommandHandle commandHandle = b3RequestVREventsCommandInit(context->m_physClient); + int deviceTypeFilter = VR_DEVICE_CONTROLLER; + b3VREventsSetDeviceTypeFilter(commandHandle, deviceTypeFilter); + + b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + int statusType = b3GetStatusType(statusHandle); + if (statusType == CMD_REQUEST_VR_EVENTS_DATA_COMPLETED) + { + struct b3VREventsData vrEvents; + + int i = 0; + b3GetVREventsData(context->m_physClient, &vrEvents); + if (vrEvents.m_numControllerEvents) + { + for (int n=0;nm_controllerId) + { + b3SharedMemoryCommandHandle commandHandle; + int userConstraintUniqueId = obj->m_constraintId; + commandHandle = b3InitChangeUserConstraintCommand(context->m_physClient, userConstraintUniqueId); + double pos[4] = {event.m_pos[0],event.m_pos[1],event.m_pos[2],1}; + b3InitChangeUserConstraintSetPivotInB(commandHandle, pos); + double orn[4] = {event.m_orn[0],event.m_orn[1],event.m_orn[2],event.m_orn[3]}; + b3InitChangeUserConstraintSetFrameInB(commandHandle, orn); + b3InitChangeUserConstraintSetMaxForce(commandHandle, obj->m_maxForce); + + b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + //this is basically equivalent to doing this in Python/pybullet: + //p.changeConstraint(pr2_cid, e[POSITION], e[ORIENTATION], maxForce=500) + } + } + } + } + } + + return 0; +} + + + +B3_SHARED_API int executePluginCommand(struct b3PluginContext* context, const struct b3PluginArguments* arguments) +{ + MyClass* obj = (MyClass*) context->m_userPointer; + if (arguments->m_numInts>=2 && arguments->m_numFloats >= 0) + { + obj->m_constraintId = arguments->m_ints[1]; + printf("obj->m_constraintId=%d\n", obj->m_constraintId); + obj->m_maxForce = arguments->m_floats[0]; + printf("obj->m_maxForce = %f\n", obj->m_maxForce); + obj->m_controllerId = arguments->m_ints[0]; + printf("obj->m_controllerId=%d\n", obj->m_controllerId); + + } + return 0; +} + + +B3_SHARED_API void exitPlugin(struct b3PluginContext* context) +{ + MyClass* obj = (MyClass*) context->m_userPointer; + delete obj; + context->m_userPointer = 0; + + printf("bye vrSyncPlugin!\n"); +} diff --git a/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.h b/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.h new file mode 100644 index 000000000..fcc60a610 --- /dev/null +++ b/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.h @@ -0,0 +1,25 @@ +#ifndef TEST_PLUGIN_H +#define TEST_PLUGIN_H + +#include "../b3PluginAPI.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +//initPlugin, exitPlugin and executePluginCommand are required, otherwise plugin won't load +B3_SHARED_API int initPlugin(struct b3PluginContext* context); +B3_SHARED_API void exitPlugin(struct b3PluginContext* context); +B3_SHARED_API int executePluginCommand(struct b3PluginContext* context, const struct b3PluginArguments* arguments); + +//preTickPluginCallback and postTickPluginCallback are optional. +B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context); + + + +#ifdef __cplusplus +}; +#endif + +#endif//#define TEST_PLUGIN_H diff --git a/examples/SharedMemory/premake4.lua b/examples/SharedMemory/premake4.lua index d729029a8..f7c004b1e 100644 --- a/examples/SharedMemory/premake4.lua +++ b/examples/SharedMemory/premake4.lua @@ -409,3 +409,6 @@ end include "udp" include "tcp" include "plugins/testPlugin" +include "plugins/vrSyncPlugin" + + From b1f8eb74a40215074254b404ded25d7c59b89e8b Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 26 Sep 2017 10:05:17 -0700 Subject: [PATCH 29/38] bump up shared memory version number add option to recompute forward kinematics, to be consistent with link velocities in pybullet.getLinkState (..., computeForwardKinematics=0/1), thanks to Jeff Bingham for bringing up this inconsistency --- examples/SharedMemory/PhysicsClientC_API.cpp | 12 +++++++++ examples/SharedMemory/PhysicsClientC_API.h | 2 ++ .../PhysicsClientSharedMemory.cpp | 9 +++++++ examples/SharedMemory/PhysicsDirect.cpp | 26 ++++++++++++++++++- .../PhysicsServerCommandProcessor.cpp | 11 ++++++++ examples/SharedMemory/SharedMemoryPublic.h | 6 +++-- examples/pybullet/pybullet.c | 10 +++++-- 7 files changed, 71 insertions(+), 5 deletions(-) diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 1ad7c41c1..1270a8021 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -649,6 +649,18 @@ B3_SHARED_API int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryC return 0; } +B3_SHARED_API int b3RequestActualStateCommandComputeForwardKinematics(b3SharedMemoryCommandHandle commandHandle, int computeForwardKinematics) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command); + btAssert(command->m_type == CMD_REQUEST_ACTUAL_STATE); + if (computeForwardKinematics && command->m_type == CMD_REQUEST_ACTUAL_STATE) + { + command->m_updateFlags |= ACTUAL_STATE_COMPUTE_FORWARD_KINEMATICS; + } + return 0; +} + B3_SHARED_API int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, b3JointSensorState *state) { diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index 4b686cec0..d2b2c8421 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -439,6 +439,8 @@ B3_SHARED_API int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle com B3_SHARED_API b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient,int bodyUniqueId); B3_SHARED_API int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle commandHandle, int computeLinkVelocity); +B3_SHARED_API int b3RequestActualStateCommandComputeForwardKinematics(b3SharedMemoryCommandHandle commandHandle, int computeForwardKinematics); + B3_SHARED_API int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, struct b3JointSensorState *state); B3_SHARED_API int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int linkIndex, struct b3LinkState *state); diff --git a/examples/SharedMemory/PhysicsClientSharedMemory.cpp b/examples/SharedMemory/PhysicsClientSharedMemory.cpp index 1ea576f65..94c73f5f2 100644 --- a/examples/SharedMemory/PhysicsClientSharedMemory.cpp +++ b/examples/SharedMemory/PhysicsClientSharedMemory.cpp @@ -1204,6 +1204,15 @@ const SharedMemoryStatus* PhysicsClientSharedMemory::processServerStatus() { { break; } + case CMD_CALCULATED_JACOBIAN_COMPLETED: + { + break; + } + case CMD_CALCULATED_JACOBIAN_FAILED: + { + b3Warning("jacobian calculation failed"); + break; + } case CMD_CUSTOM_COMMAND_FAILED: { b3Warning("custom plugin command failed"); diff --git a/examples/SharedMemory/PhysicsDirect.cpp b/examples/SharedMemory/PhysicsDirect.cpp index 2de1acabd..76d09dfe7 100644 --- a/examples/SharedMemory/PhysicsDirect.cpp +++ b/examples/SharedMemory/PhysicsDirect.cpp @@ -949,7 +949,31 @@ void PhysicsDirect::postProcessStatus(const struct SharedMemoryStatus& serverCmd b3Warning("custom plugin command failed"); break; } - + case CMD_CLIENT_COMMAND_COMPLETED: + { + break; + } + case CMD_CALCULATED_JACOBIAN_COMPLETED: + { + break; + } + case CMD_CALCULATED_JACOBIAN_FAILED: + { + b3Warning("jacobian calculation failed"); + break; + } + case CMD_ACTUAL_STATE_UPDATE_COMPLETED: + { + break; + } + case CMD_DESIRED_STATE_RECEIVED_COMPLETED: + { + break; + } + case CMD_STEP_FORWARD_SIMULATION_COMPLETED: + { + break; + } default: { //b3Warning("Unknown server status type"); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 970967b40..012169251 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -5205,6 +5205,17 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm btAlignedObjectArray omega; btAlignedObjectArray linVel; + bool computeForwardKinematics = ((clientCmd.m_updateFlags & ACTUAL_STATE_COMPUTE_FORWARD_KINEMATICS)!=0); + if (computeForwardKinematics) + { + B3_PROFILE("compForwardKinematics"); + btAlignedObjectArray world_to_local; + btAlignedObjectArray local_origin; + world_to_local.resize(mb->getNumLinks()+1); + local_origin.resize(mb->getNumLinks()+1); + mb->forwardKinematics(world_to_local,local_origin); + } + bool computeLinkVelocities = ((clientCmd.m_updateFlags & ACTUAL_STATE_COMPUTE_LINKVELOCITY)!=0); if (computeLinkVelocities) { diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index 2186f3a78..90dbfe8b9 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -5,7 +5,8 @@ ///increase the SHARED_MEMORY_MAGIC_NUMBER whenever incompatible changes are made in the structures ///my convention is year/month/day/rev -#define SHARED_MEMORY_MAGIC_NUMBER 201708270 +#define SHARED_MEMORY_MAGIC_NUMBER 201709260 +//#define SHARED_MEMORY_MAGIC_NUMBER 201708270 //#define SHARED_MEMORY_MAGIC_NUMBER 201707140 //#define SHARED_MEMORY_MAGIC_NUMBER 201706015 //#define SHARED_MEMORY_MAGIC_NUMBER 201706001 @@ -505,7 +506,8 @@ struct b3VisualShapeInformation enum eLinkStateFlags { - ACTUAL_STATE_COMPUTE_LINKVELOCITY=1 + ACTUAL_STATE_COMPUTE_LINKVELOCITY=1, + ACTUAL_STATE_COMPUTE_FORWARD_KINEMATICS=2, }; ///b3LinkState provides extra information such as the Cartesian world coordinates diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index aa6c4c63c..873430e8a 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -3126,13 +3126,14 @@ static PyObject* pybullet_getLinkState(PyObject* self, PyObject* args, PyObject* int bodyUniqueId = -1; int linkIndex = -1; int computeLinkVelocity = 0; + int computeForwardKinematics = 0; int i; b3PhysicsClientHandle sm = 0; int physicsClientId = 0; - static char* kwlist[] = {"bodyUniqueId", "linkIndex", "computeLinkVelocity", "physicsClientId", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "ii|ii", kwlist, &bodyUniqueId, &linkIndex,&computeLinkVelocity, &physicsClientId)) + static char* kwlist[] = {"bodyUniqueId", "linkIndex", "computeLinkVelocity", "computeForwardKinematics", "physicsClientId", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "ii|iii", kwlist, &bodyUniqueId, &linkIndex,&computeLinkVelocity,&computeForwardKinematics,&physicsClientId)) { return NULL; } @@ -3168,6 +3169,11 @@ static PyObject* pybullet_getLinkState(PyObject* self, PyObject* args, PyObject* b3RequestActualStateCommandComputeLinkVelocity(cmd_handle,computeLinkVelocity); } + if (computeForwardKinematics) + { + b3RequestActualStateCommandComputeForwardKinematics(cmd_handle,computeForwardKinematics); + } + status_handle = b3SubmitClientCommandAndWaitStatus(sm, cmd_handle); From b03e5dec5fe9ce09f28eea62fd72d0dd7e8377d2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Tue, 26 Sep 2017 11:40:38 -0700 Subject: [PATCH 30/38] return -1 for debugDrawItems in DIRECT mode, instead of failing the API --- examples/pybullet/pybullet.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 873430e8a..1c3758e47 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -3373,6 +3373,8 @@ static PyObject* pybullet_addUserDebugText(PyObject* self, PyObject* args, PyObj double textSize = 1.f; double lifeTime = 0.f; int physicsClientId = 0; + int debugItemUniqueId = -1; + b3PhysicsClientHandle sm = 0; static char* kwlist[] = {"text", "textPosition", "textColorRGB", "textSize", "lifeTime", "textOrientation", "parentObjectUniqueId", "parentLinkIndex", "physicsClientId", NULL}; @@ -3425,15 +3427,14 @@ static PyObject* pybullet_addUserDebugText(PyObject* self, PyObject* args, PyObj statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle); statusType = b3GetStatusType(statusHandle); + if (statusType == CMD_USER_DEBUG_DRAW_COMPLETED) { - int debugItemUniqueId = b3GetDebugItemUniqueId(statusHandle); - PyObject* item = PyInt_FromLong(debugItemUniqueId); - return item; + debugItemUniqueId = b3GetDebugItemUniqueId(statusHandle); } - PyErr_SetString(SpamError, "Error in addUserDebugText."); - return NULL; + PyObject* item = PyInt_FromLong(debugItemUniqueId); + return item; } static PyObject* pybullet_addUserDebugLine(PyObject* self, PyObject* args, PyObject* keywds) @@ -3455,6 +3456,7 @@ static PyObject* pybullet_addUserDebugLine(PyObject* self, PyObject* args, PyObj double lineWidth = 1.f; double lifeTime = 0.f; int physicsClientId = 0; + int debugItemUniqueId = -1; b3PhysicsClientHandle sm = 0; static char* kwlist[] = {"lineFromXYZ", "lineToXYZ", "lineColorRGB", "lineWidth", "lifeTime", "parentObjectUniqueId", "parentLinkIndex", "physicsClientId", NULL}; @@ -3498,13 +3500,10 @@ static PyObject* pybullet_addUserDebugLine(PyObject* self, PyObject* args, PyObj statusType = b3GetStatusType(statusHandle); if (statusType == CMD_USER_DEBUG_DRAW_COMPLETED) { - int debugItemUniqueId = b3GetDebugItemUniqueId(statusHandle); - PyObject* item = PyInt_FromLong(debugItemUniqueId); - return item; + debugItemUniqueId = b3GetDebugItemUniqueId(statusHandle); } - - PyErr_SetString(SpamError, "Error in addUserDebugLine."); - return NULL; + PyObject* item = PyInt_FromLong(debugItemUniqueId); + return item; } static PyObject* pybullet_removeUserDebugItem(PyObject* self, PyObject* args, PyObject* keywds) From 8a265b8af2df64163c0eed838a4de0a694fa614c Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 26 Sep 2017 19:54:36 -0700 Subject: [PATCH 31/38] expose gear erp/relative position target to C-API/pybullet finish much better C++ vrSyncPlugin, running in-the-loop with the physics at high frequency, see also vr_kuka_setup_vrSyncPlugin.py --- data/pr2_gripper.urdf | 4 +- examples/SharedMemory/PhysicsClientC_API.cpp | 25 ++++ examples/SharedMemory/PhysicsClientC_API.h | 2 + .../PhysicsServerCommandProcessor.cpp | 9 ++ examples/SharedMemory/SharedMemoryCommands.h | 4 +- examples/SharedMemory/SharedMemoryPublic.h | 2 + .../plugins/vrSyncPlugin/vrSyncPlugin.cpp | 123 +++++++++++++++--- .../examples/vr_kuka_setup_vrSyncPlugin.py | 107 +++++++++++++++ examples/pybullet/pybullet.c | 16 ++- .../Featherstone/btMultiBodyConstraint.h | 4 +- .../btMultiBodyGearConstraint.cpp | 21 ++- .../Featherstone/btMultiBodyGearConstraint.h | 15 ++- 12 files changed, 301 insertions(+), 31 deletions(-) create mode 100644 examples/pybullet/examples/vr_kuka_setup_vrSyncPlugin.py diff --git a/data/pr2_gripper.urdf b/data/pr2_gripper.urdf index 7d16d986a..4913718ce 100644 --- a/data/pr2_gripper.urdf +++ b/data/pr2_gripper.urdf @@ -24,7 +24,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 1270a8021..d8c2fff7f 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -2131,6 +2131,31 @@ B3_SHARED_API int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommand return 0; } +B3_SHARED_API int b3InitChangeUserConstraintSetRelativePositionTarget(b3SharedMemoryCommandHandle commandHandle, double relativePositionTarget) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command); + b3Assert(command->m_type == CMD_USER_CONSTRAINT); + b3Assert(command->m_updateFlags & USER_CONSTRAINT_CHANGE_CONSTRAINT); + command->m_updateFlags |=USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET; + command->m_userConstraintArguments.m_relativePositionTarget = relativePositionTarget; + + return 0; +} +B3_SHARED_API int b3InitChangeUserConstraintSetERP(b3SharedMemoryCommandHandle commandHandle, double erp) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle; + b3Assert(command); + b3Assert(command->m_type == CMD_USER_CONSTRAINT); + b3Assert(command->m_updateFlags & USER_CONSTRAINT_CHANGE_CONSTRAINT); + + command->m_updateFlags |=USER_CONSTRAINT_CHANGE_ERP; + command->m_userConstraintArguments.m_erp = erp; + + return 0; +} + + B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId) { diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index d2b2c8421..d18a547fe 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -136,6 +136,8 @@ B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHan B3_SHARED_API int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce); B3_SHARED_API int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio); B3_SHARED_API int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink); +B3_SHARED_API int b3InitChangeUserConstraintSetRelativePositionTarget(b3SharedMemoryCommandHandle commandHandle, double relativePositionTarget); +B3_SHARED_API int b3InitChangeUserConstraintSetERP(b3SharedMemoryCommandHandle commandHandle, double erp); B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 012169251..7f3223b59 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -7278,6 +7278,15 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm { userConstraintPtr->m_mbConstraint->setGearRatio(clientCmd.m_userConstraintArguments.m_gearRatio); } + if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET) + { + userConstraintPtr->m_mbConstraint->setRelativePositionTarget(clientCmd.m_userConstraintArguments.m_relativePositionTarget); + } + if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_ERP) + { + userConstraintPtr->m_mbConstraint->setErp(clientCmd.m_userConstraintArguments.m_erp); + } + if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK) { userConstraintPtr->m_mbConstraint->setGearAuxLink(clientCmd.m_userConstraintArguments.m_gearAuxLink); diff --git a/examples/SharedMemory/SharedMemoryCommands.h b/examples/SharedMemory/SharedMemoryCommands.h index 49098e0a0..b196d6c71 100644 --- a/examples/SharedMemory/SharedMemoryCommands.h +++ b/examples/SharedMemory/SharedMemoryCommands.h @@ -678,7 +678,9 @@ enum EnumUserConstraintFlags USER_CONSTRAINT_CHANGE_MAX_FORCE=32, USER_CONSTRAINT_REQUEST_INFO=64, USER_CONSTRAINT_CHANGE_GEAR_RATIO=128, - USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK=256, + USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK=256, + USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET=512, + USER_CONSTRAINT_CHANGE_ERP=1024, }; diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index 90dbfe8b9..28b7ec5b1 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -247,6 +247,8 @@ struct b3UserConstraint int m_userConstraintUniqueId; double m_gearRatio; int m_gearAuxLink; + double m_relativePositionTarget; + double m_erp; }; diff --git a/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp b/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp index ec14a5165..474e944df 100644 --- a/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp +++ b/examples/SharedMemory/plugins/vrSyncPlugin/vrSyncPlugin.cpp @@ -6,7 +6,6 @@ //plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_vrSyncPlugin_vs2010_x64_release.dll") //could also be plugin = p.loadPlugin("vrSyncPlugin.so") on Mac/Linux //controllerId = 3 -//p.executePluginCommand(plugin ,"bla", [controllerId,pr2_cid],[50]) #include "vrSyncPlugin.h" #include "../../SharedMemoryPublic.h" @@ -19,12 +18,18 @@ struct MyClass int m_controllerId; int m_constraintId; + int m_constraintId2; + int m_gripperId; float m_maxForce; + float m_maxForce2; MyClass() :m_testData(42), m_controllerId(-1), m_constraintId(-1), - m_maxForce(0) + m_constraintId2(-1), + m_gripperId(-1), + m_maxForce(0), + m_maxForce2(0) { } virtual ~MyClass() @@ -56,7 +61,7 @@ B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context) if (statusType == CMD_REQUEST_VR_EVENTS_DATA_COMPLETED) { struct b3VREventsData vrEvents; - + int i = 0; b3GetVREventsData(context->m_physClient, &vrEvents); if (vrEvents.m_numControllerEvents) @@ -66,18 +71,95 @@ B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context) b3VRControllerEvent& event = vrEvents.m_controllerEvents[n]; if (event.m_controllerId ==obj->m_controllerId) { - b3SharedMemoryCommandHandle commandHandle; - int userConstraintUniqueId = obj->m_constraintId; - commandHandle = b3InitChangeUserConstraintCommand(context->m_physClient, userConstraintUniqueId); - double pos[4] = {event.m_pos[0],event.m_pos[1],event.m_pos[2],1}; - b3InitChangeUserConstraintSetPivotInB(commandHandle, pos); - double orn[4] = {event.m_orn[0],event.m_orn[1],event.m_orn[2],event.m_orn[3]}; - b3InitChangeUserConstraintSetFrameInB(commandHandle, orn); - b3InitChangeUserConstraintSetMaxForce(commandHandle, obj->m_maxForce); + if (obj->m_constraintId>=0) + { + //this is basically equivalent to doing this in Python/pybullet: + //p.changeConstraint(pr2_cid, e[POSITION], e[ORIENTATION], maxForce=...) + b3SharedMemoryCommandHandle commandHandle; + int userConstraintUniqueId = obj->m_constraintId; + commandHandle = b3InitChangeUserConstraintCommand(context->m_physClient, userConstraintUniqueId); + double pos[4] = {event.m_pos[0],event.m_pos[1],event.m_pos[2],1}; + b3InitChangeUserConstraintSetPivotInB(commandHandle, pos); + double orn[4] = {event.m_orn[0],event.m_orn[1],event.m_orn[2],event.m_orn[3]}; + b3InitChangeUserConstraintSetFrameInB(commandHandle, orn); + b3InitChangeUserConstraintSetMaxForce(commandHandle, obj->m_maxForce); + b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + } + // apply the analogue button to close the constraint, using a gear constraint with position target + if (obj->m_constraintId2>=0) + { + //this block is similar to + //p.changeConstraint(c,gearRatio=1, erp=..., relativePositionTarget=relPosTarget, maxForce=...) + //printf("obj->m_constraintId2=%d\n", obj->m_constraintId2); + b3SharedMemoryCommandHandle commandHandle; + commandHandle = b3InitChangeUserConstraintCommand(context->m_physClient, obj->m_constraintId2); + + //0 -> open, 1 = closed + double openPos = 1.; + double relPosTarget = openPos - (event.m_analogAxis*openPos); + b3InitChangeUserConstraintSetRelativePositionTarget(commandHandle, relPosTarget); + b3InitChangeUserConstraintSetERP(commandHandle,1); + b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); + } + //printf("event.m_analogAxis=%f\n", event.m_analogAxis); + + // use the pr2_gripper motors to keep the gripper centered/symmetric around the center axis + if (obj->m_gripperId>=0) + { + //this block is similar to + //b = p.getJointState(pr2_gripper,2)[0] + //print("b = " + str(b)) + //p.setJointMotorControl2(pr2_gripper, 0, p.POSITION_CONTROL, targetPosition=b, force=3) + + //printf("obj->m_gripperId=%d\n", obj->m_gripperId); + { + b3SharedMemoryCommandHandle cmd_handle = + b3RequestActualStateCommandInit(context->m_physClient, obj->m_gripperId); + b3SharedMemoryStatusHandle status_handle = + b3SubmitClientCommandAndWaitStatus(context->m_physClient, cmd_handle); + + int status_type = b3GetStatusType(status_handle); + if (status_type == CMD_ACTUAL_STATE_UPDATE_COMPLETED) + { + //printf("status_type == CMD_ACTUAL_STATE_UPDATE_COMPLETED\n"); + + b3JointSensorState sensorState; + if (b3GetJointState(context->m_physClient, status_handle, 2, &sensorState)) + { + + + b3SharedMemoryCommandHandle commandHandle; + double targetPosition = sensorState.m_jointPosition; + //printf("targetPosition =%f\n", targetPosition); + if (1) + { + b3JointInfo info; + b3GetJointInfo(context->m_physClient, obj->m_gripperId, 0, &info); + commandHandle = b3JointControlCommandInit2(context->m_physClient, obj->m_gripperId, CONTROL_MODE_POSITION_VELOCITY_PD); + double kp = .1; + double targetVelocity = 0; + double kd = .6; + b3JointControlSetDesiredPosition(commandHandle, info.m_qIndex, targetPosition); + b3JointControlSetKp(commandHandle, info.m_uIndex, kp); + b3JointControlSetDesiredVelocity(commandHandle, info.m_uIndex,targetVelocity); + b3JointControlSetKd(commandHandle, info.m_uIndex, kd); + b3JointControlSetMaximumForce(commandHandle, info.m_uIndex, obj->m_maxForce2); + b3SubmitClientCommandAndWaitStatus(context->m_physClient, cmd_handle); + } + } else + { + //printf("???\n"); + } + + } else + { + //printf("no\n"); + } + + } + + } - b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, commandHandle); - //this is basically equivalent to doing this in Python/pybullet: - //p.changeConstraint(pr2_cid, e[POSITION], e[ORIENTATION], maxForce=500) } } } @@ -92,15 +174,26 @@ B3_SHARED_API int preTickPluginCallback(struct b3PluginContext* context) B3_SHARED_API int executePluginCommand(struct b3PluginContext* context, const struct b3PluginArguments* arguments) { MyClass* obj = (MyClass*) context->m_userPointer; - if (arguments->m_numInts>=2 && arguments->m_numFloats >= 0) + if (arguments->m_numInts>=4 && arguments->m_numFloats >= 2) { obj->m_constraintId = arguments->m_ints[1]; + obj->m_constraintId2 = arguments->m_ints[2]; + obj->m_gripperId = arguments->m_ints[3]; printf("obj->m_constraintId=%d\n", obj->m_constraintId); obj->m_maxForce = arguments->m_floats[0]; + obj->m_maxForce2 = arguments->m_floats[1]; printf("obj->m_maxForce = %f\n", obj->m_maxForce); obj->m_controllerId = arguments->m_ints[0]; printf("obj->m_controllerId=%d\n", obj->m_controllerId); + b3SharedMemoryCommandHandle command = b3InitSyncBodyInfoCommand(context->m_physClient); + b3SharedMemoryStatusHandle statusHandle = b3SubmitClientCommandAndWaitStatus(context->m_physClient, command); + int statusType = b3GetStatusType(statusHandle); + + if (statusType != CMD_SYNC_BODY_INFO_COMPLETED) + { + + } } return 0; } diff --git a/examples/pybullet/examples/vr_kuka_setup_vrSyncPlugin.py b/examples/pybullet/examples/vr_kuka_setup_vrSyncPlugin.py new file mode 100644 index 000000000..7297bdd73 --- /dev/null +++ b/examples/pybullet/examples/vr_kuka_setup_vrSyncPlugin.py @@ -0,0 +1,107 @@ +import pybullet as p +import time +#p.connect(p.UDP,"192.168.86.100") + + +cid = p.connect(p.SHARED_MEMORY) +if (cid<0): + p.connect(p.GUI) +p.resetSimulation() +#disable rendering during loading makes it much faster +p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 0) +objects = [p.loadURDF("plane.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] +#objects = [p.loadURDF("samurai.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] +objects = [p.loadURDF("pr2_gripper.urdf", 0.500000,0.300006,0.700000,-0.000000,-0.000000,-0.000031,1.000000)] +pr2_gripper = objects[0] +print ("pr2_gripper=") +print (pr2_gripper) + +jointPositions=[ 0.550569, 0.000000, 0.549657, 0.000000 ] +for jointIndex in range (p.getNumJoints(pr2_gripper)): + p.resetJointState(pr2_gripper,jointIndex,jointPositions[jointIndex]) + p.setJointMotorControl2(pr2_gripper,jointIndex,p.POSITION_CONTROL,targetPosition=0,force=0) + +pr2_cid = p.createConstraint(pr2_gripper,-1,-1,-1,p.JOINT_FIXED,[0,0,0],[0.2,0,0],[0.500000,0.300006,0.700000]) +print ("pr2_cid") +print (pr2_cid) + +pr2_cid2 = p.createConstraint(pr2_gripper,0,pr2_gripper,2,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0]) +p.changeConstraint(pr2_cid2,gearRatio=1, erp=0.5, relativePositionTarget=0.5, maxForce=3) + + + +objects = [p.loadURDF("kuka_iiwa/model_vr_limits.urdf", 1.400000,-0.200000,0.600000,0.000000,0.000000,0.000000,1.000000)] +kuka = objects[0] +jointPositions=[ -0.000000, -0.000000, 0.000000, 1.570793, 0.000000, -1.036725, 0.000001 ] +for jointIndex in range (p.getNumJoints(kuka)): + p.resetJointState(kuka,jointIndex,jointPositions[jointIndex]) + p.setJointMotorControl2(kuka,jointIndex,p.POSITION_CONTROL,jointPositions[jointIndex],0) + +objects = [p.loadURDF("lego/lego.urdf", 1.000000,-0.200000,0.700000,0.000000,0.000000,0.000000,1.000000)] +objects = [p.loadURDF("lego/lego.urdf", 1.000000,-0.200000,0.800000,0.000000,0.000000,0.000000,1.000000)] +objects = [p.loadURDF("lego/lego.urdf", 1.000000,-0.200000,0.900000,0.000000,0.000000,0.000000,1.000000)] +objects = p.loadSDF("gripper/wsg50_one_motor_gripper_new_free_base.sdf") +kuka_gripper = objects[0] +print ("kuka gripper=") +print(kuka_gripper) + +p.resetBasePositionAndOrientation(kuka_gripper,[0.923103,-0.200000,1.250036],[-0.000000,0.964531,-0.000002,-0.263970]) +jointPositions=[ 0.000000, -0.011130, -0.206421, 0.205143, -0.009999, 0.000000, -0.010055, 0.000000 ] +for jointIndex in range (p.getNumJoints(kuka_gripper)): + p.resetJointState(kuka_gripper,jointIndex,jointPositions[jointIndex]) + p.setJointMotorControl2(kuka_gripper,jointIndex,p.POSITION_CONTROL,jointPositions[jointIndex],0) + + +kuka_cid = p.createConstraint(kuka, 6, kuka_gripper,0,p.JOINT_FIXED, [0,0,0], [0,0,0.05],[0,0,0]) + +objects = [p.loadURDF("jenga/jenga.urdf", 1.300000,-0.700000,0.750000,0.000000,0.707107,0.000000,0.707107)] +objects = [p.loadURDF("jenga/jenga.urdf", 1.200000,-0.700000,0.750000,0.000000,0.707107,0.000000,0.707107)] +objects = [p.loadURDF("jenga/jenga.urdf", 1.100000,-0.700000,0.750000,0.000000,0.707107,0.000000,0.707107)] +objects = [p.loadURDF("jenga/jenga.urdf", 1.000000,-0.700000,0.750000,0.000000,0.707107,0.000000,0.707107)] +objects = [p.loadURDF("jenga/jenga.urdf", 0.900000,-0.700000,0.750000,0.000000,0.707107,0.000000,0.707107)] +objects = [p.loadURDF("jenga/jenga.urdf", 0.800000,-0.700000,0.750000,0.000000,0.707107,0.000000,0.707107)] +objects = [p.loadURDF("table/table.urdf", 1.000000,-0.200000,0.000000,0.000000,0.000000,0.707107,0.707107)] +objects = [p.loadURDF("teddy_vhacd.urdf", 1.050000,-0.500000,0.700000,0.000000,0.000000,0.707107,0.707107)] +objects = [p.loadURDF("cube_small.urdf", 0.950000,-0.100000,0.700000,0.000000,0.000000,0.707107,0.707107)] +objects = [p.loadURDF("sphere_small.urdf", 0.850000,-0.400000,0.700000,0.000000,0.000000,0.707107,0.707107)] +objects = [p.loadURDF("duck_vhacd.urdf", 0.850000,-0.400000,0.900000,0.000000,0.000000,0.707107,0.707107)] +objects = p.loadSDF("kiva_shelf/model.sdf") +ob = objects[0] +p.resetBasePositionAndOrientation(ob,[0.000000,1.000000,1.204500],[0.000000,0.000000,0.000000,1.000000]) +objects = [p.loadURDF("teddy_vhacd.urdf", -0.100000,0.600000,0.850000,0.000000,0.000000,0.000000,1.000000)] +objects = [p.loadURDF("sphere_small.urdf", -0.100000,0.955006,1.169706,0.633232,-0.000000,-0.000000,0.773962)] +objects = [p.loadURDF("cube_small.urdf", 0.300000,0.600000,0.850000,0.000000,0.000000,0.000000,1.000000)] +objects = [p.loadURDF("table_square/table_square.urdf", -1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] +ob = objects[0] +jointPositions=[ 0.000000 ] +for jointIndex in range (p.getNumJoints(ob)): + p.resetJointState(ob,jointIndex,jointPositions[jointIndex]) + +objects = [p.loadURDF("husky/husky.urdf", 2.000000,-5.000000,1.000000,0.000000,0.000000,0.000000,1.000000)] +ob = objects[0] +jointPositions=[ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 ] +for jointIndex in range (p.getNumJoints(ob)): + p.resetJointState(ob,jointIndex,jointPositions[jointIndex]) + +p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 1) + +p.setGravity(0.000000,0.000000,0.000000) +p.setGravity(0,0,-10) + +##show this for 10 seconds +#now = time.time() +#while (time.time() < now+10): +# p.stepSimulation() +p.setRealTimeSimulation(1) + + +plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_vrSyncPlugin_vs2010_x64_release.dll") +controllerId = 3 +p.executePluginCommand(plugin ,"bla", [controllerId,pr2_cid, pr2_cid2,pr2_gripper],[50,3]) + +while (1): + #b = p.getJointState(pr2_gripper,2)[0] + #print("b = " + str(b)) + #p.setJointMotorControl2(pr2_gripper, 0, p.POSITION_CONTROL, targetPosition=b, force=3) + p.setGravity(0,0,-10) +p.disconnect() diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 873430e8a..f583ce29c 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -4971,7 +4971,7 @@ static PyObject* pybullet_getClosestPointData(PyObject* self, PyObject* args, Py static PyObject* pybullet_changeUserConstraint(PyObject* self, PyObject* args, PyObject* keywds) { - static char* kwlist[] = {"userConstraintUniqueId", "jointChildPivot", "jointChildFrameOrientation", "maxForce", "gearRatio", "gearAuxLink", "physicsClientId", NULL}; + static char* kwlist[] = {"userConstraintUniqueId", "jointChildPivot", "jointChildFrameOrientation", "maxForce", "gearRatio", "gearAuxLink", "relativePositionTarget", "erp", "physicsClientId", NULL}; int userConstraintUniqueId = -1; b3SharedMemoryCommandHandle commandHandle; b3SharedMemoryStatusHandle statusHandle; @@ -4985,7 +4985,9 @@ static PyObject* pybullet_changeUserConstraint(PyObject* self, PyObject* args, P double jointChildFrameOrn[4]; double maxForce = -1; double gearRatio = 0; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|OOddii", kwlist, &userConstraintUniqueId, &jointChildPivotObj, &jointChildFrameOrnObj, &maxForce, &gearRatio, &gearAuxLink, &physicsClientId)) + double relativePositionTarget=1e32; + double erp=-1; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|OOddiddi", kwlist, &userConstraintUniqueId, &jointChildPivotObj, &jointChildFrameOrnObj, &maxForce, &gearRatio, &gearAuxLink, &relativePositionTarget, &erp, &physicsClientId)) { return NULL; } @@ -5007,6 +5009,16 @@ static PyObject* pybullet_changeUserConstraint(PyObject* self, PyObject* args, P { b3InitChangeUserConstraintSetFrameInB(commandHandle, jointChildFrameOrn); } + + if (relativePositionTarget<1e10) + { + b3InitChangeUserConstraintSetRelativePositionTarget(commandHandle, relativePositionTarget); + } + if (erp>=0) + { + b3InitChangeUserConstraintSetERP(commandHandle, erp); + } + if (maxForce >= 0) { b3InitChangeUserConstraintSetMaxForce(commandHandle, maxForce); diff --git a/src/BulletDynamics/Featherstone/btMultiBodyConstraint.h b/src/BulletDynamics/Featherstone/btMultiBodyConstraint.h index 8c28bbf4c..83521b950 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyConstraint.h +++ b/src/BulletDynamics/Featherstone/btMultiBodyConstraint.h @@ -185,7 +185,9 @@ public: virtual void setGearRatio(btScalar ratio) {} virtual void setGearAuxLink(int gearAuxLink) {} - + virtual void setRelativePositionTarget(btScalar relPosTarget){} + virtual void setErp(btScalar erp){} + }; diff --git a/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp b/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp index 3fdd51815..5fdb7007d 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp +++ b/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp @@ -23,7 +23,9 @@ subject to the following restrictions: btMultiBodyGearConstraint::btMultiBodyGearConstraint(btMultiBody* bodyA, int linkA, btMultiBody* bodyB, int linkB, const btVector3& pivotInA, const btVector3& pivotInB, const btMatrix3x3& frameInA, const btMatrix3x3& frameInB) :btMultiBodyConstraint(bodyA,bodyB,linkA,linkB,1,false), m_gearRatio(1), - m_gearAuxLink(-1) + m_gearAuxLink(-1), + m_erp(0), + m_relativePositionTarget(0) { } @@ -107,9 +109,9 @@ void btMultiBodyGearConstraint::createConstraintRows(btMultiBodyConstraintArray& jacobianA(0)[offsetA] = 1; jacobianB(0)[offsetB] = m_gearRatio; - const btScalar posError = 0; + btScalar posError = 0; const btVector3 dummy(0, 0, 0); - btScalar erp = infoGlobal.m_erp; + btScalar kp = 1; btScalar kd = 1; int numRows = getNumRows(); @@ -129,10 +131,15 @@ void btMultiBodyGearConstraint::createConstraintRows(btMultiBodyConstraintArray& auxVel = m_bodyA->getJointVelMultiDof(m_gearAuxLink)[dof]; } currentVelocity += auxVel; - - //btScalar positionStabiliationTerm = erp*(m_desiredPosition-currentPosition)/infoGlobal.m_timeStep; - //btScalar velocityError = (m_desiredVelocity - currentVelocity); - + if (m_erp!=0) + { + btScalar currentPositionA = m_bodyA->getJointPosMultiDof(m_linkA)[dof]; + btScalar currentPositionB = m_gearRatio*m_bodyA->getJointPosMultiDof(m_linkB)[dof]; + btScalar diff = currentPositionB+currentPositionA; + btScalar desiredPositionDiff = this->m_relativePositionTarget; + posError = -m_erp*(desiredPositionDiff - diff); + } + btScalar desiredRelativeVelocity = auxVel; fillMultiBodyConstraint(constraintRow,data,jacobianA(row),jacobianB(row),dummy,dummy,dummy,dummy,posError,infoGlobal,-m_maxAppliedImpulse,m_maxAppliedImpulse,false,1,false,desiredRelativeVelocity); diff --git a/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.h b/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.h index 711a73e46..0115de624 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.h +++ b/src/BulletDynamics/Featherstone/btMultiBodyGearConstraint.h @@ -28,10 +28,12 @@ protected: btRigidBody* m_rigidBodyB; btVector3 m_pivotInA; btVector3 m_pivotInB; - btMatrix3x3 m_frameInA; - btMatrix3x3 m_frameInB; + btMatrix3x3 m_frameInA; + btMatrix3x3 m_frameInB; btScalar m_gearRatio; int m_gearAuxLink; + btScalar m_erp; + btScalar m_relativePositionTarget; public: @@ -102,7 +104,14 @@ public: { m_gearAuxLink = gearAuxLink; } - + virtual void setRelativePositionTarget(btScalar relPosTarget) + { + m_relativePositionTarget = relPosTarget; + } + virtual void setErp(btScalar erp) + { + m_erp = erp; + } }; #endif //BT_MULTIBODY_GEAR_CONSTRAINT_H From 12f28c5f76961bd819ccf899b8a64e4d0a4c2bc8 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 26 Sep 2017 19:58:24 -0700 Subject: [PATCH 32/38] fix compile issue on MSVC --- examples/pybullet/pybullet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 4ba7a9b8b..306481c21 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -3433,8 +3433,10 @@ static PyObject* pybullet_addUserDebugText(PyObject* self, PyObject* args, PyObj debugItemUniqueId = b3GetDebugItemUniqueId(statusHandle); } + { PyObject* item = PyInt_FromLong(debugItemUniqueId); return item; + } } static PyObject* pybullet_addUserDebugLine(PyObject* self, PyObject* args, PyObject* keywds) @@ -3502,8 +3504,10 @@ static PyObject* pybullet_addUserDebugLine(PyObject* self, PyObject* args, PyObj { debugItemUniqueId = b3GetDebugItemUniqueId(statusHandle); } + { PyObject* item = PyInt_FromLong(debugItemUniqueId); return item; + } } static PyObject* pybullet_removeUserDebugItem(PyObject* self, PyObject* args, PyObject* keywds) From c37919604fba7413c6a89e92b4641fb8572160c7 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 27 Sep 2017 09:07:21 -0700 Subject: [PATCH 33/38] add minitaur environment randomizer, enable it by default this improves PPO training ( more stable) --- .../bullet/env_randomizer_base.py | 25 +++ .../bullet/minitaur_env_randomizer.py | 68 +++++++ .../pybullet_envs/bullet/minitaur_gym_env.py | 3 +- .../examples/minitaur_gym_env_example.py | 167 ++++++++++++++++++ 4 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 examples/pybullet/gym/pybullet_envs/bullet/env_randomizer_base.py create mode 100644 examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py create mode 100644 examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py diff --git a/examples/pybullet/gym/pybullet_envs/bullet/env_randomizer_base.py b/examples/pybullet/gym/pybullet_envs/bullet/env_randomizer_base.py new file mode 100644 index 000000000..c39f3b888 --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/bullet/env_randomizer_base.py @@ -0,0 +1,25 @@ +"""Abstract base class for environment randomizer.""" + +import abc + + +class EnvRandomizerBase(object): + """Abstract base class for environment randomizer. + + An EnvRandomizer is called in environment.reset(). It will + randomize physical parameters of the objects in the simulation. + The physical parameters will be fixed for that episode and be + randomized again in the next environment.reset(). + """ + + __metaclass__ = abc.ABCMeta + + @abc.abstractmethod + def randomize_env(self, env): + """Randomize the simulated_objects in the environment. + + Args: + env: The environment to be randomized. + """ + pass + diff --git a/examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py b/examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py new file mode 100644 index 000000000..db139f3b0 --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py @@ -0,0 +1,68 @@ +"""Randomize the minitaur_gym_env when reset() is called.""" +import random +import numpy as np +from . import env_randomizer_base + +# Relative range. +MINITAUR_BASE_MASS_ERROR_RANGE = (-0.2, 0.2) # 0.2 means 20% +MINITAUR_LEG_MASS_ERROR_RANGE = (-0.2, 0.2) # 0.2 means 20% +# Absolute range. +BATTERY_VOLTAGE_RANGE = (14.8, 16.8) # Unit: Volt +MOTOR_VISCOUS_DAMPING_RANGE = (0, 0.01) # Unit: N*m*s/rad (torque/angular vel) +MINITAUR_LEG_FRICTION = (0.8, 1.5) # Unit: dimensionless + + +class MinitaurEnvRandomizer(env_randomizer_base.EnvRandomizerBase): + """A randomizer that change the minitaur_gym_env during every reset.""" + + def __init__(self, + minitaur_base_mass_err_range=MINITAUR_BASE_MASS_ERROR_RANGE, + minitaur_leg_mass_err_range=MINITAUR_LEG_MASS_ERROR_RANGE, + battery_voltage_range=BATTERY_VOLTAGE_RANGE, + motor_viscous_damping_range=MOTOR_VISCOUS_DAMPING_RANGE): + self._minitaur_base_mass_err_range = minitaur_base_mass_err_range + self._minitaur_leg_mass_err_range = minitaur_leg_mass_err_range + self._battery_voltage_range = battery_voltage_range + self._motor_viscous_damping_range = motor_viscous_damping_range + + def randomize_env(self, env): + self._randomize_minitaur(env.minitaur) + + def _randomize_minitaur(self, minitaur): + """Randomize various physical properties of minitaur. + + It randomizes the mass/inertia of the base, mass/inertia of the legs, + friction coefficient of the feet, the battery voltage and the motor damping + at each reset() of the environment. + + Args: + minitaur: the Minitaur instance in minitaur_gym_env environment. + """ + base_mass = minitaur.GetBaseMassFromURDF() + randomized_base_mass = random.uniform( + base_mass * (1.0 + self._minitaur_base_mass_err_range[0]), + base_mass * (1.0 + self._minitaur_base_mass_err_range[1])) + minitaur.SetBaseMass(randomized_base_mass) + + leg_masses = minitaur.GetLegMassesFromURDF() + leg_masses_lower_bound = np.array(leg_masses) * ( + 1.0 + self._minitaur_leg_mass_err_range[0]) + leg_masses_upper_bound = np.array(leg_masses) * ( + 1.0 + self._minitaur_leg_mass_err_range[1]) + randomized_leg_masses = [ + np.random.uniform(leg_masses_lower_bound[i], leg_masses_upper_bound[i]) + for i in range(len(leg_masses)) + ] + minitaur.SetLegMasses(randomized_leg_masses) + + randomized_battery_voltage = random.uniform(BATTERY_VOLTAGE_RANGE[0], + BATTERY_VOLTAGE_RANGE[1]) + minitaur.SetBatteryVoltage(randomized_battery_voltage) + + randomized_motor_damping = random.uniform(MOTOR_VISCOUS_DAMPING_RANGE[0], + MOTOR_VISCOUS_DAMPING_RANGE[1]) + minitaur.SetMotorViscousDamping(randomized_motor_damping) + + randomized_foot_friction = random.uniform(MINITAUR_LEG_FRICTION[0], + MINITAUR_LEG_FRICTION[1]) + minitaur.SetFootFriction(randomized_foot_friction) diff --git a/examples/pybullet/gym/pybullet_envs/bullet/minitaur_gym_env.py b/examples/pybullet/gym/pybullet_envs/bullet/minitaur_gym_env.py index 6e7872a61..38ec631a5 100644 --- a/examples/pybullet/gym/pybullet_envs/bullet/minitaur_gym_env.py +++ b/examples/pybullet/gym/pybullet_envs/bullet/minitaur_gym_env.py @@ -19,6 +19,7 @@ from . import bullet_client from . import minitaur import os import pybullet_data +from . import minitaur_env_randomizer NUM_SUBSTEPS = 5 NUM_MOTORS = 8 @@ -68,7 +69,7 @@ class MinitaurBulletEnv(gym.Env): on_rack=False, render=False, kd_for_pd_controllers=0.3, - env_randomizer=None): + env_randomizer=minitaur_env_randomizer.MinitaurEnvRandomizer()): """Initialize the minitaur gym environment. Args: diff --git a/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py b/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py new file mode 100644 index 000000000..b71ee5fc6 --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py @@ -0,0 +1,167 @@ +r"""An example to run of the minitaur gym environment with sine gaits. + +blaze run -c opt //robotics/reinforcement_learning/minitaur/\ +envs:minitaur_gym_env_example +""" + +import math +import numpy as np +from pybullet_envs.bullet import minitaur_gym_env +import argparse +from pybullet_envs.bullet import minitaur_env_randomizer + +def ResetPoseExample(): + """An example that the minitaur stands still using the reset pose.""" + steps = 1000 + randomizer = (minitaur_env_randomizer.MinitaurEnvRandomizer()) + environment = minitaur_gym_env.MinitaurBulletEnv( + render=True, + leg_model_enabled=False, + motor_velocity_limit=np.inf, + pd_control_enabled=True, + accurate_motor_model_enabled=True, + motor_overheat_protection=True, + env_randomizer = randomizer, + hard_reset=False) + action = [math.pi / 2] * 8 + for _ in range(steps): + _, _, done, _ = environment.step(action) + if done: + break + environment.reset() + +def MotorOverheatExample(): + """An example of minitaur motor overheat protection is triggered. + + The minitaur is leaning forward and the motors are getting obove threshold + torques. The overheat protection will be triggered in ~1 sec. + """ + + environment = minitaur_gym_env.MinitaurBulletEnv( + render=True, + leg_model_enabled=False, + motor_velocity_limit=np.inf, + motor_overheat_protection=True, + accurate_motor_model_enabled=True, + motor_kp=1.20, + motor_kd=0.00, + on_rack=False) + + action = [2.0] * 8 + for i in range(8): + action[i] = 2.0 - 0.5 * (-1 if i % 2 == 0 else 1) * (-1 if i < 4 else 1) + + steps = 500 + actions_and_observations = [] + for step_counter in range(steps): + # Matches the internal timestep. + time_step = 0.01 + t = step_counter * time_step + current_row = [t] + current_row.extend(action) + + observation, _, _, _ = environment.step(action) + current_row.extend(observation.tolist()) + actions_and_observations.append(current_row) + environment.reset() + +def SineStandExample(): + """An example of minitaur standing and squatting on the floor. + + To validate the accurate motor model we command the robot and sit and stand up + periodically in both simulation and experiment. We compare the measured motor + trajectories, torques and gains. + """ + environment = minitaur_gym_env.MinitaurBulletEnv( + render=True, + leg_model_enabled=False, + motor_velocity_limit=np.inf, + motor_overheat_protection=True, + accurate_motor_model_enabled=True, + motor_kp=1.20, + motor_kd=0.02, + on_rack=False) + steps = 1000 + amplitude = 0.5 + speed = 3 + + actions_and_observations = [] + + for step_counter in range(steps): + # Matches the internal timestep. + time_step = 0.01 + t = step_counter * time_step + current_row = [t] + + action = [math.sin(speed * t) * amplitude + math.pi / 2] * 8 + current_row.extend(action) + + observation, _, _, _ = environment.step(action) + current_row.extend(observation.tolist()) + actions_and_observations.append(current_row) + + environment.reset() + + +def SinePolicyExample(): + """An example of minitaur walking with a sine gait.""" + randomizer = (minitaur_env_randomizer.MinitaurEnvRandomizer()) + environment = minitaur_gym_env.MinitaurBulletEnv( + render=True, + motor_velocity_limit=np.inf, + pd_control_enabled=True, + hard_reset=False, + env_randomizer = randomizer, + on_rack=False) + sum_reward = 0 + steps = 20000 + amplitude_1_bound = 0.5 + amplitude_2_bound = 0.5 + speed = 40 + + for step_counter in range(steps): + time_step = 0.01 + t = step_counter * time_step + + amplitude1 = amplitude_1_bound + amplitude2 = amplitude_2_bound + steering_amplitude = 0 + if t < 10: + steering_amplitude = 0.5 + elif t < 20: + steering_amplitude = -0.5 + else: + steering_amplitude = 0 + + # Applying asymmetrical sine gaits to different legs can steer the minitaur. + a1 = math.sin(t * speed) * (amplitude1 + steering_amplitude) + a2 = math.sin(t * speed + math.pi) * (amplitude1 - steering_amplitude) + a3 = math.sin(t * speed) * amplitude2 + a4 = math.sin(t * speed + math.pi) * amplitude2 + action = [a1, a2, a2, a1, a3, a4, a4, a3] + _, reward, done, _ = environment.step(action) + sum_reward += reward + if done: + break + environment.reset() + + +def main(): + parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('--env', help='environment ID (0==sine, 1==stand, 2=reset, 3=overheat)',type=int, default=0) + args = parser.parse_args() + print("--env=" + str(args.env)) + + if (args.env == 0): + SinePolicyExample() + if (args.env == 1): + SineStandExample() + if (args.env == 2): + ResetPoseExample() + if (args.env == 3): + MotorOverheatExample() + +if __name__ == '__main__': + main() + + From 36c9f2f93bf082ef8606e5a0d11e1b3ed910d8be Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 27 Sep 2017 09:09:43 -0700 Subject: [PATCH 34/38] bump up pybullet version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6f6b16fcb..25318258c 100644 --- a/setup.py +++ b/setup.py @@ -441,7 +441,7 @@ print("-----") setup( name = 'pybullet', - version='1.4.6', + version='1.4.8', description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning', long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.', url='https://github.com/bulletphysics/bullet3', From e4a3b3fe3871e8400e041fa0d016532bcd7c8890 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 27 Sep 2017 10:20:38 -0700 Subject: [PATCH 35/38] add TensorFlow Agents PPO training script for various pybullet environments: example: python -m pybullet_envs.agents.train_ppo --config=pybullet_pendulum --logdir=pendulum --- .../gym/pybullet_envs/agents/config_ppo.py | 110 ++++++++++++++++++ .../gym/pybullet_envs/agents/train_ppo.py | 48 ++++++++ .../gym/pybullet_envs/agents/visualize_ppo.py | 42 +++++++ 3 files changed, 200 insertions(+) create mode 100644 examples/pybullet/gym/pybullet_envs/agents/config_ppo.py create mode 100644 examples/pybullet/gym/pybullet_envs/agents/train_ppo.py create mode 100644 examples/pybullet/gym/pybullet_envs/agents/visualize_ppo.py diff --git a/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py b/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py new file mode 100644 index 000000000..26dcf5af4 --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py @@ -0,0 +1,110 @@ +"""The PPO training configuration file for minitaur environments.""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +import functools +from agents import ppo +from agents.scripts import networks +from pybullet_envs.bullet import minitaur_gym_env +from pybullet_envs.bullet import minitaur_env_randomizer +import pybullet_envs.bullet.minitaur_gym_env as minitaur_gym_env +import pybullet_envs + + +# pylint: disable=unused-variable +def default(): + """The default configurations.""" + # General + algorithm = ppo.PPOAlgorithm + num_agents = 25 + eval_episodes = 25 + use_gpu = False + # Network + network = networks.ForwardGaussianPolicy + weight_summaries = dict( + all=r'.*', policy=r'.*/policy/.*', value=r'.*/value/.*') + policy_layers = 200, 100 + value_layers = 200, 100 + init_mean_factor = 0.2 + init_logstd = -1 + network_config = dict() + # Optimization + update_every = 25 + policy_optimizer = 'AdamOptimizer' + value_optimizer = 'AdamOptimizer' + update_epochs_policy = 25 + update_epochs_value = 25 + value_lr = 1e-3 + policy_lr = 1e-4 + # Losses + discount = 0.99 + kl_target = 1e-2 + kl_cutoff_factor = 2 + kl_cutoff_coef = 1000 + kl_init_penalty = 1 + return locals() + + +def pybullet_pendulum(): + locals().update(default()) + env = 'InvertedPendulumBulletEnv-v0' + max_length = 200 + steps = 5e7 # 50M + return locals() + +def pybullet_doublependulum(): + locals().update(default()) + env = 'InvertedDoublePendulumBulletEnv-v0' + max_length = 1000 + steps = 5e7 # 50M + return locals() + +def pybullet_pendulumswingup(): + locals().update(default()) + env = 'InvertedPendulumSwingupBulletEnv-v0' + max_length = 1000 + steps = 5e7 # 50M + return locals() + +def pybullet_cheetah(): + """Configuration for MuJoCo's half cheetah task.""" + locals().update(default()) + # Environment + env = 'HalfCheetahBulletEnv-v0' + max_length = 1000 + steps = 1e8 # 100M + return locals() + +def pybullet_ant(): + locals().update(default()) + env = 'AntBulletEnv-v0' + max_length = 1000 + steps = 5e7 # 50M + return locals() + +def pybullet_racecar(): + """Configuration for Bullet MIT Racecar task.""" + locals().update(default()) + # Environment + env = 'RacecarBulletEnv-v0' #functools.partial(racecarGymEnv.RacecarGymEnv, isDiscrete=False, renders=True) + max_length = 10 + steps = 1e7 # 10M + return locals() + + +def pybullet_minitaur(): + """Configuration specific to minitaur_gym_env.MinitaurBulletEnv class.""" + locals().update(default()) + randomizer = (minitaur_env_randomizer.MinitaurBulletRandomizer()) + env = functools.partial( + minitaur_gym_env.MinitaurGymEnv, + accurate_motor_model_enabled=True, + motor_overheat_protection=True, + pd_control_enabled=True, + env_randomizer=randomizer, + render=False) + max_length = 1000 + steps = 3e7 # 30M + return locals() + + diff --git a/examples/pybullet/gym/pybullet_envs/agents/train_ppo.py b/examples/pybullet/gym/pybullet_envs/agents/train_ppo.py new file mode 100644 index 000000000..195df7df8 --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/agents/train_ppo.py @@ -0,0 +1,48 @@ +r"""Script to use Proximal Policy Gradient for the minitaur environments. + +Run: + python train_ppo.py --logdif=/tmp/train --config=minitaur_pybullet + +""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import datetime +import os +import tensorflow as tf + +from agents import tools +from agents.scripts import train +from agents.scripts import utility +from . import config_ppo + + +flags = tf.app.flags +FLAGS = tf.app.flags.FLAGS + +flags.DEFINE_string( + 'logdir', None, + 'Base directory to store logs.') +flags.DEFINE_string( + 'config', None, + 'Configuration to execute.') +flags.DEFINE_string( + 'timestamp', datetime.datetime.now().strftime('%Y%m%dT%H%M%S'), + 'Sub directory to store logs.') + + +def main(_): + """Create or load configuration and launch the trainer.""" + config = tools.AttrDict(getattr(config_ppo, FLAGS.config)()) + logdir = FLAGS.logdir and os.path.join( + FLAGS.logdir, '{}-{}'.format(FLAGS.timestamp, FLAGS.config)) + utility.save_config(config, logdir) + for score in train.train(config, env_processes=True): + tf.logging.info(str(score)) + + +if __name__ == '__main__': + tf.app.run() + diff --git a/examples/pybullet/gym/pybullet_envs/agents/visualize_ppo.py b/examples/pybullet/gym/pybullet_envs/agents/visualize_ppo.py new file mode 100644 index 000000000..fa5f7b21c --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/agents/visualize_ppo.py @@ -0,0 +1,42 @@ + +r"""Script to visualize the trained PPO agent. + +python -m pybullet_envs.agents.visualize \ +--logdir=ppo +--outdir=/tmp/video/ + +""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import tensorflow as tf + +from agents.scripts import visualize + + +flags = tf.app.flags +FLAGS = tf.app.flags.FLAGS +flags.DEFINE_string("logdir", None, + "Directory to the checkpoint of a training run.") +flags.DEFINE_string("outdir", None, + "Local directory for storing the monitoring outdir.") +flags.DEFINE_string("checkpoint", None, + "Checkpoint name to load; defaults to most recent.") +flags.DEFINE_integer("num_agents", 1, + "How many environments to step in parallel.") +flags.DEFINE_integer("num_episodes", 1, "Minimum number of episodes to render.") +flags.DEFINE_boolean( + "env_processes", False, + "Step environments in separate processes to circumvent the GIL.") + + +def main(_): + visualize.visualize(FLAGS.logdir, FLAGS.outdir, FLAGS.num_agents, + FLAGS.num_episodes, FLAGS.checkpoint, FLAGS.env_processes) + + +if __name__ == "__main__": + tf.app.run() + From 5082d6af15073c49e80aa582637938f1939a904a Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 27 Sep 2017 10:26:45 -0700 Subject: [PATCH 36/38] bump up pybullet version, instruction to visualize agents ppo: python -m pybullet_envs.agents.visualize_ppo -config=pybullet_pendulum --logdir=pendulum/20170927T101514-pybullet_pendulum/ --outdir=vid tensorboard --logdir=20170927T101514-pybullet_pendulum --port=2222 --- .../gym/pybullet_envs/examples/minitaur_gym_env_example.py | 3 --- setup.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py b/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py index b71ee5fc6..d75d2254c 100644 --- a/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py +++ b/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py @@ -1,7 +1,4 @@ r"""An example to run of the minitaur gym environment with sine gaits. - -blaze run -c opt //robotics/reinforcement_learning/minitaur/\ -envs:minitaur_gym_env_example """ import math diff --git a/setup.py b/setup.py index 25318258c..29139f534 100644 --- a/setup.py +++ b/setup.py @@ -441,7 +441,7 @@ print("-----") setup( name = 'pybullet', - version='1.4.8', + version='1.4.9', description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning', long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.', url='https://github.com/bulletphysics/bullet3', From a7167529158485366dd59bb5afb25fa66835e753 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 27 Sep 2017 10:30:05 -0700 Subject: [PATCH 37/38] add __init__.py file in agents folder --- examples/pybullet/gym/pybullet_envs/agents/__init__.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 examples/pybullet/gym/pybullet_envs/agents/__init__.py diff --git a/examples/pybullet/gym/pybullet_envs/agents/__init__.py b/examples/pybullet/gym/pybullet_envs/agents/__init__.py new file mode 100644 index 000000000..139597f9c --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/agents/__init__.py @@ -0,0 +1,2 @@ + + From 4dca5b3ef593a6a2a6cdf410fe3fc64d490164ba Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 27 Sep 2017 12:17:59 -0700 Subject: [PATCH 38/38] fix typos in agents config --- examples/pybullet/gym/pybullet_envs/agents/config_ppo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py b/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py index 26dcf5af4..2ccd38adc 100644 --- a/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py +++ b/examples/pybullet/gym/pybullet_envs/agents/config_ppo.py @@ -95,9 +95,9 @@ def pybullet_racecar(): def pybullet_minitaur(): """Configuration specific to minitaur_gym_env.MinitaurBulletEnv class.""" locals().update(default()) - randomizer = (minitaur_env_randomizer.MinitaurBulletRandomizer()) + randomizer = (minitaur_env_randomizer.MinitaurEnvRandomizer()) env = functools.partial( - minitaur_gym_env.MinitaurGymEnv, + minitaur_gym_env.MinitaurBulletEnv, accurate_motor_model_enabled=True, motor_overheat_protection=True, pd_control_enabled=True,