Update leenkx/Sources/leenkx/logicnode/HasContactNode.hx
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
package leenkx.logicnode;
|
||||
|
||||
import iron.object.Object;
|
||||
|
||||
#if lnx_physics
|
||||
import leenkx.trait.physics.PhysicsCache;
|
||||
import leenkx.trait.physics.RigidBody;
|
||||
#end
|
||||
|
||||
class HasContactNode extends LogicNode {
|
||||
|
||||
@ -15,15 +18,15 @@ class HasContactNode extends LogicNode {
|
||||
|
||||
if (object1 == null || object2 == null) return false;
|
||||
|
||||
#if lnx_physics
|
||||
var rb1 = leenkx.trait.physics.PhysicsCache.getCachedRigidBody(object1);
|
||||
var rb2 = leenkx.trait.physics.PhysicsCache.getCachedRigidBody(object2);
|
||||
#if lnx_physics
|
||||
var rb1 = PhysicsCache.getCachedRigidBody(object1);
|
||||
var rb2 = PhysicsCache.getCachedRigidBody(object2);
|
||||
|
||||
if (rb1 != null && rb2 != null) {
|
||||
var rbs = leenkx.trait.physics.PhysicsCache.getCachedContacts(rb1);
|
||||
return leenkx.trait.physics.PhysicsCache.hasContactWith(rbs, rb2);
|
||||
var rbs = PhysicsCache.getCachedContacts(rb1);
|
||||
return PhysicsCache.hasContactWith(rbs, rb2);
|
||||
}
|
||||
#end
|
||||
#end
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user