forked from LeenkxTeam/LNXSDK
		
	
		
			
	
	
		
			35 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			35 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
								 | 
							
								from lnx.logicnode.lnx_nodes import *
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class ConvexCastNode(LnxLogicTreeNode):
							 | 
						||
| 
								 | 
							
								    """Casts a convex rigid body and get the closest hit point. Also called Convex Sweep Test.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    @seeNode Mask
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    @input Convex RB: A convex Rigid Body object to be used for the sweep test.
							 | 
						||
| 
								 | 
							
								    @input From: The initial location of the convex object.
							 | 
						||
| 
								 | 
							
								    @input To: The final location of the convex object.
							 | 
						||
| 
								 | 
							
								    @input Rotation: Rotation of the Convex RB during sweep test.
							 | 
						||
| 
								 | 
							
								    @input Mask: A bit mask value to specify which
							 | 
						||
| 
								 | 
							
								        objects are considered
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    @output Hit Position: The hit position in world coordinates
							 | 
						||
| 
								 | 
							
								    @output Convex Position: Position of the convex RB at the time of collision.
							 | 
						||
| 
								 | 
							
								    @output Normal: The surface normal of the hit position relative to
							 | 
						||
| 
								 | 
							
								        the world.
							 | 
						||
| 
								 | 
							
								    """
							 | 
						||
| 
								 | 
							
								    bl_idname = 'LNPhysicsConvexCastNode'
							 | 
						||
| 
								 | 
							
								    bl_label = 'Convex Cast'
							 | 
						||
| 
								 | 
							
								    lnx_section = 'ray'
							 | 
						||
| 
								 | 
							
								    lnx_version = 1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def lnx_init(self, context):
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxNodeSocketObject', 'Convex RB')
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxVectorSocket', 'From')
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxVectorSocket', 'To')
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxRotationSocket', 'Rotation')
							 | 
						||
| 
								 | 
							
								        self.add_input('LnxIntSocket', 'Mask', default_value=1)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        self.add_output('LnxVectorSocket', 'Hit Position')
							 | 
						||
| 
								 | 
							
								        self.add_output('LnxVectorSocket', 'Convex Position')
							 | 
						||
| 
								 | 
							
								        self.add_output('LnxVectorSocket', 'Normal')
							 |