2018-04-18 02:26:33 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class ApplyForceAtLocationNode(ArmLogicTreeNode):
|
2020-10-05 19:55:56 +02:00
|
|
|
"""Applies force in the given rigid body at the given position.
|
2020-09-28 15:58:41 +02:00
|
|
|
|
|
|
|
@seeNode Apply Force
|
|
|
|
@seeNode Apply Impulse
|
|
|
|
@seeNode Apply Impulse At Location
|
|
|
|
|
|
|
|
@input Force: the force vector
|
|
|
|
@input Force On Local Axis: if `true`, interpret the force vector as in
|
|
|
|
object space
|
|
|
|
@input Location: the location where to apply the force
|
|
|
|
@input Location On Local Axis: if `true`, use the location relative
|
|
|
|
to the objects location, otherwise use world coordinates
|
|
|
|
"""
|
2018-04-18 02:26:33 +02:00
|
|
|
bl_idname = 'LNApplyForceAtLocationNode'
|
|
|
|
bl_label = 'Apply Force At Location'
|
2020-10-27 19:44:37 +01:00
|
|
|
arm_section = 'force'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2018-04-18 02:26:33 +02:00
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(ApplyForceAtLocationNode, 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', 'Force')
|
|
|
|
self.add_input('NodeSocketBool', 'Force On Local Axis')
|
|
|
|
self.add_input('NodeSocketVector', 'Location')
|
|
|
|
self.add_input('NodeSocketBool', 'Location On Local Axis')
|
2020-11-17 16:01:15 +01:00
|
|
|
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|