forked from vrm-c/vrm.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from vrm-c/merge/20240620
Merge/20240620
- Loading branch information
Showing
10 changed files
with
266 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# コライダー拡張 | ||
|
||
:::tip experimental | ||
使ってみて問題があった場合は修正が入ります。 | ||
::: | ||
|
||
- [VRMC_springBone_extended_collider-1.0 日本語](https://github.com/vrm-c/vrm-specification/blob/master/specification/VRMC_springBone_extended_collider-1.0/README.ja.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
# vrm-1.0 の SpringBone 実装 | ||
|
||
## 構成 | ||
|
||
### Model | ||
|
||
:::info | ||
`vrm10Instance.SpringBone`にモデル側の情報が格納されています | ||
::: | ||
|
||
### System(シングルトン) | ||
|
||
:::info | ||
`FastSpringBoneService.Instance` はシングルトンですべての VRM-1.0 モデルのスプリングをまとめて処理します | ||
::: | ||
|
||
## 実行 | ||
|
||
### Update | ||
|
||
:::info | ||
`FastSpringBoneService.LateUpdate` | ||
|
||
```csharp | ||
[DefaultExecutionOrder(11010)] | ||
``` | ||
|
||
::: | ||
|
||
:::tip | ||
|
||
Vrm10Instance より後ろです。 | ||
|
||
```csharp | ||
[DefaultExecutionOrder(11000)] | ||
public class Vrm10Instance : MonoBehaviour | ||
``` | ||
|
||
::: | ||
|
||
### `v0.106.0` 手動更新 | ||
|
||
:::info 手動更新 | ||
|
||
開始前に処理を回して SpringBone を安定させるなど、毎フレームの更新ではない想定です。 | ||
::: | ||
|
||
- FastSpringBoneService.UpdateTypes.Manual を追加 | ||
- FastSpringBoneService.ManualUpdate を追加 | ||
|
||
```csharp | ||
// 管理している VRM-1.0 がすべて入っている | ||
List<VRM10Instance> instances; | ||
|
||
// setup | ||
foreach(var instance in instances) | ||
{ | ||
// SpringBone を手動にするために、 | ||
// VRM-1.0 本体も手動に変更している。 | ||
// VRM本体 => SpringBone という処理順を守る。 | ||
instance.UpdateType = UpdateTypes.None; | ||
} | ||
FastSpringBoneService.Instance.UpdateType = FastSpringBoneService.UpdateTypes.Manual; | ||
|
||
// each frame | ||
foreach(var instance in instances) | ||
{ | ||
// SpringBone よりも先に VRM10Instance を更新 | ||
instance.Runtime.Process(); | ||
} | ||
// 最後に FastSpringBoneService を更新 | ||
// すべての VRM-1.0 の SpringBone がまとめて処理されます。 | ||
FastSpringBoneService.Instance.ManualUpdate(time.deltaTime); | ||
``` | ||
|
||
## 機能 | ||
|
||
### `v0.106.0` 毎フレーム外力を加える | ||
|
||
- [\# 1863](https://github.com/vrm-c/UniVRM/pull/1868) | ||
|
||
:::info 外力 | ||
|
||
ジャンプや風など、一時的な力の表現を想定した機能です。 | ||
::: | ||
|
||
```csharp | ||
VRM10Instance instance; | ||
|
||
// each frame | ||
// 既存の Gravity に加算されます | ||
instance.Runtime.ExternalForce = new Vector3(0.1f, 0, 0); | ||
``` | ||
|
||
- [アプリケーションから動的に Spring に対する外力を作用させるインタフェース by ousttrue · Pull Request #1861 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/1861) | ||
|
||
## MonoBehaviour詳細 | ||
|
||
`Vrm10InstanceSpringBone Vrm10Instance.SpringBone` | ||
|
||
### Spring | ||
|
||
```csharp | ||
[SerializeField] | ||
public List<Spring> Springs = new List<Spring>(); | ||
``` | ||
|
||
### ColliderGroup | ||
|
||
``` | ||
public List<VRM10SpringBoneColliderGroup> ColliderGroups = new List<VRM10SpringBoneColliderGroup>(); | ||
``` | ||
|
||
#### Collider | ||
|
||
```csharp | ||
public List<VRM10SpringBoneCollider> Colliders = new List<VRM10SpringBoneCollider>(); | ||
``` | ||
|
||
## Job詳細 | ||
|
||
### FastSpringBoneScheduler.Schedule(entry point) | ||
|
||
```csharp | ||
JobHandle Schedule(float deltaTime) | ||
``` | ||
|
||
```csharp | ||
private void LateUpdate() | ||
{ | ||
if (UpdateType == UpdateTypes.LateUpdate) | ||
{ | ||
_fastSpringBoneScheduler.Schedule(Time.deltaTime).Complete(); | ||
} | ||
} | ||
``` | ||
|
||
### job の構成 | ||
|
||
```csharp | ||
public JobHandle Schedule(float deltaTime) | ||
{ | ||
var handle = default(JobHandle); | ||
handle = _bufferCombiner.ReconstructIfDirty(handle); | ||
if (!_bufferCombiner.HasBuffer) | ||
{ | ||
return handle; | ||
} | ||
|
||
handle = new PullTransformJob | ||
{ | ||
Transforms = _bufferCombiner.Transforms | ||
}.Schedule(_bufferCombiner.TransformAccessArray, handle); | ||
|
||
handle = new UpdateFastSpringBoneJob | ||
{ | ||
Colliders = _bufferCombiner.Colliders, | ||
Joints = _bufferCombiner.Joints, | ||
Logics = _bufferCombiner.Logics, | ||
Springs = _bufferCombiner.Springs, | ||
Transforms = _bufferCombiner.Transforms, | ||
DeltaTime = deltaTime, | ||
}.Schedule(_bufferCombiner.Springs.Length, 1, handle); | ||
|
||
handle = new PushTransformJob | ||
{ | ||
Transforms = _bufferCombiner.Transforms | ||
}.Schedule(_bufferCombiner.TransformAccessArray, handle); | ||
|
||
return handle; | ||
} | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# v0.123.0 VRMC_springBone_extended_collider | ||
|
||
https://github.com/vrm-c/UniVRM/releases/tag/v0.123.0 | ||
|
||
https://github.com/vrm-c/UniVRM/milestone/86 | ||
|
||
## vrm-1.0: SpringBone | ||
|
||
- [VRM10 Spring Bone Collider の Capsule の当たり判定が表示されている範囲よりも長くなっている · Issue #2291 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/2291) | ||
- [Capsuleの当たり判定を修正 #2291 by LanternaBlender · Pull Request #2292 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/2292) | ||
|
||
### Inspector改善 | ||
|
||
- [Improved display of VRM10SpringBoneCollider on inspector by LanternaBlender · Pull Request #2306 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/2306) | ||
- [Fix collider group name export by LanternaBlender · Pull Request #2308 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/2308) | ||
- [Improved selection of VRM10SpringBoneCollider on inspector by LanternaBlender · Pull Request #2312 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/2312) | ||
|
||
### experimental: VRMC_springBone_extended_collider | ||
|
||
- [VRMC_springBone_extended_collider](/api/spring/VRMC_springBone_extended_collider/) | ||
- [VRMC_springBone_extended_collider by ousttrue · Pull Request #2310 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/2310) | ||
- monobehaviour | ||
- plane gizmo | ||
- import | ||
- export | ||
|
||
## export 時に material が null でもエラーにしない | ||
|
||
Renderer もしくは SkinnedMeshRenderer コンポーネントの materials に null が | ||
含まれているときにエラーとみなしてエクスポートを不許可にしていました。 | ||
エラーレベルを警告にして、エクスポートできるようにしました。 | ||
|
||
- [\[exporter\] Allow null material to be exported · Issue #2313 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/2313) | ||
|
||
:::info | ||
material が未指定と判定されたときは、 glTF 準拠に合わせて白い standard になります。 | ||
::: | ||
|
||
:::warning | ||
該当するマテリアルはエクスポート前は `magenta` で表示されます。 | ||
エクスポート後に再インポートすると、 ` | ||
gltf` のデフォルトマテリアル扱いで白い standard に変わります。 | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 🚧 v0.124.0 | ||
|
||
https://github.com/vrm-c/UniVRM/milestone/87 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters