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


C++ Frame::ClearMovement方法代码示例

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


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

示例1: Frame

Frame *Frame::Unserialize(Serializer::Reader &rd, Space *space, Frame *parent)
{
	Frame *f = new Frame();
	f->m_parent = parent;
	f->m_flags = rd.Int32();
	f->m_radius = rd.Double();
	f->m_label = rd.String();
	f->m_pos = rd.Vector3d();
	for (int i=0; i<9; i++) f->m_orient[i] = rd.Double();
	f->m_angSpeed = rd.Double();
	f->m_sbody = space->GetSystemBodyByIndex(rd.Int32());
	f->m_astroBodyIndex = rd.Int32();
	f->m_vel = vector3d(0.0);
	for (int i=rd.Int32(); i>0; --i) {
		f->m_children.push_back(Unserialize(rd, space, f));
	}
	Sfx::Unserialize(rd, f);

	f->ClearMovement();
	return f;
}
开发者ID:Faiva78,项目名称:pioneer,代码行数:21,代码来源:Frame.cpp

示例2: Frame

Frame *Frame::FromJson(const Json::Value &jsonObj, Space *space, Frame *parent, double at_time)
{
	Frame *f = new Frame();
	f->m_parent = parent;

	if (!jsonObj.isMember("frame")) throw SavedGameCorruptException();
	Json::Value frameObj = jsonObj["frame"];

	if (!frameObj.isMember("flags")) throw SavedGameCorruptException();
	if (!frameObj.isMember("radius")) throw SavedGameCorruptException();
	if (!frameObj.isMember("label")) throw SavedGameCorruptException();
	if (!frameObj.isMember("pos")) throw SavedGameCorruptException();
	if (!frameObj.isMember("ang_speed")) throw SavedGameCorruptException();
	if (!frameObj.isMember("init_orient")) throw SavedGameCorruptException();
	if (!frameObj.isMember("index_for_system_body")) throw SavedGameCorruptException();
	if (!frameObj.isMember("index_for_astro_body")) throw SavedGameCorruptException();

	f->m_flags = frameObj["flags"].asInt();
	f->m_radius = StrToDouble(frameObj["radius"].asString());
	f->m_label = frameObj["label"].asString();
	JsonToVector(&(f->m_pos), frameObj, "pos");
	f->m_angSpeed = StrToDouble(frameObj["ang_speed"].asString());
	matrix3x3d orient;
	JsonToMatrix(&orient, frameObj, "init_orient");
	f->SetInitialOrient(orient, at_time);
	f->m_sbody = space->GetSystemBodyByIndex(frameObj["index_for_system_body"].asUInt());
	f->m_astroBodyIndex = frameObj["index_for_astro_body"].asUInt();
	f->m_vel = vector3d(0.0); // m_vel is set to zero.

	if (!frameObj.isMember("child_frames")) throw SavedGameCorruptException();
	Json::Value childFrameArray = frameObj["child_frames"];
	if (!childFrameArray.isArray()) throw SavedGameCorruptException();
	for (unsigned int i = 0; i < childFrameArray.size(); ++i) {
		f->m_children.push_back(FromJson(childFrameArray[i], space, f, at_time));
	}
	SfxManager::FromJson(frameObj, f);

	f->ClearMovement();
	return f;
}
开发者ID:Philbywhizz,项目名称:pioneer,代码行数:40,代码来源:Frame.cpp


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