added: grapple pull replacement for crappy new grapple

This commit is contained in:
Chris
2025-08-07 21:12:18 -04:00
parent 66ab541897
commit 5b61d042b1
8 changed files with 34458 additions and 52 deletions

View File

@@ -145,11 +145,23 @@ public class EnvironmentObserver{
// Setup the variables for boxcast, spherecast, etc
// Create an offset start point for the center of the wirebox, since gizmos are drawn with their pivot in the center.
Vector3 offsetWithRotationAndLength = (Quaternion.LookRotation(direction) * Quaternion.Euler(rotation)) * (Vector3.forward * (length / 2));
Vector3 offsetWithRotationAndLength;
if (direction == Vector3.zero) {
offsetWithRotationAndLength = Quaternion.Euler(rotation) * (Vector3.forward * (length / 2));
} else {
offsetWithRotationAndLength = Quaternion.LookRotation(direction) * Quaternion.Euler(rotation) * (Vector3.forward * (length / 2));
}
Vector3 offsetFromCenter = relativeStartWithRotation + source.transform.rotation * offsetWithRotationAndLength;
// Also create a rotation for use with the gizmos. Mainly just to shorten the lines
Quaternion gizmosRotation = source.transform.rotation * Quaternion.LookRotation(direction) * Quaternion.Euler(rotation);
Quaternion gizmosRotation;
if (direction == Vector3.zero) {
gizmosRotation = source.transform.rotation * Quaternion.Euler(rotation);
} else {
gizmosRotation = source.transform.rotation * Quaternion.LookRotation(direction) * Quaternion.Euler(rotation);
}
Vector3 firstBoxOffset = gizmosRotation * (Vector3.forward * size.z);
Color gizmoColor = Evaluate(source) ? Color.green : Color.red;