Class AssetLinkNode

All Implemented Interfaces:
HasLocalTransform, CloneableSmartAsset, Collidable, Savable, JmeCloneable, Cloneable

public class AssetLinkNode extends Node
The AssetLinkNode does not store its children when exported to file. Instead, you can add a list of AssetKeys that will be loaded and attached when the AssetLinkNode is restored.
  • Field Details

  • Constructor Details

    • AssetLinkNode

      public AssetLinkNode()
    • AssetLinkNode

      public AssetLinkNode(ModelKey key)
    • AssetLinkNode

      public AssetLinkNode(String name, ModelKey key)
  • Method Details

    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      Called internally by com.jme3.util.clone.Cloner. Do not call directly.
      Specified by:
      cloneFields in interface JmeCloneable
      Overrides:
      cloneFields in class Node
      Parameters:
      cloner - The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.
      original - The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
    • addLinkedChild

      public void addLinkedChild(ModelKey key)
      Add a "linked" child. These are loaded from the assetManager when the AssetLinkNode is loaded from a binary file.
      Parameters:
      key - the ModelKey to add
    • removeLinkedChild

      public void removeLinkedChild(ModelKey key)
    • getAssetLoaderKeys

      public ArrayList<ModelKey> getAssetLoaderKeys()
    • attachLinkedChild

      public void attachLinkedChild(AssetManager manager, ModelKey key)
    • attachLinkedChild

      public void attachLinkedChild(Spatial spat, ModelKey key)
    • detachLinkedChild

      public void detachLinkedChild(ModelKey key)
    • detachLinkedChild

      public void detachLinkedChild(Spatial child, ModelKey key)
    • attachLinkedChildren

      public void attachLinkedChildren(AssetManager manager)
      Loads the linked children AssetKeys from the AssetManager and attaches them to the Node
      If they are already attached, they will be reloaded.
      Parameters:
      manager - for loading assets
    • detachLinkedChildren

      public void detachLinkedChildren()
    • read

      public void read(JmeImporter importer) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Node
      Throws:
      IOException
    • write

      public void write(JmeExporter e) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Node
      Throws:
      IOException