armory/blender/arm/logicnode/physics/LN_apply_impulse.py
2020-09-28 15:58:41 +02:00

26 lines
901 B
Python

from arm.logicnode.arm_nodes import *
class ApplyImpulseNode(ArmLogicTreeNode):
"""Applies a specified impulse to a given rigid body.
@seeNode Apply Impulse At Location
@seeNode Apply Force
@seeNode Apply Force At Location
@input Impulse: the impulse vector
@input On Local Axis: if `true`, interpret the impulse vector as in
object space
"""
bl_idname = 'LNApplyImpulseNode'
bl_label = 'Apply Impulse'
arm_version = 1
def init(self, context):
super(ApplyImpulseNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Rigid Body')
self.add_input('NodeSocketVector', 'Impulse')
self.add_input('NodeSocketBool', 'On Local Axis')
self.add_output('ArmNodeSocketAction', 'Out')
add_node(ApplyImpulseNode, category=PKG_AS_CATEGORY, section='force')