|
@ -99,8 +99,8 @@ public class OarController : MonoBehaviour |
|
|
transform.rotation = rotation; |
|
|
transform.rotation = rotation; |
|
|
transform.position = m_rightHand.transform.position - direction * m_distanceFromRightHand; |
|
|
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.MovePosition(m_rightHand.transform.position - direction * m_distanceFromRightHand); |
|
|
|
|
|
|
|
|
//m_oarRigidbody.MoveRotation(rotation);
|
|
|
|
|
|
//m_oarRigidbody.MovePosition(m_rightHand.transform.position - direction * m_distanceFromRightHand);
|
|
|
//MoveOarToRotation(rotation);
|
|
|
//MoveOarToRotation(rotation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -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
|
|
|
|
|
|
|
|
|