2018-04-13 05:29:05 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
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
|
|
|
|
"""
|
2018-04-14 20:00:40 +02:00
|
|
|
bl_idname = 'LNApplyImpulseAtLocationNode'
|
2018-04-13 05:29:05 +02:00
|
|
|
bl_label = 'Apply Impulse At Location'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2018-04-13 05:29:05 +02:00
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
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
|
|
|
|
2020-09-09 20:48:35 +02:00
|
|
|
add_node(ApplyImpulseAtLocationNode, category=PKG_AS_CATEGORY, section='force')
|