-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capsuleの当たり判定を修正 #2291 #2292
Capsuleの当たり判定を修正 #2291 #2292
Conversation
@@ -156,24 +156,31 @@ private static Quaternion Normalize(Quaternion q) | |||
BlittableLogic logic, | |||
ref Vector3 nextTail) | |||
{ | |||
var P = (worldTail - worldPosition).normalized; | |||
var direction = worldTail - worldPosition; | |||
if (direction.sqrMagnitude == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
head と tail が同じ場所にある場合。単なる球として処理する
var Q = headTransform.position - worldPosition; | ||
var dot = Vector3.Dot(P, Q); | ||
if (dot <= 0) | ||
{ | ||
// head側半球の球判定 | ||
ResolveSphereCollision(joint, collider, worldPosition, headTransform, maxColliderScale, logic, ref nextTail); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
抜ける
{ | ||
// tail側半球の球判定 | ||
ResolveSphereCollision(joint, collider, worldTail, headTransform, maxColliderScale, logic, ref nextTail); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
抜ける
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よさそう👍
#2291
について提案させていただきます。ご検討いただければと思います。