fix 6dof sensors for fixed joints (recent bug left fields uninitialized in getJointInfo)

add premake build support for Test_PhysicsClientUDP
This commit is contained in:
Erwin Coumans
2017-02-20 13:18:33 -08:00
parent c10dfe6a80
commit 55361e262e
4 changed files with 68 additions and 7 deletions

View File

@@ -558,12 +558,18 @@ int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle
{
state->m_jointPosition = status->m_sendActualStateArgs.m_actualStateQ[info.m_qIndex];
state->m_jointVelocity = status->m_sendActualStateArgs.m_actualStateQdot[info.m_uIndex];
for (int ii(0); ii < 6; ++ii) {
} else
{
state->m_jointPosition=0;
state->m_jointVelocity=0;
}
for (int ii(0); ii < 6; ++ii)
{
state->m_jointForceTorque[ii] = status->m_sendActualStateArgs.m_jointReactionForces[6 * jointIndex + ii];
}
state->m_jointMotorTorque = status->m_sendActualStateArgs.m_jointMotorForce[jointIndex];
return 1;
}
}
}
return 0;

View File

@@ -133,9 +133,11 @@ int main(int argc, char *argv[])
{
if (gVerboseNetworkMessagesServer)
{
int dataLen = (int)event.packet->dataLength;
printf("A packet of length %u containing '%s' was "
"received from %s on channel %u.\n",
event.packet->dataLength,
dataLen,
event.packet->data,
event.peer->data,
event.channelID);

View File

@@ -29,6 +29,58 @@ project ("Test_SharedMemoryPhysicsClient")
"../../examples/Utils/b3ResourcePath.h",
}
project ("Test_PhysicsClientUDP")
language "C++"
kind "ConsoleApp"
includedirs {
"../../src",
"../../examples",
"../../examples/ThirdPartyLibs/enet/include"
}
links {
"enet",
"BulletFileLoader",
"Bullet3Common",
"LinearMath"
}
if os.is("Windows") then
defines { "WIN32" }
links {"Ws2_32","Winmm"}
end
defines {"PHYSICS_UDP"}
files {
"test.c",
"../../examples/SharedMemory/PhysicsClient.cpp",
"../../examples/SharedMemory/PhysicsClient.h",
"../../examples/SharedMemory/PhysicsClientSharedMemory.cpp",
"../../examples/SharedMemory/PhysicsClientSharedMemory.h",
"../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp",
"../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.h",
"../../examples/SharedMemory/PhysicsClientUDP.cpp",
"../../examples/SharedMemory/PhysicsClientUDP.h",
"../../examples/SharedMemory/PhysicsClientUDP_C_API.cpp",
"../../examples/SharedMemory/PhysicsClientUDP_C_API.h",
"../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.h",
"../../examples/SharedMemory/PhysicsClientC_API.cpp",
"../../examples/SharedMemory/PhysicsClientC_API.h",
"../../examples/SharedMemory/Win32SharedMemory.cpp",
"../../examples/SharedMemory/Win32SharedMemory.h",
"../../examples/SharedMemory/PosixSharedMemory.cpp",
"../../examples/SharedMemory/PosixSharedMemory.h",
"../../examples/Utils/b3ResourcePath.cpp",
"../../examples/Utils/b3ResourcePath.h",
"../../examples/SharedMemory/PhysicsDirect.cpp",
"../../examples/Utils/b3Clock.cpp",
"../../examples/MultiThreading/b3PosixThreadSupport.cpp",
"../../examples/MultiThreading/b3Win32ThreadSupport.cpp",
"../../examples/MultiThreading/b3ThreadSupportInterface.cpp",
}
project ("Test_PhysicsServerLoopBack")
language "C++"

View File

@@ -256,6 +256,7 @@ void testSharedMemory(b3PhysicsClientHandle sm)
b3RequestCameraImageSetPixelResolution(command, width, height);
statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command);
}
if (b3CanSubmitCommand(sm))
{
b3SharedMemoryStatusHandle state = b3SubmitClientCommandAndWaitStatus(sm, b3RequestActualStateCommandInit(sm,bodyIndex));