From 8a16ed5009eecfb79fb6b78200485ce44d1b7b9b Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 3 Sep 2020 20:30:14 +0800 Subject: [PATCH] fix the issue "Inconsistency between rayTest and rayTestBatch of pybullet #2887" we should initialize these variables otherwise these will be random. --- examples/SharedMemory/PhysicsClientC_API.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 23fe53071..185c601a9 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -3701,6 +3701,8 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsCl command->m_requestRaycastIntersections.m_numCommandRays = 1; command->m_requestRaycastIntersections.m_numStreamingRays = 0; command->m_requestRaycastIntersections.m_numThreads = 1; + command->m_requestRaycastIntersections.m_parentObjectUniqueId = -1; + command->m_requestRaycastIntersections.m_parentLinkIndex=-1; command->m_requestRaycastIntersections.m_numCommandRays = 1; command->m_requestRaycastIntersections.m_fromToRays[0].m_rayFromPosition[0] = rayFromWorldX;