本文整理汇总了Java中org.jbox2d.dynamics.contacts.Contact.getManifold方法的典型用法代码示例。如果您正苦于以下问题:Java Contact.getManifold方法的具体用法?Java Contact.getManifold怎么用?Java Contact.getManifold使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jbox2d.dynamics.contacts.Contact
的用法示例。
在下文中一共展示了Contact.getManifold方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postSolve
import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
if (m_broke) {
// The body already broke.
return;
}
// Should the body break?
int count = contact.getManifold().pointCount;
float maxImpulse = 0.0f;
for (int i = 0; i < count; ++i) {
maxImpulse = MathUtils.max(maxImpulse, impulse.normalImpulses[i]);
}
if (maxImpulse > 30.0f) {
// Flag the body for breaking.
m_break = true;
}
}
示例2: postSolve
import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
/**
* @see org.jbox2d.testbed.framework.TestbedTest#postSolve(org.jbox2d.dynamics.contacts.Contact,
* org.jbox2d.callbacks.ContactImpulse)
*/
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
if (m_broke) {
// The body already broke.
return;
}
// Should the body break?
int count = contact.getManifold().pointCount;
float maxImpulse = 0.0f;
for (int i = 0; i < count; ++i) {
maxImpulse = MathUtils.max(maxImpulse, impulse.normalImpulses[i]);
}
if (maxImpulse > 40.0f) {
// Flag the body for breaking.
m_break = true;
}
}
示例3: preSolve
import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
/**
* @see org.jbox2d.callbacks.ContactListener#preSolve(org.jbox2d.dynamics.contacts.Contact, org.jbox2d.collision.Manifold)
*/
public void preSolve(Contact contact, Manifold oldManifold) {
Manifold manifold = contact.getManifold();
if(manifold.pointCount == 0){
return;
}
Fixture fixtureA = contact.getFixtureA();
Fixture fixtureB = contact.getFixtureB();
Collision.getPointStates(state1, state2, oldManifold, manifold);
contact.getWorldManifold(worldManifold);
for(int i=0; i<manifold.pointCount && m_pointCount < MAX_CONTACT_POINTS; i++){
ContactPoint cp = points[m_pointCount];
cp.fixtureA = fixtureA;
cp.fixtureB = fixtureB;
cp.position.set(worldManifold.points[i]);
cp.normal.set(worldManifold.normal);
cp.state = state2[i];
++m_pointCount;
}
}
示例4: postSolve
import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
if (m_broke) {
// The body already broke.
return;
}
// Should the body break?
int count = contact.getManifold().pointCount;
float maxImpulse = 0.0f;
for (int i = 0; i < count; ++i) {
maxImpulse = MathUtils.max(maxImpulse, impulse.normalImpulses[i]);
}
if (maxImpulse > 40.0f) {
// Flag the body for breaking.
m_break = true;
}
}
示例5: preSolve
import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
public void preSolve(Contact contact, Manifold oldManifold) {
Manifold manifold = contact.getManifold();
if (manifold.pointCount == 0) {
return;
}
Fixture fixtureA = contact.getFixtureA();
Fixture fixtureB = contact.getFixtureB();
Collision.getPointStates(state1, state2, oldManifold, manifold);
contact.getWorldManifold(worldManifold);
for (int i = 0; i < manifold.pointCount && pointCount < MAX_CONTACT_POINTS; i++) {
ContactPoint cp = points[pointCount];
cp.fixtureA = fixtureA;
cp.fixtureB = fixtureB;
cp.position.set(worldManifold.points[i]);
cp.normal.set(worldManifold.normal);
cp.state = state2[i];
cp.normalImpulse = manifold.points[i].normalImpulse;
cp.tangentImpulse = manifold.points[i].tangentImpulse;
++pointCount;
}
}
示例6: preSolve
import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
public void preSolve(Contact contact, Manifold oldManifold) {
Manifold manifold = contact.getManifold();
if (manifold.pointCount == 0) {
return;
}
Fixture fixtureA = contact.getFixtureA();
Fixture fixtureB = contact.getFixtureB();
Collision.getPointStates(state1, state2, oldManifold, manifold);
contact.getWorldManifold(worldManifold);
for (int i = 0; i < manifold.pointCount && pointCount < MAX_CONTACT_POINTS; i++) {
ContactPoint cp = points[pointCount];
cp.fixtureA = fixtureA;
cp.fixtureB = fixtureB;
cp.position.set(worldManifold.points[i]);
cp.normal.set(worldManifold.normal);
cp.state = state2[i];
cp.normalImpulse = manifold.points[i].normalImpulse;
cp.tangentImpulse = manifold.points[i].tangentImpulse;
cp.separation = worldManifold.separations[i];
++pointCount;
}
}