本文整理汇总了C#中FarseerPhysics.Dynamics.Body.Advance方法的典型用法代码示例。如果您正苦于以下问题:C# Body.Advance方法的具体用法?C# Body.Advance怎么用?C# Body.Advance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FarseerPhysics.Dynamics.Body
的用法示例。
在下文中一共展示了Body.Advance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SolveTOI
//.........这里部分代码省略.........
continue;
}
Body bodyA = fixtureA.Body;
Body bodyB = fixtureB.Body;
// Compute the time of impact in interval [0, minTOI]
TOIInput input = new TOIInput();
input.ProxyA.Set(fixtureA.Shape, indexA);
input.ProxyB.Set(fixtureB.Shape, indexB);
input.SweepA = bodyA.Sweep;
input.SweepB = bodyB.Sweep;
input.TMax = toi;
TOIOutput output;
TimeOfImpact.CalculateTimeOfImpact(out output, ref input);
if (output.State == TOIOutputState.Touching && output.T < toi)
{
toiContact = contact;
toi = output.T;
toiOther = other;
found = true;
}
++count;
}
++iter;
} while (found && count > 1 && iter < 50);
if (toiContact == null)
{
body.Advance(1.0f);
return;
}
Sweep backup = body.Sweep;
body.Advance(toi);
toiContact.Update(ContactManager);
if (toiContact.Enabled == false)
{
// Contact disabled. Backup and recurse.
body.Sweep = backup;
SolveTOI(body);
}
++toiContact.TOICount;
// Update all the valid contacts on this body and build a contact island.
count = 0;
for (ContactEdge ce = body.ContactList; (ce != null) && (count < Settings.MaxTOIContacts); ce = ce.Next)
{
Body other = ce.Other;
BodyType type = other.BodyType;
// Only perform correction with static bodies, so the
// body won't get pushed out of the world.
if (type == BodyType.Dynamic)
{
continue;
}
// Check for a disabled contact.
Contact contact = ce.Contact;
if (contact.Enabled == false)