So I have the following “problem”:
I want to serialize one/multiple MotionPath’s to a .j3o file (but not by using a seperate file/exporter).
Usually it works like this:
A MotionPath
is a Savable
(which could be exported). It is then added to a MotionEvent
which infact implements Control
.
My Intention is to allow MotionPaths to be added onto the SceneGraph of a .j3o file to allow the use of a container (because in most use-cases you have two paths per file: The Path itself and the Path for the “LookAt” Object)
You would then access them like so:
Node n = getAssetManager().loadSpatial(...);
MotionPath = (MotionPath)n.getChild("MotionPath1");
Now it’s obvious that this would require an (invalid) core change, so I thought since MotionPath implements Savable
I could pass it as userData, right?
The big picture is this: I want to add Motion Paths to the SDK and as such I’d love to simply extend what’s currently there. In order to save such a UserDataNode I’d need a different class than Node (to have the SceneExplorer/Properties Window behave differently).
For this, I’d simply extend Node (which is discouraged, I know)
The Question is simply: When I Override the clone() and export methods, will I be able to serialize it completely as a Node and not as a “MotionPathNode”?
However maybe someone can come up with another good idea?