From 037043467a3614060f8bd94c3d5fc17766152657 Mon Sep 17 00:00:00 2001 From: yunfeibai Date: Thu, 8 Jun 2017 18:59:11 -0700 Subject: [PATCH] Bug fix. Only return friction coefficient when there is a valid link collider. --- .../SharedMemory/PhysicsServerCommandProcessor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 9103e4384..9c8bfccd6 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -4528,7 +4528,15 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm else { serverCmd.m_dynamicsInfo.m_mass = mb->getLinkMass(linkIndex); - serverCmd.m_dynamicsInfo.m_lateralFrictionCoeff = mb->getLinkCollider(linkIndex)->getFriction(); + if (mb->getLinkCollider(linkIndex)) + { + serverCmd.m_dynamicsInfo.m_lateralFrictionCoeff = mb->getLinkCollider(linkIndex)->getFriction(); + } + else + { + b3Warning("The dynamic info requested is not available"); + serverCmd.m_type = CMD_GET_DYNAMICS_INFO_FAILED; + } } hasStatus = true; }