Physics2DのChangeTensorScene

PS Suite SDKの話。
Physics2Dのサンプルとしてある、Physics2DSample。
その中の、
ChangeTensorScene(慣性テンソルをデフォルト計算から変更したサンプルシーンです。)
について。

慣性テンソルとは

さっぱり。検索すると物理の難しい単語がいっぱい。
しかし、冒頭の[Tips and notice]にある程度説明があったので。
とりあえず全文(誤字はそのまま)

Inertia tensor defines how much easy the rigid boy is to start to rotate
and how difficult it is to stop rotating.

When this value is large, it is not easy for rigid body to start to rotate.
But once that it starts to rotate, it is not easy for it to stop rotating.

On the other hand when this value is small, it is easy for rigid body to start to rotate.
But even if it starts to rotate, it is easy for it to stop rotating.

Please notice that it is necessary to update invInertia at the same time
when you change inertia parameter to avoid confliction of parameters.

google翻訳を駆使した意訳(間違ってるかもしれないので注意を。)

慣性テンソルでは剛体の回転しやすさと止まりにくさを定義します。

値が大きいとき、回転しにくいです。
ですが、一度回転すると、止まりにくいです。

逆に値が小さいとき、回転しやすいです。
しかし同様に止まりやすいです。

inertiaとinvInertiaと同期していないといけないので、
片方を変更したら対応するようにもう一方を変更してください。

float inertia = 0.0f
剛体のテンソル
剛体のテンソルテンソルの逆数と同期していないといけない

float invInertia = 0.0f
剛体のテンソルの逆数
剛体のテンソルの逆数はテンソルと同期していないといけない

サンプルの内容

画像の左はデフォルト。
真ん中

sceneBodies[numBody].inertia *= 0.1f;
sceneBodies[numBody].invInertia *= 10.0f;

sceneBodies[numBody].inertia *= 10.0f;
sceneBodies[numBody].invInertia *= 0.1f;

実行すると

一回転 特に。
真ん中 良く回っている 回転の割に左と同時くらいに止まる
揺れるくらい 最後までゆらゆらしてる

といった感じ。
なかなか使いどころが難しそう。