22 lines
		
	
	
		
			1001 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			1001 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from lnx.logicnode.lnx_nodes import *
 | |
| 
 | |
| class RaycastClosestObjectNode(LnxLogicTreeNode):
 | |
|     """it takes an objects array and returns true of false if at least one of those objects is touched at screen (x, y), the object that is touched and the (x,y, z) position of that touch if returned"""
 | |
|     bl_idname = 'LNRaycastClosestObjectNode'
 | |
|     bl_label = 'Raycast Closest Object'
 | |
|     lnx_section = 'props'
 | |
|     lnx_version = 1
 | |
| 
 | |
|     def lnx_init(self, context):
 | |
|         self.add_input('LnxNodeSocketAction', 'In')
 | |
|         self.add_input('LnxNodeSocketArray', 'Obj Array')
 | |
|         self.add_input('LnxFloatSocket', 'X')
 | |
|         self.add_input('LnxFloatSocket', 'Y')
 | |
|         self.add_input('LnxNodeSocketObject', 'Camera')
 | |
|         
 | |
|         self.add_output('LnxNodeSocketAction', 'Out')
 | |
|         self.add_output('LnxNodeSocketAction', 'True')
 | |
|         self.add_output('LnxNodeSocketAction', 'False')
 | |
|         self.add_output('LnxNodeSocketObject', 'Object')
 | |
|         self.add_output('LnxVectorSocket', 'Location')
 |