-
Notifications
You must be signed in to change notification settings - Fork 315
/
LN_apply_force_at_location.py
30 lines (25 loc) · 1.11 KB
/
LN_apply_force_at_location.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from arm.logicnode.arm_nodes import *
class ApplyForceAtLocationNode(ArmLogicTreeNode):
"""Applies force in the given rigid body at the given position.
@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 Relative Location: if `true`, use the location relative
to the objects location, otherwise use world coordinates
"""
bl_idname = 'LNApplyForceAtLocationNode'
bl_label = 'Apply Force At Location'
arm_section = 'force'
arm_version = 1
def arm_init(self, context):
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'RB')
self.add_input('ArmVectorSocket', 'Force')
self.add_input('ArmBoolSocket', 'Force On Local Axis')
self.add_input('ArmVectorSocket', 'Location')
self.add_input('ArmBoolSocket', 'Relative Location')
self.add_output('ArmNodeSocketAction', 'Out')