Search in sources :

Example 11 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class CharacterControl method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    useViewDirection = ic.readBoolean("viewDirectionEnabled", true);
    viewDirection = (Vector3f) ic.readSavable("viewDirection", new Vector3f(Vector3f.UNIT_Z));
    applyLocal = ic.readBoolean("applyLocalPhysics", false);
    spatial = (Spatial) ic.readSavable("spatial", null);
    setUserObject(spatial);
}
Also used : InputCapsule(com.jme3.export.InputCapsule) Vector3f(com.jme3.math.Vector3f)

Example 12 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class ChildCollisionShape method read.

public void read(JmeImporter im) throws IOException {
    InputCapsule capsule = im.getCapsule(this);
    location = (Vector3f) capsule.readSavable("location", new Vector3f());
    rotation = (Matrix3f) capsule.readSavable("rotation", new Matrix3f());
    shape = (CollisionShape) capsule.readSavable("shape", new BoxCollisionShape(new Vector3f(1, 1, 1)));
}
Also used : Matrix3f(com.jme3.math.Matrix3f) Vector3f(com.jme3.math.Vector3f) BoxCollisionShape(com.jme3.bullet.collision.shapes.BoxCollisionShape)

Example 13 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class AbstractPhysicsControl method read.

@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    applyLocal = ic.readBoolean("applyLocalPhysics", false);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 14 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class AbstractShadowRendererVR 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 = (InputCapsule) 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) EdgeFilteringMode(com.jme3.shadow.EdgeFilteringMode) ShadowCompareMode(com.jme3.texture.Texture.ShadowCompareMode) CompareMode(com.jme3.shadow.CompareMode)

Example 15 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class DirectionalLightShadowRendererVR method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = (InputCapsule) im.getCapsule(this);
    lambda = ic.readFloat("lambda", 0.65f);
    zFarOverride = ic.readInt("zFarOverride", 0);
    light = (DirectionalLight) ic.readSavable("light", null);
    fadeInfo = (Vector2f) ic.readSavable("fadeInfo", null);
    fadeLength = ic.readFloat("fadeLength", 0f);
    init(nbShadowMaps, (int) shadowMapSize);
}
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