本文整理汇总了Java中org.jbox2d.callbacks.ContactImpulse类的典型用法代码示例。如果您正苦于以下问题:Java ContactImpulse类的具体用法?Java ContactImpulse怎么用?Java ContactImpulse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContactImpulse类属于org.jbox2d.callbacks包,在下文中一共展示了ContactImpulse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的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.callbacks.ContactImpulse; //导入依赖的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: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的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;
}
}
示例4: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse impulse)
{
Object userdataA = contact.m_fixtureA.m_body.m_userData;
Object userdataB = contact.m_fixtureB.m_body.m_userData;
if ((userdataA instanceof PhysicsParticle) && (userdataB instanceof PhysicsParticle));
// particle - particle collision, do nothing
else if ((userdataA instanceof PhysicsParticle) && (userdataB instanceof PhysicsComponent))
{
if (((PhysicsParticle) userdataA).destroyOnCollision)
((PhysicsParticle) userdataA).destroy();
}
else if ((userdataA instanceof PhysicsComponent) && (userdataB instanceof PhysicsParticle))
{
if (((PhysicsParticle) userdataB).destroyOnCollision)
((PhysicsParticle) userdataB).destroy();
}
else if ((userdataA instanceof PhysicsComponent) && (userdataB instanceof PhysicsComponent))
{
contactListeners.foreach((PhysicsContactListener listener) -> listener.tryPostSolve(contact));
}
}
示例5: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse arg1) {
Box2dPhysicsBody bodyA = (Box2dPhysicsBody) contact.m_fixtureA.getBody().getUserData();
Box2dPhysicsBody bodyB = (Box2dPhysicsBody) contact.m_fixtureB.getBody().getUserData();
if( arg1.normalImpulses[0]>=1.0 )
bodyA.onPressed(arg1.normalImpulses[0]);
if( arg1.normalImpulses.length>1 && arg1.normalImpulses[1]>=1.0 )
bodyB.onPressed(arg1.normalImpulses[1]);
}
示例6: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
}
示例7: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse impulse)
{}
示例8: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
/**
* Internal use only
*/
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
}
示例9: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact arg0, ContactImpulse arg1) {}
示例10: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact arg0, ContactImpulse arg1) {
// TODO Auto-generated method stub
}
示例11: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact arg0, ContactImpulse arg1) {
// TODO Auto-generated method stub
}
示例12: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
public void postSolve(Contact contact, ContactImpulse impulse) {
}
示例13: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
// TODO Auto-generated method stub
}
示例14: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
@Override
public void postSolve(Contact contact, ContactImpulse arg1) {
}
示例15: postSolve
import org.jbox2d.callbacks.ContactImpulse; //导入依赖的package包/类
/**
* @see org.jbox2d.callbacks.ContactListener#postSolve(org.jbox2d.dynamics.contacts.Contact, org.jbox2d.callbacks.ContactImpulse)
*/
public void postSolve(Contact contact, ContactImpulse impulse) { }