|
@ -80,15 +80,15 @@ public class OarController : MonoBehaviour |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
private void FixedUpdate() |
|
|
private void FixedUpdate() |
|
|
{ |
|
|
{ |
|
|
undoDoneThisFrame = false; |
|
|
|
|
|
UpdateTransform(); |
|
|
|
|
|
|
|
|
//undoDoneThisFrame = false;
|
|
|
|
|
|
//UpdateTransform();
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endregion MonoBehaviour Functions
|
|
|
#endregion MonoBehaviour Functions
|
|
|
|
|
|
|
|
|
#region Class Functionality
|
|
|
#region Class Functionality
|
|
|
|
|
|
|
|
|
private void UpdateTransform() |
|
|
|
|
|
|
|
|
public void UpdateTransform() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
Vector3 direction =(m_rightHand.transform.position - m_leftHand.transform.position).normalized; |
|
|
Vector3 direction =(m_rightHand.transform.position - m_leftHand.transform.position).normalized; |
|
@ -96,6 +96,8 @@ public class OarController : MonoBehaviour |
|
|
Quaternion rotation = Quaternion.LookRotation(forward, direction); |
|
|
Quaternion rotation = Quaternion.LookRotation(forward, direction); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
transform.rotation = rotation; |
|
|
|
|
|
transform.position = m_rightHand.transform.position - direction * m_distanceFromRightHand; |
|
|
//MoveOarToPosition(m_rightHand.transform.position - direction * m_distanceFromRightHand);
|
|
|
//MoveOarToPosition(m_rightHand.transform.position - direction * m_distanceFromRightHand);
|
|
|
m_oarRigidbody.MoveRotation(rotation); |
|
|
m_oarRigidbody.MoveRotation(rotation); |
|
|
m_oarRigidbody.MovePosition(m_rightHand.transform.position - direction * m_distanceFromRightHand); |
|
|
m_oarRigidbody.MovePosition(m_rightHand.transform.position - direction * m_distanceFromRightHand); |
|
@ -126,7 +128,7 @@ public class OarController : MonoBehaviour |
|
|
Collider[] col = Physics.OverlapBox(transform.position + m_boxCollider.center, m_boxCollider.size / 2, rotation); |
|
|
Collider[] col = Physics.OverlapBox(transform.position + m_boxCollider.center, m_boxCollider.size / 2, rotation); |
|
|
if (col.Intersect(m_forbiddenColliders).Any()) |
|
|
if (col.Intersect(m_forbiddenColliders).Any()) |
|
|
{ |
|
|
{ |
|
|
Debug.Log($"Colliding with: {string.Join(", ", col.Intersect(m_forbiddenColliders))}"); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
return false; |
|
|
return false; |
|
|