armory/blender/arm/logicnode/physics/LN_apply_impulse_at_location.py

32 lines
1.3 KiB
Python
Raw Normal View History

2018-04-13 05:29:05 +02:00
from arm.logicnode.arm_nodes import *
class ApplyImpulseAtLocationNode(ArmLogicTreeNode):
2020-10-05 19:55:56 +02:00
"""Applies impulse in the given rigid body at the given position.
2020-09-28 15:58:41 +02:00
@seeNode Apply Impulse
@seeNode Apply Force
@seeNode Apply Force At Location
@input Impulse: the impulse vector
@input Impulse On Local Axis: if `true`, interpret the impulse vector as in
object space
@input Location: the location where to apply the impulse
@input Location On Local Axis: if `true`, use the location relative
to the objects location, otherwise use world coordinates
"""
bl_idname = 'LNApplyImpulseAtLocationNode'
2018-04-13 05:29:05 +02:00
bl_label = 'Apply Impulse At Location'
arm_version = 1
2018-04-13 05:29:05 +02:00
def init(self, context):
super(ApplyImpulseAtLocationNode, self).init(context)
2020-09-08 21:49:02 +02:00
self.add_input('ArmNodeSocketAction', 'In')
2020-10-05 19:55:56 +02:00
self.add_input('ArmNodeSocketObject', 'RB')
2020-09-08 21:49:02 +02:00
self.add_input('NodeSocketVector', 'Impulse')
self.add_input('NodeSocketBool', 'Impulse On Local Axis')
self.add_input('NodeSocketVector', 'Location')
self.add_input('NodeSocketBool', 'Location On Local Axis')
self.add_output('ArmNodeSocketAction', 'Out')
2018-04-13 05:29:05 +02:00
add_node(ApplyImpulseAtLocationNode, category=PKG_AS_CATEGORY, section='force')