use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class SimpleLodThreshold method read.
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
size = ic.readInt("size", 16);
lodMultiplier = ic.readInt("lodMultiplier", 2);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class TerrainGrid method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule c = im.getCapsule(this);
name = c.readString("name", null);
size = c.readInt("size", 0);
patchSize = c.readInt("patchSize", 0);
stepScale = (Vector3f) c.readSavable("stepScale", null);
offset = (Vector2f) c.readSavable("offset", null);
offsetAmount = c.readFloat("offsetAmount", 0);
gridTileLoader = (TerrainGridTileLoader) c.readSavable("terrainQuadGrid", null);
material = (Material) c.readSavable("material", null);
initData();
if (gridTileLoader != null) {
gridTileLoader.setPatchSize(this.patchSize);
gridTileLoader.setQuadSize(this.quadSize);
}
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class TerrainLodControl method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
terrain = (Terrain) ic.readSavable("terrain", null);
lodCalculator = (LodCalculator) ic.readSavable("lodCalculator", new DistanceLodCalculator());
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class AssetLinkNode method read.
@Override
public void read(JmeImporter e) throws IOException {
super.read(e);
InputCapsule capsule = e.getCapsule(this);
BinaryImporter importer = BinaryImporter.getInstance();
AssetManager loaderManager = e.getAssetManager();
assetLoaderKeys = (ArrayList<ModelKey>) capsule.readSavableArrayList("assetLoaderKeyList", new ArrayList<ModelKey>());
for (Iterator<ModelKey> it = assetLoaderKeys.iterator(); it.hasNext(); ) {
ModelKey modelKey = it.next();
AssetInfo info = loaderManager.locateAsset(modelKey);
Spatial child = null;
if (info != null) {
child = (Spatial) importer.load(info);
}
if (child != null) {
child.parent = this;
children.add(child);
assetChildren.put(modelKey, child);
} else {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Cannot locate {0} for asset link node {1}", new Object[] { modelKey, key });
}
}
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class AbstractControl method read.
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
enabled = ic.readBoolean("enabled", true);
spatial = (Spatial) ic.readSavable("spatial", null);
}
Aggregations