Skip to content
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

Merged
merged 1 commit into from
May 30, 2024

Conversation

LanternaBlender
Copy link
Contributor

#2291
について提案させていただきます。ご検討いただければと思います。

@@ -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)
Copy link
Contributor

@ousttrue ousttrue May 30, 2024

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;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

抜ける

Copy link
Contributor

@ousttrue ousttrue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそう👍

@ousttrue ousttrue merged commit ffaf60e into vrm-c:master May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants