MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / processBodyJointInfo

Method processBodyJointInfo

examples/SharedMemory/PhysicsDirect.cpp:675–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675void PhysicsDirect::processBodyJointInfo(int bodyUniqueId, const SharedMemoryStatus& serverCmd)
676{
677 BodyJointInfoCache2** cachePtr = m_data->m_bodyJointMap[bodyUniqueId];
678 //don't process same bodyUniqueId multiple times
679 if (cachePtr)
680 {
681 return;
682 }
683
684 bParse::btBulletFile bf(
685 &m_data->m_bulletStreamDataServerToClient[0],
686 serverCmd.m_numDataStreamBytes);
687 if (m_data->m_serverDNA.size())
688 {
689 bf.setFileDNA(false, &m_data->m_serverDNA[0], m_data->m_serverDNA.size());
690 }
691 else
692 {
693 bf.setFileDNAisMemoryDNA();
694 }
695 {
696 BT_PROFILE("bf.parse");
697 bf.parse(false);
698 }
699
700 BodyJointInfoCache2* bodyJoints = new BodyJointInfoCache2;
701 m_data->m_bodyJointMap.insert(bodyUniqueId, bodyJoints);
702 bodyJoints->m_bodyName = serverCmd.m_dataStreamArguments.m_bodyName;
703
704 for (int i = 0; i < bf.m_multiBodies.size(); i++)
705 {
706 int flag = bf.getFlags();
707 if ((flag & bParse::FD_DOUBLE_PRECISION) != 0)
708 {
709 Bullet::btMultiBodyDoubleData* mb =
710 (Bullet::btMultiBodyDoubleData*)bf.m_multiBodies[i];
711
712 if (mb->m_baseName)
713 {
714 bodyJoints->m_baseName = mb->m_baseName;
715 }
716 addJointInfoFromMultiBodyData(mb, bodyJoints, m_data->m_verboseOutput);
717 }
718 else
719 {
720 Bullet::btMultiBodyFloatData* mb =
721 (Bullet::btMultiBodyFloatData*)bf.m_multiBodies[i];
722
723 if (mb->m_baseName)
724 {
725 bodyJoints->m_baseName = mb->m_baseName;
726 }
727 addJointInfoFromMultiBodyData(mb, bodyJoints, m_data->m_verboseOutput);
728
729 }
730 }
731 if (bf.ok())
732 {

Callers

nothing calls this directly

Calls 8

setFileDNAMethod · 0.80
setFileDNAisMemoryDNAMethod · 0.80
sizeMethod · 0.45
parseMethod · 0.45
insertMethod · 0.45
getFlagsMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected