Update leenkx/Sources/leenkx/logicnode/OnContactNode.hx
This commit is contained in:
@ -24,13 +24,12 @@ class OnContactNode extends LogicNode {
|
||||
var contact = false;
|
||||
|
||||
#if lnx_physics
|
||||
var rb1 = leenkx.trait.physics.PhysicsWorld.getCachedRigidBody(object1);
|
||||
var rb2 = leenkx.trait.physics.PhysicsWorld.getCachedRigidBody(object2);
|
||||
var rb1 = leenkx.trait.physics.PhysicsCache.getCachedRigidBody(object1);
|
||||
var rb2 = leenkx.trait.physics.PhysicsCache.getCachedRigidBody(object2);
|
||||
|
||||
if (rb1 != null && rb2 != null) {
|
||||
var physics = leenkx.trait.physics.PhysicsWorld.active;
|
||||
var rbs = physics.getContacts(rb1);
|
||||
contact = leenkx.trait.physics.PhysicsWorld.hasContactWith(rbs, rb2);
|
||||
var rbs = leenkx.trait.physics.PhysicsCache.getCachedContacts(rb1);
|
||||
contact = leenkx.trait.physics.PhysicsCache.hasContactWith(rbs, rb2);
|
||||
}
|
||||
#end
|
||||
|
||||
|
Reference in New Issue
Block a user