@ -332,12 +332,12 @@ class PlasmaFacingTargetSocket(PlasmaNodeSocketBase, bpy.types.NodeSocket):
node = self . node
node = self . node
directional = False
directional = False
moving_forward = False
moving_forward = False
tolerance = math . radians ( 45.0 )
tolerance = math . cos ( math . radians ( 45.0 ) )
elif self . is_linked :
elif self . is_linked :
node = self . links [ 0 ] . from_node
node = self . links [ 0 ] . from_node
directional = node . directional
directional = node . directional
moving_forward = node . moving_forward
moving_forward = node . moving_forward
tolerance = node . tolerance
tolerance = math . cos ( node . tolerance )
else :
else :
# This is a programmer failure, so we need a traceback.
# This is a programmer failure, so we need a traceback.
raise RuntimeError ( " Tried to export an unused PlasmaFacingTargetSocket " )
raise RuntimeError ( " Tried to export an unused PlasmaFacingTargetSocket " )
@ -347,10 +347,10 @@ class PlasmaFacingTargetSocket(PlasmaNodeSocketBase, bpy.types.NodeSocket):
facing = facing_key . object
facing = facing_key . object
facing . directional = directional
facing . directional = directional
facing . satisfied = True
facing . satisfied = True
facing . tolerance = math . radians ( tolerance )
facing . tolerance = tolerance
logicmod . addCondition ( facing_key )
logicmod . addCondition ( facing_key )
elif isinstance ( logicmod , plObjectInVolumeAndFacingDetector ) :
elif isinstance ( logicmod , plObjectInVolumeAndFacingDetector ) :
logicmod . facingTolerance = math . cos ( math . radians ( tolerance ) )
logicmod . facingTolerance = tolerance
logicmod . needWalkingForward = moving_forward
logicmod . needWalkingForward = moving_forward
else :
else :
raise ValueError ( " logicmod " )
raise ValueError ( " logicmod " )