change: DebugOverlayDrawer.cs no longer needs a string and will accept an object

This commit is contained in:
Chris
2025-09-04 12:35:32 -04:00
parent 81bc5da2c0
commit 3499e33953
2 changed files with 7 additions and 7 deletions

View File

@@ -97,7 +97,7 @@ namespace NodeCanvas.Tasks.Actions {
Vector3 input = new(rawInput.x, rawInput.y, 0f);
smoothedInput = Vector3.SmoothDamp(smoothedInput, input, ref smoothedInputRefVelocity, 1f);
DebugOverlayDrawer.ChangeValue("Grapple", "Smoothed Input", smoothedInput.ToString());
DebugOverlayDrawer.ChangeValue("Grapple", "Smoothed Input", smoothedInput);
// The swing angle needs to change for the downwards swing, based on distance to the ground
Physics.Raycast(agent.transform.position, Vector3.down, out RaycastHit hit);
@@ -110,7 +110,7 @@ namespace NodeCanvas.Tasks.Actions {
float outwardsAngle = Mathf.Lerp(0f, -60f, currentDist / 15f);
float outputAngle = inwardsAngle + outwardsAngle;
DebugOverlayDrawer.ChangeValue("Grapple", "Output Angle", outputAngle.ToString() + $"({inwardsAngle.ToString()} + {outwardsAngle.ToString()})");
DebugOverlayDrawer.ChangeValue("Grapple", "Output Angle", outputAngle + $"({inwardsAngle} + {outwardsAngle})");
// Calculate the swing direction.
// Vector3 swingDirection = Quaternion.LookRotation(smoothedInput) * directionToPoint * smoothedInput.magnitude; // Old
@@ -190,8 +190,8 @@ namespace NodeCanvas.Tasks.Actions {
Quaternion.LookRotation(directionToPoint) * -directionToPoint.Flatten(null, null, 0).normalized
);
DebugOverlayDrawer.ChangeValue("Grapple", "Horizontal Dot", xzDot.ToString());
DebugOverlayDrawer.ChangeValue("Grapple", "Vertical Dot", yDot.ToString());
DebugOverlayDrawer.ChangeValue("Grapple", "Horizontal Dot", xzDot);
DebugOverlayDrawer.ChangeValue("Grapple", "Vertical Dot", yDot);
// Check if done
if (xzDot < horizontalDotBreak || yDot < verticalDotBreak) {
@@ -219,7 +219,7 @@ namespace NodeCanvas.Tasks.Actions {
float outwardsAngle = Mathf.Lerp(0f, -60f, currentDist / 15f);
float outputAngle = inwardsAngle + outwardsAngle;
DebugOverlayDrawer.ChangeValue("Grapple", "Output Angle", outputAngle.ToString() + $"({inwardsAngle.ToString()} + {outwardsAngle.ToString()})");
DebugOverlayDrawer.ChangeValue("Grapple", "Output Angle", outputAngle + $"({inwardsAngle} + {outwardsAngle})");
Vector3 pointDirectionXZStable = agent.transform.position.DirectionTo(grapplePoint.value.Flatten(null, agent.transform.position.y));
Vector3 rightSwingDirectin = Quaternion.AngleAxis(100f + outputAngle, Vector3.up) * pointDirectionXZStable; // Working
@@ -253,7 +253,7 @@ namespace NodeCanvas.Tasks.Actions {
Vector3 xAxisTargetDirection = Vector3.Lerp(rightSwingDirectin, leftSwingDirectin, Mathf.Abs((input.x - 1f) / 2f));
targetSwingDirection = Vector3.Slerp(targetSwingDirection, xAxisTargetDirection, Mathf.Abs((input.x)));
// targetSwingDirection = xAxisTargetDirection;
DebugOverlayDrawer.ChangeValue("Grapple", "LR Input Dot", Mathf.Abs((input.x - 1f) / 2f).ToString());
DebugOverlayDrawer.ChangeValue("Grapple", "LR Input Dot", Mathf.Abs((input.x - 1f) / 2f));
}
return targetSwingDirection.normalized;