com.jme3.export.JmeExporter Java Examples

The following examples show how to use com.jme3.export.JmeExporter. 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: HingeJoint.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Serialize this joint, for example when saving to a J3O file.
 *
 * @param ex exporter (not null)
 * @throws IOException from exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(axisA, "axisA", new Vector3f());
    capsule.write(axisB, "axisB", new Vector3f());

    capsule.write(angularOnly, "angularOnly", false);

    capsule.write(getLowerLimit(), "lowerLimit", 1e30f);
    capsule.write(getUpperLimit(), "upperLimit", -1e30f);

    capsule.write(biasFactor, "biasFactor", 0.3f);
    capsule.write(relaxationFactor, "relaxationFactor", 1f);
    capsule.write(limitSoftness, "limitSoftness", 0.9f);

    capsule.write(getEnableMotor(), "enableAngularMotor", false);
    capsule.write(getMotorTargetVelocity(), "targetVelocity", 0.0f);
    capsule.write(getMaxMotorImpulse(), "maxMotorImpulse", 0.0f);
}
 
Example #2
Source File: TerrainPatch.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    // the mesh is removed, and reloaded when read() is called
    // this reduces the save size to 10% by not saving the mesh
    Mesh temp = getMesh();
    mesh = null;

    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(size, "size", 16);
    oc.write(totalSize, "totalSize", 16);
    oc.write(quadrant, "quadrant", (short)0);
    oc.write(stepScale, "stepScale", Vector3f.UNIT_XYZ);
    oc.write(offset, "offset", Vector3f.UNIT_XYZ);
    oc.write(offsetAmount, "offsetAmount", 0);
    //oc.write(lodCalculator, "lodCalculator", null);
    //oc.write(lodCalculatorFactory, "lodCalculatorFactory", null);
    oc.write(lodEntropy, "lodEntropy", null);
    oc.write(geomap, "geomap", null);

    setMesh(temp);
}
 
Example #3
Source File: DirectionalLightShadowFilterVR.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(shadowRenderer, "shadowRenderer", null);

}
 
Example #4
Source File: ConeJoint.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(rotA, "rotA", new Matrix3f());
    capsule.write(rotB, "rotB", new Matrix3f());

    capsule.write(angularOnly, "angularOnly", false);
    capsule.write(swingSpan1, "swingSpan1", 1e30f);
    capsule.write(swingSpan2, "swingSpan2", 1e30f);
    capsule.write(twistSpan, "twistSpan", 1e30f);
}
 
Example #5
Source File: ShaderGenerationInfo.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    OutputCapsule oc = ex.getCapsule(this);
    oc.writeSavableArrayList((ArrayList) attributes, "attributes", new ArrayList<ShaderNodeVariable>());
    oc.writeSavableArrayList((ArrayList) vertexUniforms, "vertexUniforms", new ArrayList<ShaderNodeVariable>());
    oc.writeSavableArrayList((ArrayList) varyings, "varyings", new ArrayList<ShaderNodeVariable>());
    oc.writeSavableArrayList((ArrayList) fragmentUniforms, "fragmentUniforms", new ArrayList<ShaderNodeVariable>());
    oc.writeSavableArrayList((ArrayList) fragmentGlobals, "fragmentGlobals", new ArrayList<ShaderNodeVariable>());
    oc.write(vertexGlobal, "vertexGlobal", null);
}
 
Example #6
Source File: SSAOFilter.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(sampleRadius, "sampleRadius", 5.1f);
    oc.write(intensity, "intensity", 1.5f);
    oc.write(scale, "scale", 0.2f);
    oc.write(bias, "bias", 0.1f);
}
 
Example #7
Source File: SoundEvent.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(path, "path", "");
    oc.write(stream, "stream", false);
}
 
Example #8
Source File: ShaderNodeVariable.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * jme serialization (not used)
 *
 * @param ex the exporter
 * @throws IOException
 */
@Override
public void write(JmeExporter ex) throws IOException {
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(name, "name", "");
    oc.write(type, "type", "");
    oc.write(prefix, "prefix", "");
    oc.write(nameSpace, "nameSpace", "");
    oc.write(condition, "condition", null);
    oc.write(shaderOutput, "shaderOutput", false);
    oc.write(multiplicity, "multiplicity", null);
    oc.write(defaultValue, "defaultValue", null);
}
 
Example #9
Source File: BloomFilter.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(glowMode, "glowMode", GlowMode.Scene);
    oc.write(blurScale, "blurScale", 1.5f);
    oc.write(exposurePower, "exposurePower", 5.0f);
    oc.write(exposureCutOff, "exposureCutOff", 0.0f);
    oc.write(bloomIntensity, "bloomIntensity", 2.0f);
    oc.write(downSamplingFactor, "downSamplingFactor", 1);
}
 
Example #10
Source File: Sphere.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter e) throws IOException {
    super.write(e);
    OutputCapsule capsule = e.getCapsule(this);
    capsule.write(zSamples, "zSamples", 0);
    capsule.write(radialSamples, "radialSamples", 0);
    capsule.write(radius, "radius", 0);
    capsule.write(useEvenSlices, "useEvenSlices", false);
    capsule.write(textureMode, "textureMode", TextureMode.Original);
    capsule.write(interior, "interior", false);
}
 
Example #11
Source File: Image.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter e) throws IOException {
    OutputCapsule capsule = e.getCapsule(this);
    capsule.write(format, "format", Format.RGBA8);
    capsule.write(width, "width", 0);
    capsule.write(height, "height", 0);
    capsule.write(depth, "depth", 0);
    capsule.write(mipMapSizes, "mipMapSizes", null);
    capsule.write(multiSamples, "multiSamples", 1);
    capsule.writeByteBufferArrayList(data, "data", null);
    capsule.write(colorSpace, "colorSpace", null);
}
 
Example #12
Source File: CylinderCollisionShape.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(halfExtents, "halfExtents", new Vector3f(0.5f, 0.5f, 0.5f));
    capsule.write(axis, "axis", 1);
}
 
Example #13
Source File: HullCollisionShape.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);

    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(points, "points", null);
}
 
Example #14
Source File: GImpactCollisionShape.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(worldScale, "worldScale", new Vector3f(1, 1, 1));
    capsule.write(numVertices, "numVertices", 0);
    capsule.write(numTriangles, "numTriangles", 0);
    capsule.write(vertexStride, "vertexStride", 0);
    capsule.write(triangleIndexStride, "triangleIndexStride", 0);

    capsule.write(triangleIndexBase.array(), "triangleIndexBase", new byte[0]);
    capsule.write(vertexBase.array(), "vertexBase", new byte[0]);
}
 
Example #15
Source File: LightScatteringFilter.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(lightPosition, "lightPosition", Vector3f.ZERO);
    oc.write(nbSamples, "nbSamples", 50);
    oc.write(blurStart, "blurStart", 0.02f);
    oc.write(blurWidth, "blurWidth", 0.9f);
    oc.write(lightDensity, "lightDensity", 1.4f);
    oc.write(adaptative, "adaptative", true);
}
 
Example #16
Source File: Texture2D.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter e) throws IOException {
    super.write(e);
    OutputCapsule capsule = e.getCapsule(this);
    capsule.write(wrapS, "wrapS", WrapMode.EdgeClamp);
    capsule.write(wrapT, "wrapT", WrapMode.EdgeClamp);
}
 
Example #17
Source File: InstancedGeometry.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter exporter) throws IOException {
    super.write(exporter);
    OutputCapsule capsule = exporter.getCapsule(this);
    //capsule.write(currentNumInstances, "cur_num_instances", 1);
    capsule.write(geometries, "geometries", null);
}
 
Example #18
Source File: PQTorus.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter e) throws IOException {
    super.write(e);
    OutputCapsule capsule = e.getCapsule(this);
    capsule.write(p, "p", 0);
    capsule.write(q, "q", 0);
    capsule.write(radius, "radius", 0);
    capsule.write(width, "width", 0);
    capsule.write(steps, "steps", 0);
    capsule.write(radialSamples, "radialSamples", 0);
}
 
Example #19
Source File: DynamicAnimControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Serialize this control, for example when saving to a J3O file.
 *
 * @param ex the exporter (not null)
 * @throws IOException from the exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);

    // isReady and collisionListeners not written
    oc.write(ragdollMass, "ragdollMass", 1f);
    oc.write(centerLocation, "centerLocation", null);
    oc.write(centerVelocity, "centerVelocity", null);
}
 
Example #20
Source File: DacConfiguration.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Serialize this control, for example when saving to a J3O file.
 *
 * @param ex exporter (not null)
 * @throws IOException from exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);

    oc.write(damping, "damping", 0.6f);
    oc.write(eventDispatchImpulseThreshold, "eventDispatchImpulseThreshold",
            0f);

    int count = countLinkedBones();
    String[] linkedBoneNames = new String[count];
    RangeOfMotion[] roms = new RangeOfMotion[count];
    float[] blConfigs = new float[count];
    int i = 0;
    for (Map.Entry<String, Float> entry : blConfigMap.entrySet()) {
        linkedBoneNames[i] = entry.getKey();
        roms[i] = jointMap.get(entry.getKey());
        blConfigs[i] = entry.getValue();
        ++i;
    }
    oc.write(linkedBoneNames, "linkedBoneNames", null);
    oc.write(roms, "linkedBoneJoints", null);
    oc.write(blConfigs, "blConfigs", null);

    oc.write(torsoMass, "torsoMass", 1f);
    oc.write(gravityVector, "gravity", null);
}
 
Example #21
Source File: RangeOfMotion.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Serialize this preset, for example when saving to a J3O file.
 *
 * @param ex exporter (not null)
 * @throws IOException from exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(maxX, "maxX", 0f);
    capsule.write(minX, "minX", 0f);
    capsule.write(maxY, "maxY", 0f);
    capsule.write(minY, "minY", 0f);
    capsule.write(maxZ, "maxZ", 0f);
    capsule.write(minZ, "minZ", 0f);
}
 
Example #22
Source File: PhysicsGhostObject.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter e) throws IOException {
    super.write(e);
    OutputCapsule capsule = e.getCapsule(this);
    capsule.write(getPhysicsLocation(new Vector3f()), "physicsLocation", new Vector3f());
    capsule.write(getPhysicsRotationMatrix(new Matrix3f()), "physicsRotation", new Matrix3f());
    capsule.write(getCcdMotionThreshold(), "ccdMotionThreshold", 0);
    capsule.write(getCcdSweptSphereRadius(), "ccdSweptSphereRadius", 0);
}
 
Example #23
Source File: DirectionalLightShadowFilter.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(shadowRenderer, "shadowRenderer", null);

}
 
Example #24
Source File: SpotLightShadowRenderer.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(zFarOverride, "zFarOverride", 0);
    oc.write(light, "light", null);
    oc.write(fadeInfo, "fadeInfo", null);
    oc.write(fadeLength, "fadeLength", 0f);
}
 
Example #25
Source File: RigidBodyControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Serialize this control, for example when saving to a J3O file.
 *
 * @param ex exporter (not null)
 * @throws IOException from exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(enabled, "enabled", true);
    oc.write(motionState.isApplyPhysicsLocal(), "applyLocalPhysics", false);
    oc.write(kinematicSpatial, "kinematicSpatial", true);
    oc.write(spatial, "spatial", null);
}
 
Example #26
Source File: CharacterControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(enabled, "enabled", true);
    oc.write(applyLocal, "applyLocalPhysics", false);
    oc.write(useViewDirection, "viewDirectionEnabled", true);
    oc.write(viewDirection, "viewDirection", new Vector3f(Vector3f.UNIT_Z));
    oc.write(spatial, "spatial", null);
}
 
Example #27
Source File: SliderJoint.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Serialize this joint, for example when saving to a J3O file.
 *
 * @param ex exporter (not null)
 * @throws IOException from exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule capsule = ex.getCapsule(this);
    //TODO: standard values..
    capsule.write(getDampingDirAng(), "dampingDirAng", 0f);
    capsule.write(getDampingDirLin(), "dampingDirLin", 0f);
    capsule.write(getDampingLimAng(), "dampingLimAng", 0f);
    capsule.write(getDampingLimLin(), "dampingLimLin", 0f);
    capsule.write(getDampingOrthoAng(), "dampingOrthoAng", 0f);
    capsule.write(getDampingOrthoLin(), "dampingOrthoLin", 0f);
    capsule.write(getLowerAngLimit(), "lowerAngLimit", 0f);
    capsule.write(getLowerLinLimit(), "lowerLinLimit", 0f);
    capsule.write(getMaxAngMotorForce(), "maxAngMotorForce", 0f);
    capsule.write(getMaxLinMotorForce(), "maxLinMotorForce", 0f);
    capsule.write(isPoweredAngMotor(), "poweredAngMotor", false);
    capsule.write(isPoweredLinMotor(), "poweredLinMotor", false);
    capsule.write(getRestitutionDirAng(), "restitutionDirAng", 0f);
    capsule.write(getRestitutionDirLin(), "restitutionDirLin", 0f);
    capsule.write(getRestitutionLimAng(), "restitutionLimAng", 0f);
    capsule.write(getRestitutionLimLin(), "restitutionLimLin", 0f);
    capsule.write(getRestitutionOrthoAng(), "restitutionOrthoAng", 0f);
    capsule.write(getRestitutionOrthoLin(), "restitutionOrthoLin", 0f);

    capsule.write(getSoftnessDirAng(), "softnessDirAng", 0f);
    capsule.write(getSoftnessDirLin(), "softnessDirLin", 0f);
    capsule.write(getSoftnessLimAng(), "softnessLimAng", 0f);
    capsule.write(getSoftnessLimLin(), "softnessLimLin", 0f);
    capsule.write(getSoftnessOrthoAng(), "softnessOrthoAng", 0f);
    capsule.write(getSoftnessOrthoLin(), "softnessOrthoLin", 0f);

    capsule.write(getTargetAngMotorVelocity(), "targetAngMotorVelicoty", 0f);
    capsule.write(getTargetLinMotorVelocity(), "targetLinMotorVelicoty", 0f);

    capsule.write(getUpperAngLimit(), "upperAngLimit", 0f);
    capsule.write(getUpperLinLimit(), "upperLinLimit", 0f);

    capsule.write(useLinearReferenceFrameA, "useLinearReferenceFrameA", false);
}
 
Example #28
Source File: SixDofJoint.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Serialize this joint, for example when saving to a J3O file.
 *
 * @param ex exporter (not null)
 * @throws IOException from exporter
 */
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(angularUpperLimit, "angularUpperLimit", new Vector3f(Vector3f.POSITIVE_INFINITY));
    capsule.write(angularLowerLimit, "angularLowerLimit", new Vector3f(Vector3f.NEGATIVE_INFINITY));
    capsule.write(linearUpperLimit, "linearUpperLimit", new Vector3f(Vector3f.POSITIVE_INFINITY));
    capsule.write(linearLowerLimit, "linearLowerLimit", new Vector3f(Vector3f.NEGATIVE_INFINITY));
    int i = 0;
    for (Iterator<RotationalLimitMotor> it = rotationalMotors.iterator(); it.hasNext();) {
        RotationalLimitMotor rotationalLimitMotor = it.next();
        capsule.write(rotationalLimitMotor.getBounce(), "rotMotor" + i + "_Bounce", 0.0f);
        capsule.write(rotationalLimitMotor.getDamping(), "rotMotor" + i + "_Damping", 1.0f);
        capsule.write(rotationalLimitMotor.getERP(), "rotMotor" + i + "_ERP", 0.5f);
        capsule.write(rotationalLimitMotor.getHiLimit(), "rotMotor" + i + "_HiLimit", Float.POSITIVE_INFINITY);
        capsule.write(rotationalLimitMotor.getLimitSoftness(), "rotMotor" + i + "_LimitSoftness", 0.5f);
        capsule.write(rotationalLimitMotor.getLoLimit(), "rotMotor" + i + "_LoLimit", Float.NEGATIVE_INFINITY);
        capsule.write(rotationalLimitMotor.getMaxLimitForce(), "rotMotor" + i + "_MaxLimitForce", 300.0f);
        capsule.write(rotationalLimitMotor.getMaxMotorForce(), "rotMotor" + i + "_MaxMotorForce", 0.1f);
        capsule.write(rotationalLimitMotor.getTargetVelocity(), "rotMotor" + i + "_TargetVelocity", 0);
        capsule.write(rotationalLimitMotor.isEnableMotor(), "rotMotor" + i + "_EnableMotor", false);
        i++;
    }
    capsule.write(getTranslationalLimitMotor().getAccumulatedImpulse(), "transMotor_AccumulatedImpulse", Vector3f.ZERO);
    capsule.write(getTranslationalLimitMotor().getDamping(), "transMotor_Damping", 1.0f);
    capsule.write(getTranslationalLimitMotor().getLimitSoftness(), "transMotor_LimitSoftness", 0.7f);
    capsule.write(getTranslationalLimitMotor().getLowerLimit(), "transMotor_LowerLimit", Vector3f.ZERO);
    capsule.write(getTranslationalLimitMotor().getRestitution(), "transMotor_Restitution", 0.5f);
    capsule.write(getTranslationalLimitMotor().getUpperLimit(), "transMotor_UpperLimit", Vector3f.ZERO);

    for (int axisIndex = 0; axisIndex < 3; ++axisIndex) {
        capsule.write(translationalMotor.isEnabled(axisIndex),
                "transMotor_Enable" + axisIndex, false);
    }
}
 
Example #29
Source File: BoundingSphere.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter e) throws IOException {
    super.write(e);
    try {
        e.getCapsule(this).write(radius, "radius", 0);
    } catch (IOException ex) {
        logger.logp(Level.SEVERE, this.getClass().toString(), "write(JMEExporter)", "Exception", ex);
    }
}
 
Example #30
Source File: NewtonianParticleInfluencer.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(normalVelocity, "normalVelocity", 0.0f);
    oc.write(surfaceTangentFactor, "surfaceTangentFactor", 0.0f);
    oc.write(surfaceTangentRotation, "surfaceTangentRotation", 0.0f);
}