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
|
|
||
| 以下に、本拡張で定義する各リミットの参考実装を示します。 | ||
|
|
||
| 以下の参考実装において `tailDir` は、制限するjointの向きです。 `tailDir` は正規化されているものとします。 |
There was a problem hiding this comment.
tailDir が突然出てくる感じがします。
node.rotation もしくは node.localRotation から話が始まるべきと思います。
もしくは既存の springBone 計算の中間値を使っているなら
それが出てくる過程も書いておく方がよいと思います。
要するに、コピペしてから使うところまでが遠いです。
There was a problem hiding this comment.
確かに。それでいうと後者で、SpringBoneの計算過程で利用している (nextTail - worldPosition).normalized が tailDir になると思います。
VRMC_springBone 仕様側の擬似コードにも (nextTail - worldPosition).normalized には登場するので、これを言及する形に書き換えますね。
|
|
||
| ```ts | ||
| // Y+方向からjointのheadからtailに向かうベクトルへの最小回転 | ||
| let axisRotation = fromToQuaternion(vec3(0, 1, 0), boneAxis); |
There was a problem hiding this comment.
boneAxis の意味を類推する必要があって、
難解になっているような。
There was a problem hiding this comment.
フィードバックありがとうございます。 boneAxis については、 VRMC_springBone 側の擬似コードでも定義されている「そのJointが対象とする子Nodeの、ローカル空間におけるレスト状態の伸びる方向」ですが、改めてこちらの文書でも説明することとします。
|
|
||
| ### ConeLimit | ||
|
|
||
| 以下は、擬似コードによるコーンリミットの参考実装です。 |
There was a problem hiding this comment.
👍
tailDir の導出が済んでいれば、異なるシステムでもコピペと微修正で使えそうです。
tailDir の導出は作業中(後でやる)です。
| tailDir = tailDir.normalized; | ||
|
|
||
| // tailDirのy要素をjointに設定されたangleの余弦と比較する | ||
| let cosAngle = cos(joint.angle); |
There was a problem hiding this comment.
joint => limitParam など limit の設定値であることが見た目に分かる名前の方がわかりやすいと思われます。後続も同様です。
There was a problem hiding this comment.
確かに、これは limit.angle のほうがより適切ですね。修正します。
…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
|
実装してみたところ、各ロジックについて Json に記述された角度を 0.5 して適用すると Gizmo とぴったりになるようです。 |
|
仕様誤解判明。 |
…s of spherical limit While cone limit and hinge limit explicitly define that the parameter angles are the maximum angles allowed from the reference direction, spherical limit were vague about it
…al limit angles to pitch-yaw instead of phi-theta phi-theta can be confusing since there are multiple conventions; we instead simply follow the well-used notation
… 180deg around x axis when the boneAxis is exactly (0, -1, 0) since the minimal rotation is indeterminate also update the pseudocode to more primitive way and that reflects the spec update
the cross production was incorrect (0, 1, 0) × (x, y, z) = (z, 0, -x)
This is the first draft of
VRMC_springBone_limit.Added the Japanese spec and the schema, English spec is just a placeholder.