Update Files
This commit is contained in:
29
leenkx/Sources/leenkx/logicnode/GetPointVelocityNode.hx
Normal file
29
leenkx/Sources/leenkx/logicnode/GetPointVelocityNode.hx
Normal file
@ -0,0 +1,29 @@
|
||||
package leenkx.logicnode;
|
||||
|
||||
import iron.math.Vec4;
|
||||
import iron.object.Object;
|
||||
import leenkx.trait.physics.RigidBody;
|
||||
|
||||
class GetPointVelocityNode extends LogicNode {
|
||||
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
var point: Vec4 = inputs[1].get();
|
||||
|
||||
if (object == null || point == null)
|
||||
return null;
|
||||
|
||||
#if lnx_physics
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
|
||||
return rb.getPointVelocity(point.x, point.y, point.z);
|
||||
#end
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user