Draft: VRMC_springBone_limit - #496
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)
|
実装してみたところ、各ロジックについて 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)
Clamp cone and hinge angles to [0, pi], spherical pitch to [0, pi], and spherical yaw to [0, pi/2] before applying the limits. This keeps the reference implementation consistent with the documented lower and upper bounds.
…k directions for singular cases Limit projections can be indeterminate when the tail points along axes that lose the directional component required by a limit. Define deterministic local-space fallback directions for cone, hinge, and spherical limits, and update the reference pseudocode to avoid zero divisions and undefined angles. Keep the pseudocode mathematically exact while recommending that implementations apply precision-appropriate floating-point safeguards.
…perties must be normalized
Limit evaluation may be reduced or disabled depending on the target platform, runtime settings, or LOD requirements. Clarify that the recommended application timings apply when limit evaluation is enabled, and note that the final tail direction is not guaranteed to remain within the limit when evaluation is reduced or disabled.
…on terminal joints The terminal joint in a spring chain acts only as the tail, so a limit attached to it cannot affect the simulation. Require implementations to ignore the extension on terminal joints and exporters to omit it from those joints.
The specVersion and exactly-one limit requirements were already expressed in the property descriptions and JSON Schema, but their normative strength was not explicit in the text. Mark both requirements as MUST to make conformance expectations unambiguous without changing the schema.
…e constraints Normative requirements were not consistently emphasized, and the angle constraints did not state their RFC 2119 strength explicitly. Bold all RFC 2119 keywords and mark the non-negative angle requirements and upper-bound interpretation rules as MUST for cone, hinge, and spherical limits.
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
Translation produced by GPT-5.6 Sol as-is. The wording and technical terminology may be reviewed and adjusted in follow-up commits
Improve the English and Japanese documentation without changing any normative requirements or behavior. - Restructure the descriptions to separate each limit's local shape from the common rotation procedure - Clarify the explanation of the default orientation and `rotation` application order - Clarify the descriptions of `nextTail`, `tailDir`, and the cone pseudocode - Remove the duplicated inline root schema - Fix schema links to match the actual filenames
|
英訳の追加 #514 ならびに文意の改善を行いました。Normative changesは含まれません。 |
This is the first draft of
VRMC_springBone_limit.Added the Japanese spec and the schema, English spec is just a placeholder.