|
@ -96,8 +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; |
|
|
|
|
|
|
|
|
//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); |
|
@ -128,33 +128,19 @@ 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($"Forbidden collision: {string.Join(", ", col.Intersect(m_forbiddenColliders))}"); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
void OnCollisionEnter(Collision collision) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
if (m_forbiddenColliders.Contains(collision.collider) && !undoDoneThisFrame) |
|
|
|
|
|
{ |
|
|
|
|
|
Debug.Log($"Forbidden Collision: {collision.collider.gameObject}"); |
|
|
|
|
|
undoDoneThisFrame= true; |
|
|
|
|
|
m_leftHand.UndoLastMovement(); |
|
|
|
|
|
m_rightHand.UndoLastMovement(); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
Debug.Log($"Ignored Collision: {collision.collider.gameObject}"); |
|
|
|
|
|
|
|
|
Debug.Log($"Ignored collision: {string.Join(", ", col.Except(m_forbiddenColliders))}"); |
|
|
} |
|
|
} |
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
#endregion Class Functionality
|
|
|
#endregion Class Functionality
|
|
|
|
|
|
|
|
|