本文整理汇总了C++中ArRef::writeFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ ArRef::writeFloat方法的具体用法?C++ ArRef::writeFloat怎么用?C++ ArRef::writeFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArRef
的用法示例。
在下文中一共展示了ArRef::writeFloat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
UDPKinectSkeleton::_transmitCurrentPoseOSC()
{
if (_udp.valid() && _skeleton.valid())
{
ArConstRef<Joint> torso = _skeleton->findJoint("torso");
ArRef<MemoryBlock> memory = MemoryBlock::NEW();
ArRef<MemoryOStream> stream = MemoryOStream::NEW(memory,0);
_writeStringOSC("/skeleton",stream);
ArRef<MemoryBlock> memory2 = MemoryBlock::NEW();
ArRef<MemoryOStream> stream2 = MemoryOStream::NEW(memory2,0);
_writeStringOSC("/skeleton_local",stream2);
unsigned int nb = _skeleton->getNbJoints();
StlString typeString = ",";
for (size_t i(0);i<nb;++i)
{ typeString+="sfff"; }
_writeStringOSC(typeString,stream);
_writeStringOSC(typeString,stream2);
for (unsigned int i(0);i<nb;++i)
{
ArConstRef<Joint> joint = _skeleton->getJoint(i);
const StlString jointName = joint->getName();
_writeStringOSC(jointName,stream);
_writeStringOSC(jointName,stream2);
double x,y,z;
joint->getPosition(x,y,z);
stream->writeFloat(x);
stream->writeFloat(y);
stream->writeFloat(z);
if ( (torso.valid()) && (joint != torso) )
{ torso->globalToLocalPosition(x,y,z); }
stream2->writeFloat(x);
stream2->writeFloat(y);
stream2->writeFloat(z);
}
for (unsigned int i(0);i<_addresses.size();++i)
{
if (_addresses[i].OSC)
{
_udp->sendBytes(memory,0,memory->getSize(),
_addresses[i].ip,_addresses[i].port);
if (_addresses[i].port2 != 0)
{
_udp->sendBytes(memory2,0,memory2->getSize(),
_addresses[i].ip,_addresses[i].port2);
}
}
}
}
}