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

30 lines
935 B
Python
Raw Normal View History

2020-10-05 19:55:56 +02:00
from arm.logicnode.arm_nodes import *
class PickObjectNode(ArmLogicTreeNode):
"""Picks the rigid body in the given location using the screen
coordinates (2D).
2021-07-20 20:53:22 +02:00
@seeNode Mask
2021-07-20 20:53:22 +02:00
@input Screen Coords: the location at which to pick, in screen
coordinates
@input Mask: a bit mask value to specify which
objects are considered
2021-07-20 20:53:22 +02:00
@output RB: the object that was hit
@output Hit: the hit position in world coordinates
2021-10-31 23:06:11 +01:00
@output Normal: the hit normal in world coordinates
"""
2020-10-05 19:55:56 +02:00
bl_idname = 'LNPickObjectNode'
bl_label = 'Pick RB'
2020-10-27 19:44:37 +01:00
arm_section = 'ray'
2021-10-31 23:06:11 +01:00
arm_version = 2
2020-10-05 19:55:56 +02:00
2021-07-20 20:53:22 +02:00
def arm_init(self, context):
self.add_input('ArmVectorSocket', 'Screen Coords')
self.add_input('ArmIntSocket', 'Mask', default_value=1)
2020-11-17 16:01:15 +01:00
2020-10-05 19:55:56 +02:00
self.add_output('ArmNodeSocketObject', 'RB')
self.add_output('ArmVectorSocket', 'Hit')
2021-10-31 23:06:11 +01:00
self.add_output('ArmVectorSocket', 'Normal')