-
Notifications
You must be signed in to change notification settings - Fork 42
Draft: VRMC_springBone_limit
#496
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
base: master
Are you sure you want to change the base?
Conversation
Added the Japanese spec and the schema, English spec is just a placeholder
phi ranges from -PI to PI, theta ranges from -PI/2 to PI/2
658ceed
to
2eacd64
Compare
it's gonna be radians instead of degrees
The implementation of the cone limit and its helper TODOs: - implement hinge limit - implement polar limit - implement loader plugin support for the limits See: vrm-c/vrm-specification#496
The implementation of the hinge limit and its helper I believe the current `calculateLimit` implementation has the improvement window TODOs: - implement polar limit - implement loader plugin support for the limits See: vrm-c/vrm-specification#496
The implementation of the spherical limit and its helper TODOs: - implement loader plugin support for the limits See: vrm-c/vrm-specification#496
set `useLimits` to `false` if you want to check the fallback behavior See: vrm-c/vrm-specification#496
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.
LGTM
|
||
以下に、本拡張で定義する各リミットの参考実装を示します。 | ||
|
||
以下の参考実装において `tailDir` は、制限するjointの向きです。 `tailDir` は正規化されているものとします。 |
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.
tailDir が突然出てくる感じがします。
node.rotation もしくは node.localRotation から話が始まるべきと思います。
もしくは既存の springBone 計算の中間値を使っているなら
それが出てくる過程も書いておく方がよいと思います。
要するに、コピペしてから使うところまでが遠いです。
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.
確かに。それでいうと後者で、SpringBoneの計算過程で利用している (nextTail - worldPosition).normalized
が tailDir
になると思います。
VRMC_springBone
仕様側の擬似コードにも (nextTail - worldPosition).normalized
には登場するので、これを言及する形に書き換えますね。
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.
以下のコミットで書き換えてみましたが、いかがでしょうか?
9e98e83
|
||
```ts | ||
// Y+方向からjointのheadからtailに向かうベクトルへの最小回転 | ||
let axisRotation = fromToQuaternion(vec3(0, 1, 0), boneAxis); |
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.
boneAxis の意味を類推する必要があって、
難解になっているような。
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.
フィードバックありがとうございます。 boneAxis
については、 VRMC_springBone
側の擬似コードでも定義されている「そのJointが対象とする子Nodeの、ローカル空間におけるレスト状態の伸びる方向」ですが、改めてこちらの文書でも説明することとします。
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.
04b0db9 で対応しました。
|
||
### ConeLimit | ||
|
||
以下は、擬似コードによるコーンリミットの参考実装です。 |
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.
👍
tailDir の導出が済んでいれば、異なるシステムでもコピペと微修正で使えそうです。
tailDir の導出は作業中(後でやる)です。
tailDir = tailDir.normalized; | ||
|
||
// tailDirのy要素をjointに設定されたangleの余弦と比較する | ||
let cosAngle = cos(joint.angle); |
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.
joint => limitParam など limit の設定値であることが見た目に分かる名前の方がわかりやすいと思われます。後続も同様です。
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.
確かに、これは limit.angle
のほうがより適切ですね。修正します。
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.
1a14366 で対応しました。
…ty and provide pseudo-code example Suggested by @ousttrue: vrm-c#496 (comment)
…pseudocode Suggested by @ousttrue: vrm-c#496 (comment)
… instead of `joint` for limit params Suggested by @ousttrue: vrm-c#496 (comment)
対応ありがとうございます。 |
SpringBone 処理の全体の流れの中での、位置が欲しいです。 VRMC_springBone_limit は、VRMC_springBone の一連の処理
のうち |
…he reference implementations section
This is the first draft of
VRMC_springBone_limit
.Added the Japanese spec and the schema, English spec is just a placeholder.