本文整理汇总了Java中org.jbox2d.collision.TimeOfImpact.toiCalls方法的典型用法代码示例。如果您正苦于以下问题:Java TimeOfImpact.toiCalls方法的具体用法?Java TimeOfImpact.toiCalls怎么用?Java TimeOfImpact.toiCalls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jbox2d.collision.TimeOfImpact
的用法示例。
在下文中一共展示了TimeOfImpact.toiCalls方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: launch
import org.jbox2d.collision.TimeOfImpact; //导入方法依赖的package包/类
public void launch() {
m_body.setTransform(new Vec2(0.0f, 4.0f), 0.0f);
m_body.setLinearVelocity(new Vec2());
m_body.setAngularVelocity(0.0f);
m_x = MathUtils.randomFloat(-1.0f, 1.0f);
m_bullet.setTransform(new Vec2(m_x, 10.0f), 0.0f);
m_bullet.setLinearVelocity(new Vec2(0.0f, -50.0f));
m_bullet.setAngularVelocity(0.0f);
Distance.GJK_CALLS = 0;
Distance.GJK_ITERS = 0;
Distance.GJK_MAX_ITERS = 0;
TimeOfImpact.toiCalls = 0;
TimeOfImpact.toiIters = 0;
TimeOfImpact.toiMaxIters = 0;
TimeOfImpact.toiRootIters = 0;
TimeOfImpact.toiMaxRootIters = 0;
}
示例2: step
import org.jbox2d.collision.TimeOfImpact; //导入方法依赖的package包/类
@Override
public void step(TestbedSettings settings) {
super.step(settings);
if (Distance.GJK_CALLS > 0) {
addTextLine(String.format("gjk calls = %d, ave gjk iters = %3.1f, max gjk iters = %d",
Distance.GJK_CALLS, Distance.GJK_ITERS * 1.0 / (Distance.GJK_CALLS),
Distance.GJK_MAX_ITERS));
}
if (TimeOfImpact.toiCalls > 0) {
addTextLine(String.format("toi calls = %d, ave toi iters = %3.1f, max toi iters = %d",
TimeOfImpact.toiCalls, TimeOfImpact.toiIters * 1f / (TimeOfImpact.toiCalls),
TimeOfImpact.toiMaxRootIters));
addTextLine(String.format("ave toi root iters = %3.1f, max toi root iters = %d",
TimeOfImpact.toiRootIters * 1f / (TimeOfImpact.toiCalls), TimeOfImpact.toiMaxRootIters));
}
if (getStepCount() % 60 == 0) {
launch();
}
}