30 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			30 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
								 | 
							
								from lnx.logicnode.lnx_nodes import *
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class VolumeTriggerNode(LnxLogicTreeNode):
							 | 
						||
| 
								 | 
							
								    """Returns `true` if the given rigid body enters, overlaps or leaves the
							 | 
						||
| 
								 | 
							
								    given volume trigger.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    @input RB: this object is taken as the entering object
							 | 
						||
| 
								 | 
							
								    @input Trigger: this object is used as the volume trigger
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    bl_idname = 'LNVolumeTriggerNode'
							 | 
						||
| 
								 | 
							
								    bl_label = 'Volume Trigger'
							 | 
						||
| 
								 | 
							
								    lnx_section = 'misc'
							 | 
						||
| 
								 | 
							
								    lnx_version = 1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    property0: HaxeEnumProperty(
							 | 
						||
| 
								 | 
							
								        'property0',
							 | 
						||
| 
								 | 
							
								        items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
							 | 
						||
| 
								 | 
							
								                 ('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
							 | 
						||
| 
								 | 
							
								                 ('end', 'End', 'The contact between the rigid bodies ends')],
							 | 
						||
| 
								 | 
							
								        name='', default='begin')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def lnx_init(self, context):
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxNodeSocketObject', 'Object 1')
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxNodeSocketObject', 'Object 2')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        self.add_output('LnxBoolSocket', 'Bool')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def draw_buttons(self, context, layout):
							 | 
						||
| 
								 | 
							
								        layout.prop(self, 'property0')
							 |