Search in sources :

Example 31 with InputCapsule

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

Example 32 with InputCapsule

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

Example 33 with InputCapsule

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

Example 34 with InputCapsule

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 });
        }
    }
}
Also used : BinaryImporter(com.jme3.export.binary.BinaryImporter) ModelKey(com.jme3.asset.ModelKey) AssetManager(com.jme3.asset.AssetManager) InputCapsule(com.jme3.export.InputCapsule) AssetInfo(com.jme3.asset.AssetInfo)

Example 35 with InputCapsule

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);
}
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