LNXSDK/leenkx/blender/lnx/logicnode/physics/LN_convex_cast_on.py

39 lines
1.5 KiB
Python
Raw Normal View History

2025-01-22 16:18:30 +01:00
from lnx.logicnode.lnx_nodes import *
class ConvexCastOnNode(LnxLogicTreeNode):
"""Casts a convex rigid body and get the closest hit point. Also called Convex Sweep Test.
@seeNode Mask
@input In: Input trigger
@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 Out: Output after hit
@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 = 'LNPhysicsConvexCastOnNode'
bl_label = 'Convex Cast On'
lnx_section = 'ray'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
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('LnxNodeSocketAction', 'Out')
self.add_output('LnxVectorSocket', 'Hit Position')
self.add_output('LnxVectorSocket', 'Convex Position')
self.add_output('LnxVectorSocket', 'Normal')