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

30 lines
1.1 KiB
Python
Raw Normal View History

2017-04-14 20:38:50 +02:00
from arm.logicnode.arm_nodes import *
class VolumeTriggerNode(ArmLogicTreeNode):
2020-10-05 19:55:56 +02:00
"""Returns `true` if the given rigid body enters, overlaps or leaves the
given volume trigger.
2020-09-28 15:58:41 +02:00
2020-11-17 18:46:14 +01:00
@input RB: this object is taken as the entering object
@input Trigger: this object is used as the volume trigger
"""
2017-04-14 20:38:50 +02:00
bl_idname = 'LNVolumeTriggerNode'
bl_label = 'Volume Trigger'
2020-10-27 19:44:37 +01:00
arm_section = 'misc'
arm_version = 1
2020-10-27 19:44:37 +01:00
2018-12-18 23:48:38 +01:00
property0: EnumProperty(
2020-11-18 17:50:24 +01:00
items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
2020-11-17 21:55:53 +01:00
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin')
2017-04-14 20:38:50 +02:00
def init(self, context):
super(VolumeTriggerNode, self).init(context)
2020-12-04 13:49:50 +01:00
self.add_input('ArmNodeSocketObject', 'Object 1')
self.add_input('ArmNodeSocketObject', 'Object 2')
2020-11-17 16:01:15 +01:00
2020-09-08 21:49:02 +02:00
self.add_output('NodeSocketBool', 'Bool')
2017-04-14 20:38:50 +02:00
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')