字幕表 動画を再生する
Let's look at the basic joints in Unity.
Unity における基本的なジョイント(Joint)をみて行きます。
In this example we have fixed joints
このサンプルでは Fixed Joint および
and spring joints.
Spring Joint があります。
This example forms a basic wrecking ball
このサンプルでは 鉄球 (wrecking ball) を
that does this.
構成してます。
Firstly the fixed joint. Fixed joints
最初は Fixed Joint をみていきます。Fixed Joint は
work in a similar way to parenting objects
階層の中で
in the hierarchy.
親子関係を作成するのに似ています。
The joint simply locks a game object
ジョイントによりゲームオブジェクトを
to the point in the world, or to a
ワールド空間座標の点または
connected rigidbody.
接続された Rigidbody に対してロックします。
In this example we simply have placed the
このサンプルでは chain の最初の capsule を
first capsule in the chain up near
天井の側に配置して
the ceiling and attached a fixed joint.
Fixed Joint をアタッチしています。
This locks it in place.
これによりその場所にロックされます。
The other parameters of this fixed joint
この Fixed Joint の他のパラメータは
are Break Force and Break Torque.
Break Force および Break Torque です。
This is the minimum amount of force required
これは ジョイントを壊すために
to break the joint.
必要な最小の力を表します。
When the joint is broken the game object
ジョイントが破壊されたときゲームオブジェクトは
can once again move freely.
再び自由に移動出来るようになります。
The other capsules in the chain have
chain の他の capsule は
spring joints. Spring joints work on the
Spring Joint があります。Spring Joint は
principle that the game object is trying
ゲームオブジェクトがターゲット位置に到達しようとするという
to reach a target position. The target
原理にもとづいています。
position that it's trying to reach is the
到達しようとするターゲット位置は
position that it's set to in the scene view
シーンビューでセットされた位置であり、
and any rigid bodies that are attached to it
そこにアタッチされたすべての Rigidbody は
will pull it away from this position
特定のアンカー位置 (anchor point) にアタッチされた
on an invisible spring attached
透明の Spring により
to the anchor point.
引っ張られていきます。
If the spring joint has a connected rigidbody
もし Spring Joint に接続された Rigidbody がある場合
then the target point that the spring
Spring が到達しようとするターゲット地点は
is trying to reach is relative to that
ワールド空間に対してではなく
game object rather than to world space.
ゲームオブジェクトに対する相対的な位置です。
So for example, the second capsule here
例えば、ここで二つめの capsule は
is trying to reach capsule 1, and capsule 3
capsule 1 に到達しようとしていて、capsule 3 は
is trying to reach capsule 2.
capsule 2 に到達しようとしています。
As these move they will no longer be heading
これらが動くにつれて、もはや元の位置に
towards the original positions, rather
向かうことはなく、むしろ
they will be heading towards the anchor
それらの capsule がある位置に
point of wherever those capsules happen to be.
向かっていきます。
The anchor is the pivot point of the joint.
anchor とは joint のピボット地点です。
You should consider it as where the spring is
ゲームオブジェクトに spring をアタッチした
attached to the game object.
場所としてとらえるべきです。
This is shown in the scene view by
これはシーンビュー上で
an orange dot or box.
オレンジ色の点線またはボックスとして表示されます。
The spring parameter is a measure of how
spring パラメータは spring 強度に関する
strong the spring is. The higher the
指標です。値が大きいほど
value the tighter or stronger the
spring がきつくなったり、強くなったり
spring becomes. The damper parameter
します。damper パラメータにより
is how much the joint will slow down
joint が移動するときにどれぐらい
under motion. The higher the number, the
減速するかを決定します。数字が大きいほど
less the spring will overshoot.
spring は跳ねすぎるようになります。
The min and max distances are for setting
min および max distance は
up a sort of dead zone for where the
spring が有効でない領域を決めるために
spring isn't active. They effectively restrict
あります。これらは 要するに Spring の
the length of the spring.
長さを制限します。
Similar to the fixed joint, the spring
Fixed Joint と同様に Spring にも
also has a break force and a break torque,
Break Force および Break Torque があり、
which you can set to a certain amount in order
特定の数値 にセットすることで
to find the minimum force required to
Joint を壊すために必要な最小の力を
break that joint.
決められます。
Finally, Hinge Joints.
最後に、 Hinge Joint です。
Hinge joints are ideal for things like
Hinge Joint は ドアなどに理想的であり
doors and share some properties with
Spring Joint といくつかのプロパティを
spring joints. The axis of the hinge
共有します。 Hinge の Axis は
is the one that it rotates around.
これが回転する軸となるものです。
In this example our physics door
このサンプルでは physicsDoor は
has the hinge joint attached. The anchor
Hinge Joint がアタッチされています。Anchor は
is set to 1 in the X axis,
X 軸で 1 にセットされていて、
which moves it from it's center to it's edge.
この中心から端に移動させます。
Again the joint is represented in
再び Joint は Unityの中でオレンジ色で
orange in Unity and you can see a small line
表現されていて、Hinge が現在ある場所を示す小さな線を
showing you where the hinge is currently located.
確認することが出来ます。
The axis then allows us to specify
Axis によって、
around which axis the hinge will pivot.
どの軸を Hinge がピボットするか指定できます。
We've set this to the Y axis so it will
これを Y 軸にすることでシンプルなスクリプトにより
react like a real hinge with a simple script
現実世界のちょうつがいのようの動作するようにしています。
we're applying a force to the door
ドアに対して Force を適用することで
when we click on it, which pushes it
クリックしたとき、 Z 軸の方向に
backwards in it's Z axis
押すことが出来て、
using the shortcut minus transform.forward.
負の方向の transform.forward をショートカットとして使用します。
In the Add Force lesson you may have seen
Add Force レッスンにより、
that this fires the door straight out of the frame.
ドアをフレームから外にふきとばすところをみました。
But now that we have a hinge,
しかし、今回は Hinge があることにより
when we apply the force to the door
ドアに Force を適用するとき
it simply pivots around that point.
その地点を中心にピボットするようになります。
and no matter how many times we add force
そして何回 Force を加えようとも
to it, it doesn't break.
壊れることがありません。
In a similar manner to our spring joint
Spring Joint と同様にして
we can apply spring-like characterises
Spring のような特性を適用するためには
by using the Use Spring checkbox
Spring チェックボックスを使用して
and using the values underneath the spring settings.
さらに Spring 設定の下にある値を使用します。
The other differences between hinge joints
Hinge Joint および Spring Joint の他の違いは
and spring joints are motors and limits.
Motor および Limit です。
Motors are for introducing a velocity
Motor は Joint に Velocity をつけるための
to your joint, for example a revolving door.
ものであり、例をあげると回転ドアになります。
The Target Velocity is the velocity the
Target Velocity は Joint が回転しようとする
joint is trying to rotate at and the
Velocity であり、
force is used to try and attain that velocity.
Force を使用してその Velocity に到達しようとします。
If Free Spin is checked then the force will
もし Free Spin 画チェックされた場合 Force は
only be used to try and accelerate
Joint を加速しようとするためのみに使用されて
the joint and not to decelerate it.
減速されるためには使用されません。
Limits can be used if you wish to constrain
Limit を使用して Joint の動作を制限することが必要な場合に
the motion of your joint, like with the
使用することが出来て、例えば普通のドア
normal door. The minimum and maximum
みたいなものです。 Minimum および Maximum は
are the angles between which the joint
Joint が移動できる角度です。
can move. Min and Max Bounce are the amount
Min および Max Bounce は Joint が
by which the joint will bounce when it reaches
どれかの Limit に到達したときに
one of it's limits. And similar to our
の跳ねる (Bounce) ことが出来る量です。
spring joint, yet again we have break
Spring Joint と同様に、
forces and torques.
Break Force および Torque があります。
For example, if we add in a reasonably low
例えば、Break Force プロパティに
number into the break force property,
適切な低い値を設定すると、
we can break the door off of the hinge
Force を加えた時にドアをちょうつがいから
when adding a force. You should note that
外れるようにすることが出来ます。
when doing this the door doesn't fly directly
これをするとき、ドアが後ろ方向に直接はじけとぶのではなく、
backwards but is instead pulled away from it's hinge.
ちょうつがいから引っ張られて外れるようになることに注意すべきです。 (翻訳:gamesonytablet)