じろうの公開メモ

自分用のメモ置き場です

duplicate


public final Object3D duplicate()
Creates a duplicate of this Object3D.

Duplication has no effect on this object or any other existing object; it merely creates one or more new objects.

As a general rule, a duplicate object will have exactly the same properties as the original object, including attribute values, references to other objects, and any other contained data. However, if this object is a Node, duplication is done as follows:

This Node is always copied. The parent of the duplicate Node is set to null.
Any descendants of this Node are themselves duplicated; this includes the skeleton group of a SkinnedMesh. Any other referenced objects are not duplicated.
If any Node in the duplicate set of Nodes refers to any Node in the original set, then that reference is updated to the corresponding Node in the duplicate set. All other references are left as they are, even if this results in a scene graph branch that is in an illegal state.
Note that the duplicate object will also have the same user ID as the original. The application is responsible for assigning the IDs in the first place, so setting the ID of the duplicate object to some unique value, if so desired, is also the application's responsibility.

Duplication is not supported for user defined classes. That is, if the application extends any class defined in this API, any instances of that class will be treated by this method as instances of the base class. For example, duplicating an instance of MonsterMesh (derived from Mesh) will produce just a Mesh instance, not a MonsterMesh instance.

This method is similar to the clone method that is available on the higher end Java platforms, such as J2SE and J2ME/CDC. This method is likely to be deprecated once the proper java.lang.Object.clone method becomes available also on CLDC.

Returns:
a new Object3D that is a duplicate of this object

直訳:このObject3Dの写しを作成します。

複製はこのオブジェクトかいかなる他の既存のオブジェクトの上にも効き目がありません。 それは単に1個以上の新しいオブジェクトを作成します。

概して、写しオブジェクトには、まさにオリジナルのオブジェクトと同じ特性があるでしょう、属性値、他のオブジェクトの指示するもの、およびいかなる他の含まれたデータも含んでいます。 しかしながら、このオブジェクトがNodeであれば、以下の通り、複写します:

このNodeはいつもコピーされます。 写しNodeの親はヌルに用意ができています。
このNodeのどんな子孫もコピーされます。 これはSkinnedMeshの骸骨のグループを含んでいます。 いかなる他の参照をつけられたオブジェクトもコピーされません。
Nodesの写しセットにおけるどれかNodeが何か元のセットにおけるNodeについて言及すると、写しセットでその参照を対応するNodeにアップデートします。 それらが残されるので、他のすべての参照が残されています、これが不法な状態にある場面グラフブランチをもたらしても。
また、写しオブジェクトにはオリジナルと同じユーザIDがあることに注意してください。 アプリケーションが第一にIDを割り当てるのに原因となるので、また、そう望まれているなら何らかのユニークな値に写しオブジェクトのIDを設定するのは、アプリケーションの責任です。

複製はユーザの定義されたクラスのためにサポートされません。 すなわち、アプリケーションが何かこのAPIで定義されたクラスを広げると、そのクラスのどんなインスタンスも基底クラスのインスタンスとしてこのメソッドで扱われるでしょう。 例えば、MonsterMesh(Meshから、派生する)のインスタンスをコピーすると、MonsterMeshインスタンスではなく、まさしくMeshインスタンスが生産されるでしょう。

このメソッドは上位Javaプラットホームで利用可能なクローンメソッドと同様です、J2SEやJ2ME/CDCのように。 このメソッドは適切なjava.lang.Object.cloneメソッドがいったんCLDCでも利用可能になると推奨しない傾向があります。

リターン:
このオブジェクトの写しである新しいObject3D

複製?