当前位置: 首页>>代码示例>>C++>>正文


C++ Bone::getChannelOrder方法代码示例

本文整理汇总了C++中Bone::getChannelOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ Bone::getChannelOrder方法的具体用法?C++ Bone::getChannelOrder怎么用?C++ Bone::getChannelOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bone的用法示例。


在下文中一共展示了Bone::getChannelOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeAMC

bool AMC_Writer::writeAMC(const char* outputFilename, 
		Skeleton* skeleton, 
		MotionSequence* motion,
		bool overwrite)
{
	if (!overwrite && FileSystem::fileExists(outputFilename))
		return false;

	ofstream ofs(outputFilename);
	if (!ofs) return false;

	// comments
	//ofs << "# ASF:" << skeleton->getId() << " AMC:" << motion->getId() << endl;
	//ofs << "# Documentation: " << motion->getDocumentation() << endl;
	//ofs << "# Source: " << motion->getSource() << endl;
	//ofs << "# Framerate: " << motion->getFrameRate() << endl;

	// standard qualifiers
	ofs << ":FULLY-SPECIFIED" << endl;
	ofs << ":DEGREES" << endl;

	for (int frame=0; frame<motion->numFrames(); frame++)
	{
		// write frame number (start at 1)
		ofs << frame+1 << endl;
		for (int bone_id=0; bone_id<skeleton->numBones(); bone_id++)
		{
			string bone_name = skeleton->boneNameFromId(bone_id);
			Bone* bone = skeleton->getBone(bone_id);
			// skip bones with no valid DOF
			if (bone->getChannelOrder(0) == CT_INVALID) continue;
			ofs << bone_name << " ";
			for (int d=0; d<6; d++)
			{
				// FIXIT! do not write bones that have 0 DOF
				CHANNEL_TYPE dof_id = bone->getChannelOrder(d);
				if (dof_id != CT_INVALID)
				{
					CHANNEL_ID channel_id(bone_id, dof_id);
					float value = motion->getValue(channel_id, frame);
					if ((dof_id==CT_RX) || (dof_id==CT_RY) || (dof_id==CT_RZ))
						value = rad2deg(value);
					ofs << value << " ";
				}
			}
			ofs << endl;
		}
	}
	ofs.close();
	return true;
}
开发者ID:MichaelDoherty,项目名称:SKA,代码行数:51,代码来源:AMC_Writer.cpp


注:本文中的Bone::getChannelOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。