本文整理汇总了C#中Box2D.Dynamics.b2World.GetWarmStarting方法的典型用法代码示例。如果您正苦于以下问题:C# b2World.GetWarmStarting方法的具体用法?C# b2World.GetWarmStarting怎么用?C# b2World.GetWarmStarting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box2D.Dynamics.b2World
的用法示例。
在下文中一共展示了b2World.GetWarmStarting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: B2n
public JObject B2n(b2World world)
{
JObject worldValue = new JObject();
m_bodyToIndexMap.Clear();
m_jointToIndexMap.Clear();
VecToJson("gravity", world.Gravity, worldValue);
worldValue["allowSleep"] = world.AllowSleep;
//worldValue["autoClearForces"] = world.;
worldValue["warmStarting"] = world.GetWarmStarting();
//worldValue["continuousPhysics"] = world.isco;
JArray customPropertyValue = WriteCustomPropertiesToJson(null);
if (customPropertyValue.Count > 0)
worldValue["customProperties"] = customPropertyValue;
int i = 0;
b2Body tmp = world.BodyList;
while (tmp != null)
{
m_bodyToIndexMap.Add(tmp, i);
worldValue.Add("body", B2n(tmp));
tmp = tmp.Next;
i++;
}
b2Joint tmpJoint = world.JointList;
while (true)
{
if (tmpJoint.GetJointType() == b2JointType.e_gearJoint)
continue;
m_jointToIndexMap.Add(tmpJoint, i);
worldValue.Add("joint", B2n(world));
i++;
tmpJoint = tmpJoint.Next;
}
tmpJoint = world.JointList;
while (true)
{
if (tmpJoint.GetJointType() == b2JointType.e_gearJoint)
continue;
m_jointToIndexMap.Add(tmpJoint, i);
worldValue.Add("joint", B2n(world));
i++;
tmpJoint = tmpJoint.Next;
}
// Currently the only efficient way to add images to a Jb2dJson
// is by using the R.U.B.E editor. This code has not been tested,
// but should work ok.
i = 0;
foreach (var image in m_imageToNameMap.Keys)
{
worldValue.Add("image", B2n(image));
}
m_bodyToIndexMap.Clear();
m_jointToIndexMap.Clear();
return worldValue;
}