Java Code Examples for com.jme3.export.InputCapsule#readBoolean()

The following examples show how to use com.jme3.export.InputCapsule#readBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlenderKey.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
public void read(JmeImporter e) throws IOException {
    super.read(e);
    InputCapsule ic = e.getCapsule(this);
    fps = ic.readInt("fps", DEFAULT_FPS);
    featuresToLoad = ic.readInt("features-to-load", FeaturesToLoad.ALL);
    loadUnlinkedAssets = ic.readBoolean("load-unlinked-assets", false);
    assetRootPath = ic.readString("asset-root-path", null);
    fixUpAxis = ic.readBoolean("fix-up-axis", true);
    generatedTexturePPU = ic.readInt("generated-texture-ppu", 128);
    usedWorld = ic.readString("used-world", null);
    defaultMaterial = (Material) ic.readSavable("default-material", null);
    faceCullMode = ic.readEnum("face-cull-mode", FaceCullMode.class, FaceCullMode.Off);
    layersToLoad = ic.readInt("layers-to=load", -1);
    mipmapGenerationMethod = ic.readEnum("mipmap-generation-method", MipmapGenerationMethod.class, MipmapGenerationMethod.GENERATE_WHEN_NEEDED);
}
 
Example 2
Source File: MatParam.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    type = ic.readEnum("varType", VarType.class, null);
    name = ic.readString("name", null);
    ffBinding = ic.readEnum("ff_binding", FixedFuncBinding.class, null);
    switch (getVarType()) {
        case Boolean:
            value = ic.readBoolean("value_bool", false);
            break;
        case Float:
            value = ic.readFloat("value_float", 0f);
            break;
        case Int:
            value = ic.readInt("value_int", 0);
            break;
        default:
            value = ic.readSavable("value_savable", null);
            break;
    }
}
 
Example 3
Source File: HingeJoint.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    this.axisA = (Vector3f) capsule.readSavable("axisA", new Vector3f());
    this.axisB = (Vector3f) capsule.readSavable("axisB", new Vector3f());

    this.angularOnly = capsule.readBoolean("angularOnly", false);
    float lowerLimit = capsule.readFloat("lowerLimit", 1e30f);
    float upperLimit = capsule.readFloat("upperLimit", -1e30f);

    this.biasFactor = capsule.readFloat("biasFactor", 0.3f);
    this.relaxationFactor = capsule.readFloat("relaxationFactor", 1f);
    this.limitSoftness = capsule.readFloat("limitSoftness", 0.9f);

    boolean enableAngularMotor=capsule.readBoolean("enableAngularMotor", false);
    float targetVelocity=capsule.readFloat("targetVelocity", 0.0f);
    float maxMotorImpulse=capsule.readFloat("maxMotorImpulse", 0.0f);

    createJoint();
    enableMotor(enableAngularMotor, targetVelocity, maxMotorImpulse);
    ((HingeConstraint) constraint).setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor);
}
 
Example 4
Source File: AbstractPhysicsControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * De-serialize this control from the specified importer, for example when
 * loading from a J3O file.
 *
 * @param im importer (not null)
 * @throws IOException from importer
 */
@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);
}
 
Example 5
Source File: SoundEvent.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    path = ic.readString("path", "");
    stream = ic.readBoolean("stream", false);

}
 
Example 6
Source File: HeightfieldCollisionShape.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    heightStickWidth = capsule.readInt("heightStickWidth", 0);
    heightStickLength = capsule.readInt("heightStickLength", 0);
    heightScale = capsule.readFloat("heightScale", 0);
    minHeight = capsule.readFloat("minHeight", 0);
    maxHeight = capsule.readFloat("maxHeight", 0);
    upAxis = capsule.readInt("upAxis", 1);
    heightfieldData = capsule.readFloatArray("heightfieldData", new float[0]);
    flipQuadEdges = capsule.readBoolean("flipQuadEdges", false);
    createShape();
}
 
Example 7
Source File: GhostControl.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    applyLocal = ic.readBoolean("applyLocalPhysics", false);
    setUserObject(spatial);
}
 
Example 8
Source File: Sphere.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter e) throws IOException {
    super.read(e);
    InputCapsule capsule = e.getCapsule(this);
    zSamples = capsule.readInt("zSamples", 0);
    radialSamples = capsule.readInt("radialSamples", 0);
    radius = capsule.readFloat("radius", 0);
    useEvenSlices = capsule.readBoolean("useEvenSlices", false);
    textureMode = capsule.readEnum("textureMode", TextureMode.class, TextureMode.Original);
    interior = capsule.readBoolean("interior", false);
}
 
Example 9
Source File: TechniqueDef.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void read(JmeImporter im) throws IOException{
    InputCapsule ic = im.getCapsule(this);
    name = ic.readString("name", null);
    vertName = ic.readString("vertName", null);
    fragName = ic.readString("fragName", null);
    shaderLang = ic.readString("shaderLang", null);
    presetDefines = (DefineList) ic.readSavable("presetDefines", null);
    lightMode = ic.readEnum("lightMode", LightMode.class, LightMode.Disable);
    shadowMode = ic.readEnum("shadowMode", ShadowMode.class, ShadowMode.Disable);
    renderState = (RenderState) ic.readSavable("renderState", null);
    usesShaders = ic.readBoolean("usesShaders", false);
}
 
Example 10
Source File: PhysicsHoverControl.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
}
 
Example 11
Source File: AudioKey.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException{
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    stream = ic.readBoolean("do_stream", false);
    streamCache = ic.readBoolean("use_stream_cache", false);
}
 
Example 12
Source File: TerrainLodControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(final 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());
    useRenderCamera = ic.readBoolean("useRenderCamera", false);
}
 
Example 13
Source File: VehicleControl.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
    setUserObject(spatial);
}
 
Example 14
Source File: VehicleControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * De-serialize this control, for example when loading from a J3O file.
 *
 * @param im importer (not null)
 * @throws IOException from importer
 */
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
    setUserObject(spatial);
}
 
Example 15
Source File: ConeJoint.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    this.rotA = (Matrix3f) capsule.readSavable("rotA", new Matrix3f());
    this.rotB = (Matrix3f) capsule.readSavable("rotB", new Matrix3f());

    this.angularOnly = capsule.readBoolean("angularOnly", false);
    this.swingSpan1 = capsule.readFloat("swingSpan1", 1e30f);
    this.swingSpan2 = capsule.readFloat("swingSpan2", 1e30f);
    this.twistSpan = capsule.readFloat("twistSpan", 1e30f);
    createJoint();
}
 
Example 16
Source File: RadialParticleInfluencer.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    radialVelocity = ic.readFloat("radialVelocity", 0f);
    origin = (Vector3f) ic.readSavable("origin", new Vector3f());
    horizontal = ic.readBoolean("horizontal", false);
}
 
Example 17
Source File: MatParamOverride.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    boolean isNull = ic.readBoolean("isNull", false);
    if (isNull) {
        setValue(null);
    }
}
 
Example 18
Source File: SliderJoint.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    float dampingDirAng = capsule.readFloat("dampingDirAng", 0f);
    float dampingDirLin = capsule.readFloat("dampingDirLin", 0f);
    float dampingLimAng = capsule.readFloat("dampingLimAng", 0f);
    float dampingLimLin = capsule.readFloat("dampingLimLin", 0f);
    float dampingOrthoAng = capsule.readFloat("dampingOrthoAng", 0f);
    float dampingOrthoLin = capsule.readFloat("dampingOrthoLin", 0f);
    float lowerAngLimit = capsule.readFloat("lowerAngLimit", 0f);
    float lowerLinLimit = capsule.readFloat("lowerLinLimit", 0f);
    float maxAngMotorForce = capsule.readFloat("maxAngMotorForce", 0f);
    float maxLinMotorForce = capsule.readFloat("maxLinMotorForce", 0f);
    boolean poweredAngMotor = capsule.readBoolean("poweredAngMotor", false);
    boolean poweredLinMotor = capsule.readBoolean("poweredLinMotor", false);
    float restitutionDirAng = capsule.readFloat("restitutionDirAng", 0f);
    float restitutionDirLin = capsule.readFloat("restitutionDirLin", 0f);
    float restitutionLimAng = capsule.readFloat("restitutionLimAng", 0f);
    float restitutionLimLin = capsule.readFloat("restitutionLimLin", 0f);
    float restitutionOrthoAng = capsule.readFloat("restitutionOrthoAng", 0f);
    float restitutionOrthoLin = capsule.readFloat("restitutionOrthoLin", 0f);

    float softnessDirAng = capsule.readFloat("softnessDirAng", 0f);
    float softnessDirLin = capsule.readFloat("softnessDirLin", 0f);
    float softnessLimAng = capsule.readFloat("softnessLimAng", 0f);
    float softnessLimLin = capsule.readFloat("softnessLimLin", 0f);
    float softnessOrthoAng = capsule.readFloat("softnessOrthoAng", 0f);
    float softnessOrthoLin = capsule.readFloat("softnessOrthoLin", 0f);

    float targetAngMotorVelicoty = capsule.readFloat("targetAngMotorVelicoty", 0f);
    float targetLinMotorVelicoty = capsule.readFloat("targetLinMotorVelicoty", 0f);

    float upperAngLimit = capsule.readFloat("upperAngLimit", 0f);
    float upperLinLimit = capsule.readFloat("upperLinLimit", 0f);

    useLinearReferenceFrameA = capsule.readBoolean("useLinearReferenceFrameA", false);

    createJoint();

    setDampingDirAng(dampingDirAng);
    setDampingDirLin(dampingDirLin);
    setDampingLimAng(dampingLimAng);
    setDampingLimLin(dampingLimLin);
    setDampingOrthoAng(dampingOrthoAng);
    setDampingOrthoLin(dampingOrthoLin);
    setLowerAngLimit(lowerAngLimit);
    setLowerLinLimit(lowerLinLimit);
    setMaxAngMotorForce(maxAngMotorForce);
    setMaxLinMotorForce(maxLinMotorForce);
    setPoweredAngMotor(poweredAngMotor);
    setPoweredLinMotor(poweredLinMotor);
    setRestitutionDirAng(restitutionDirAng);
    setRestitutionDirLin(restitutionDirLin);
    setRestitutionLimAng(restitutionLimAng);
    setRestitutionLimLin(restitutionLimLin);
    setRestitutionOrthoAng(restitutionOrthoAng);
    setRestitutionOrthoLin(restitutionOrthoLin);

    setSoftnessDirAng(softnessDirAng);
    setSoftnessDirLin(softnessDirLin);
    setSoftnessLimAng(softnessLimAng);
    setSoftnessLimLin(softnessLimLin);
    setSoftnessOrthoAng(softnessOrthoAng);
    setSoftnessOrthoLin(softnessOrthoLin);

    setTargetAngMotorVelocity(targetAngMotorVelicoty);
    setTargetLinMotorVelocity(targetLinMotorVelicoty);

    setUpperAngLimit(upperAngLimit);
    setUpperLinLimit(upperLinLimit);
}
 
Example 19
Source File: AbstractControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
}
 
Example 20
Source File: SliderJoint.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    float dampingDirAng = capsule.readFloat("dampingDirAng", 0f);
    float dampingDirLin = capsule.readFloat("dampingDirLin", 0f);
    float dampingLimAng = capsule.readFloat("dampingLimAng", 0f);
    float dampingLimLin = capsule.readFloat("dampingLimLin", 0f);
    float dampingOrthoAng = capsule.readFloat("dampingOrthoAng", 0f);
    float dampingOrthoLin = capsule.readFloat("dampingOrthoLin", 0f);
    float lowerAngLimit = capsule.readFloat("lowerAngLimit", 0f);
    float lowerLinLimit = capsule.readFloat("lowerLinLimit", 0f);
    float maxAngMotorForce = capsule.readFloat("maxAngMotorForce", 0f);
    float maxLinMotorForce = capsule.readFloat("maxLinMotorForce", 0f);
    boolean poweredAngMotor = capsule.readBoolean("poweredAngMotor", false);
    boolean poweredLinMotor = capsule.readBoolean("poweredLinMotor", false);
    float restitutionDirAng = capsule.readFloat("restitutionDirAng", 0f);
    float restitutionDirLin = capsule.readFloat("restitutionDirLin", 0f);
    float restitutionLimAng = capsule.readFloat("restitutionLimAng", 0f);
    float restitutionLimLin = capsule.readFloat("restitutionLimLin", 0f);
    float restitutionOrthoAng = capsule.readFloat("restitutionOrthoAng", 0f);
    float restitutionOrthoLin = capsule.readFloat("restitutionOrthoLin", 0f);

    float softnessDirAng = capsule.readFloat("softnessDirAng", 0f);
    float softnessDirLin = capsule.readFloat("softnessDirLin", 0f);
    float softnessLimAng = capsule.readFloat("softnessLimAng", 0f);
    float softnessLimLin = capsule.readFloat("softnessLimLin", 0f);
    float softnessOrthoAng = capsule.readFloat("softnessOrthoAng", 0f);
    float softnessOrthoLin = capsule.readFloat("softnessOrthoLin", 0f);

    float targetAngMotorVelicoty = capsule.readFloat("targetAngMotorVelicoty", 0f);
    float targetLinMotorVelicoty = capsule.readFloat("targetLinMotorVelicoty", 0f);

    float upperAngLimit = capsule.readFloat("upperAngLimit", 0f);
    float upperLinLimit = capsule.readFloat("upperLinLimit", 0f);

    useLinearReferenceFrameA = capsule.readBoolean("useLinearReferenceFrameA", false);

    createJoint();

    ((SliderConstraint)constraint).setDampingDirAng(dampingDirAng);
    ((SliderConstraint)constraint).setDampingDirLin(dampingDirLin);
    ((SliderConstraint)constraint).setDampingLimAng(dampingLimAng);
    ((SliderConstraint)constraint).setDampingLimLin(dampingLimLin);
    ((SliderConstraint)constraint).setDampingOrthoAng(dampingOrthoAng);
    ((SliderConstraint)constraint).setDampingOrthoLin(dampingOrthoLin);
    ((SliderConstraint)constraint).setLowerAngLimit(lowerAngLimit);
    ((SliderConstraint)constraint).setLowerLinLimit(lowerLinLimit);
    ((SliderConstraint)constraint).setMaxAngMotorForce(maxAngMotorForce);
    ((SliderConstraint)constraint).setMaxLinMotorForce(maxLinMotorForce);
    ((SliderConstraint)constraint).setPoweredAngMotor(poweredAngMotor);
    ((SliderConstraint)constraint).setPoweredLinMotor(poweredLinMotor);
    ((SliderConstraint)constraint).setRestitutionDirAng(restitutionDirAng);
    ((SliderConstraint)constraint).setRestitutionDirLin(restitutionDirLin);
    ((SliderConstraint)constraint).setRestitutionLimAng(restitutionLimAng);
    ((SliderConstraint)constraint).setRestitutionLimLin(restitutionLimLin);
    ((SliderConstraint)constraint).setRestitutionOrthoAng(restitutionOrthoAng);
    ((SliderConstraint)constraint).setRestitutionOrthoLin(restitutionOrthoLin);

    ((SliderConstraint)constraint).setSoftnessDirAng(softnessDirAng);
    ((SliderConstraint)constraint).setSoftnessDirLin(softnessDirLin);
    ((SliderConstraint)constraint).setSoftnessLimAng(softnessLimAng);
    ((SliderConstraint)constraint).setSoftnessLimLin(softnessLimLin);
    ((SliderConstraint)constraint).setSoftnessOrthoAng(softnessOrthoAng);
    ((SliderConstraint)constraint).setSoftnessOrthoLin(softnessOrthoLin);

    ((SliderConstraint)constraint).setTargetAngMotorVelocity(targetAngMotorVelicoty);
    ((SliderConstraint)constraint).setTargetLinMotorVelocity(targetLinMotorVelicoty);

    ((SliderConstraint)constraint).setUpperAngLimit(upperAngLimit);
    ((SliderConstraint)constraint).setUpperLinLimit(upperLinLimit);
}