.. | .. |
---|
14 | 14 | import //weka.core. |
---|
15 | 15 | matrix.Matrix; |
---|
16 | 16 | |
---|
| 17 | +import java.util.UUID; |
---|
| 18 | + |
---|
17 | 19 | //import net.sourceforge.sizeof.SizeOf; |
---|
18 | 20 | public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D> |
---|
19 | 21 | { |
---|
20 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
21 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
| 24 | + |
---|
| 25 | + private UUID uuid = UUID.randomUUID(); |
---|
22 | 26 | |
---|
23 | 27 | ScriptNode scriptnode; |
---|
24 | 28 | |
---|
.. | .. |
---|
5371 | 5375 | } |
---|
5372 | 5376 | } |
---|
5373 | 5377 | |
---|
| 5378 | + UUID GetUUID() |
---|
| 5379 | + { |
---|
| 5380 | + if (uuid == null) |
---|
| 5381 | + { |
---|
| 5382 | + // Serial |
---|
| 5383 | + uuid = UUID.randomUUID(); |
---|
| 5384 | + } |
---|
| 5385 | + |
---|
| 5386 | + return uuid; |
---|
| 5387 | + } |
---|
| 5388 | + |
---|
| 5389 | + Object3D GetObject(UUID uid) |
---|
| 5390 | + { |
---|
| 5391 | + if (blockloop) |
---|
| 5392 | + return null; |
---|
| 5393 | + |
---|
| 5394 | + if (GetUUID().equals(uid)) |
---|
| 5395 | + return this; |
---|
| 5396 | + |
---|
| 5397 | + int nb = Size(); |
---|
| 5398 | + for (int i = 0; i < nb; i++) |
---|
| 5399 | + { |
---|
| 5400 | + Object3D child = (Object3D) get(i); |
---|
| 5401 | + |
---|
| 5402 | + if (child == null) |
---|
| 5403 | + continue; |
---|
| 5404 | + |
---|
| 5405 | + blockloop = true; |
---|
| 5406 | + Object3D obj = child.GetObject(uid); |
---|
| 5407 | + blockloop = false; |
---|
| 5408 | + if (obj != null) |
---|
| 5409 | + return obj; |
---|
| 5410 | + } |
---|
| 5411 | + |
---|
| 5412 | + return null; |
---|
| 5413 | + } |
---|
| 5414 | + |
---|
5374 | 5415 | void SetBumpTexture(String tex) |
---|
5375 | 5416 | { |
---|
5376 | 5417 | if (GetTextures() == null) |
---|