use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class Quad method read.
@Override
public void read(JmeImporter e) throws IOException {
super.read(e);
InputCapsule capsule = e.getCapsule(this);
width = capsule.readFloat("width", 0);
height = capsule.readFloat("height", 0);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class AbstractShadowRenderer method read.
/**
* De-serialize this instance, for example when loading from a J3O file.
*
* @param im importer (not null)
*/
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
assetManager = im.getAssetManager();
nbShadowMaps = ic.readInt("nbShadowMaps", 1);
shadowMapSize = ic.readFloat("shadowMapSize", 0f);
shadowIntensity = ic.readFloat("shadowIntensity", 0.7f);
edgeFilteringMode = ic.readEnum("edgeFilteringMode", EdgeFilteringMode.class, EdgeFilteringMode.Bilinear);
shadowCompareMode = ic.readEnum("shadowCompareMode", CompareMode.class, CompareMode.Hardware);
init(assetManager, nbShadowMaps, (int) shadowMapSize);
edgesThickness = ic.readFloat("edgesThickness", 1.0f);
postshadowMat.setFloat("PCFEdge", edgesThickness);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class DirectionalLightShadowFilter method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
shadowRenderer = (DirectionalLightShadowRenderer) ic.readSavable("shadowRenderer", null);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class TerrainPatch method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
size = ic.readInt("size", 16);
totalSize = ic.readInt("totalSize", 16);
quadrant = ic.readShort("quadrant", (short) 0);
stepScale = (Vector3f) ic.readSavable("stepScale", Vector3f.UNIT_XYZ);
offset = (Vector2f) ic.readSavable("offset", Vector3f.UNIT_XYZ);
offsetAmount = ic.readFloat("offsetAmount", 0);
//lodCalculator = (LodCalculator) ic.readSavable("lodCalculator", new DistanceLodCalculator());
//lodCalculator.setTerrainPatch(this);
//lodCalculatorFactory = (LodCalculatorFactory) ic.readSavable("lodCalculatorFactory", null);
lodEntropy = ic.readFloatArray("lodEntropy", null);
geomap = (LODGeomap) ic.readSavable("geomap", null);
Mesh regen = geomap.createMesh(stepScale, new Vector2f(1, 1), offset, offsetAmount, totalSize, false);
setMesh(regen);
//TangentBinormalGenerator.generate(this); // note that this will be removed
ensurePositiveVolumeBBox();
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class DistanceLodCalculator method read.
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
size = ic.readInt("patchSize", 32);
lodMultiplier = ic.readFloat("lodMultiplier", 2.7f);
}
Aggregations