Skip to content

Commit

Permalink
Merge pull request #39 from vrm-c/merge/20240620
Browse files Browse the repository at this point in the history
Merge/20240620
  • Loading branch information
ousttrue authored Jun 20, 2024
2 parents c6156f0 + 69894dc commit dc1f183
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 66 deletions.
7 changes: 7 additions & 0 deletions docs/api/spring/VRMC_springBone_extended_collider.md
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)
7 changes: 3 additions & 4 deletions docs/api/spring/spring_and_scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:::warning There are parameters that are fixed during initialization
:::

- [SpringBone does not work correctly if you change the model size, for example scale (8,8,8). · Issue #2242 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/2242)
- [VRM 0 系で FastSpringBone を使用した際に VRM の最親のゲームオブジェクトに FastSpringBone が追従しない · Issue #2047 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/2047)
- [アプリケーションから動的に Spring に対する外力を作用させるインタフェース by ousttrue · Pull Request #1861 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/pull/1861)
- [Scale が VRM Spring Bone に正しく適用されません · Issue #922 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/922)
- `0.x` [SpringBone does not work correctly if you change the model size, for example scale (8,8,8). · Issue #2242 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/2242)
- `0.x` [VRM 0 系で FastSpringBone を使用した際に VRM の最親のゲームオブジェクトに FastSpringBone が追従しない · Issue #2047 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/2047)
- `0.x` [Scale が VRM Spring Bone に正しく適用されません · Issue #922 · vrm-c/UniVRM · GitHub](https://github.com/vrm-c/UniVRM/issues/922)
172 changes: 172 additions & 0 deletions docs/api/spring/vrm1_springbone.md
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;
}
```
56 changes: 0 additions & 56 deletions docs/api/vrm1_springbone.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/release/100/v0.106.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Application をビルドするときの問題の修正
機能追加など

* [[\#1886](https://github.com/vrm-c/UniVRM/pull/1886)] [1.0][0.x] SpringBone の手動更新
* [SpringBone manual update](/api/vrm1_springbone)
* [SpringBone manual update](/api/spring/vrm1_springbone)
* [0_106_spring_manual_update](/api/0_106_spring_manual_update)
* [[\#1868](https://github.com/vrm-c/UniVRM/pull/1868)] SpringBoneに対して外力を渡すインターフェースを実装する
* [毎フレーム外力を加える](/api/vrm1_springbone)
* [毎フレーム外力を加える](/api/spring/vrm1_springbone)
* [[\#1878](https://github.com/vrm-c/UniVRM/pull/1878)] modGltf 引き数を追加
* [MigrateExporter](/api/vrm1_migration)
* [[\#1872](https://github.com/vrm-c/UniVRM/pull/1872)] add MigrateExporter
Expand Down
2 changes: 2 additions & 0 deletions docs/release/112/v0.122.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# v0.122.0 ktx2 y-flip

https://github.com/vrm-c/UniVRM/releases/tag/v0.122.0

https://github.com/vrm-c/UniVRM/milestone/85

:::tip (experimental) basisu 向けに import 時にtexture をY-Flip する機能
Expand Down
43 changes: 43 additions & 0 deletions docs/release/112/v0.123.0.md
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 に変わります。
:::
4 changes: 4 additions & 0 deletions docs/release/112/v0.124.0.md
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

21 changes: 17 additions & 4 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,23 @@ const sidebars: SidebarsConfig = {
label: "SpringBone",
link: { type: "doc", id: "api/spring/index" },
items: [
{ type: "doc", id: "api/vrm1_springbone" },
{ type: "doc", id: "api/fast_spring_bone" },
{ type: "doc", id: "api/0_106_spring_manual_update" },
{ type: "doc", id: "api/spring/spring_and_scaling" },
"api/spring/spring_and_scaling",
{
type: "category",
label: "vrm-1.0",
items: [
"api/spring/vrm1_springbone",
"api/spring/VRMC_springBone_extended_collider",
]
},
{
type: "category",
label: "vrm-0.x",
items: [
"api/fast_spring_bone",
"api/0_106_spring_manual_update",
]
},
],
},
{
Expand Down
16 changes: 16 additions & 0 deletions src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ const FeatureList: FeatureItem[] = [
<a href="http://discord.gg/26kbRgb58k">discord</a>
</>
),
},
{
title: 'VRM仕様の貢献者',
description: (
<>
<a href="https://github.com/vrm-c/vrm-specification/graphs/contributors">Github</a>
</>
),
},
{
title: 'UniVRMの貢献者',
description: (
<>
<a href="https://github.com/vrm-c/UniVRM/graphs/contributors">Github</a>
</>
),
}
];

Expand Down

0 comments on commit dc1f183

Please sign in to comment.