Example #1
0
  @Override
  public void readState(final IStateReader reader) throws IOException {
    name = reader.readString();
    modelColor = reader.readColor();
    localTranslation = reader.readVector3();
    localScale = reader.readVector3();
    localRotation = reader.readQuaternion();
    generator = reader.readObject();
    generator.setGeneratorNode(this);
    reader.readUntypedList(
        new IStateReader.IInstanceCreator<INode>() {
          @Override
          public INode createInstance(final Class<INode> clazz) {
            try {
              final Constructor<INode> constructor =
                  clazz.getDeclaredConstructor(AbstractSpatialComposite.class);

              constructor.setAccessible(true);
              return constructor.newInstance(GeneratorNode.this);
            } catch (final Exception e) {
              throw new RuntimeException(e);
            }
          }
        });
  }
Example #2
0
 @Override
 public void readState(final IStateReader reader) throws IOException {
   smooth = reader.readBoolean();
   point = reader.readVector3();
 }