本文整理汇总了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;
}
示例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;
}