Search in sources :

Example 26 with InputCapsule

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);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 27 with InputCapsule

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);
}
Also used : InputCapsule(com.jme3.export.InputCapsule) ShadowCompareMode(com.jme3.texture.Texture.ShadowCompareMode)

Example 28 with InputCapsule

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);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 29 with InputCapsule

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();
}
Also used : InputCapsule(com.jme3.export.InputCapsule) Mesh(com.jme3.scene.Mesh)

Example 30 with InputCapsule

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);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Aggregations

InputCapsule (com.jme3.export.InputCapsule)119 Vector3f (com.jme3.math.Vector3f)18 Matrix3f (com.jme3.math.Matrix3f)5 ArrayList (java.util.ArrayList)4 AssetNotFoundException (com.jme3.asset.AssetNotFoundException)2 PhysicsRigidBody (com.jme3.bullet.objects.PhysicsRigidBody)2 Mesh (com.jme3.scene.Mesh)2 ShadowCompareMode (com.jme3.texture.Texture.ShadowCompareMode)2 ConvexShape (com.bulletphysics.collision.shapes.ConvexShape)1 KinematicCharacterController (com.bulletphysics.dynamics.character.KinematicCharacterController)1 Generic6DofConstraint (com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint)1 HingeConstraint (com.bulletphysics.dynamics.constraintsolver.HingeConstraint)1 SliderConstraint (com.bulletphysics.dynamics.constraintsolver.SliderConstraint)1 Transform (com.bulletphysics.linearmath.Transform)1 LoopMode (com.jme3.animation.LoopMode)1 AssetInfo (com.jme3.asset.AssetInfo)1 AssetKey (com.jme3.asset.AssetKey)1 AssetManager (com.jme3.asset.AssetManager)1 ModelKey (com.jme3.asset.ModelKey)1 BoundingBox (com.jme3.bounding.BoundingBox)1