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