added: grapple pull replacement for crappy new grapple
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user