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


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

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


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

示例1: realLoadAsset


//.........这里部分代码省略.........
		for (unsigned int i = 0; i < numJoints; i++)
		{
			joint = (ms3d_joint_t*) pPtr;
			pPtr += sizeof(byte) + sizeof(char) * 32 * 2 + sizeof(float) * 3 * 2
					+ sizeof(word) * 2;
			bn = new Bone();
			strncpy(name, joint->name, 32);
			name[32] = '\0';
			bn->setName(name);
			strncpy(name, joint->parentName, 32);
			bn->setParentName(name);

			bn->setReferenceTransformation(
					glm::vec3(joint->position[0], joint->position[1],
							joint->position[2]),
					glm::quat(
							glm::vec3(joint->rotation[0], joint->rotation[1],
									joint->rotation[2])));
			for (unsigned int x = 0; x < joint->numKeyFramesRot; x++)
			{
				kf_rot = (ms3d_keyframe_rot_t*) pPtr;
				pPtr += sizeof(ms3d_keyframe_rot_t);
				bn->addRotation(
						new Keyframe(kf_rot->time,
								glm::vec3(kf_rot->rotation[0],
										kf_rot->rotation[1],
										kf_rot->rotation[2])));
			}

			for (unsigned int x = 0; x < joint->numKeyFramesTrans; x++)
			{
				kf_trans = (ms3d_keyframe_pos_t*) pPtr;
				pPtr += sizeof(ms3d_keyframe_pos_t);
				bn->addPosition(
						new Keyframe(kf_trans->time,
								glm::vec3(kf_trans->position[0],
										kf_trans->position[1],
										kf_trans->position[2])));
			}

			(*bones)[i] = bn;
		}

		/********************************
		 *  Step Over Comments
		 *******************************/
		pPtr += sizeof(int); //subversion
		ms3d_comment_t* cmnt = NULL;
		unsigned int numCmnts = 0;
		for (int x = 0; x < 4; x++)
		{
			numCmnts = *(unsigned int*) pPtr;
			pPtr += sizeof(unsigned int);
			for (unsigned int i = 0; i < numCmnts; i++)
			{
				cmnt = (ms3d_comment_t*) pPtr;
				pPtr += sizeof(int) * 2;
				pPtr += sizeof(char) * cmnt->commentLength;
			}
		}
		/****************************
		 * End StepOver comments
		 ***************************/
		int subVersion = (int) *pPtr;
		pPtr += sizeof(int);
		if (subVersion == 1)
开发者ID:Cracky,项目名称:XiyaGE,代码行数:67,代码来源:ModelLoader.cpp


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