本文整理汇总了Java中com.jme3.export.InputCapsule类的典型用法代码示例。如果您正苦于以下问题:Java InputCapsule类的具体用法?Java InputCapsule怎么用?Java InputCapsule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InputCapsule类属于com.jme3.export包,在下文中一共展示了InputCapsule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
format = capsule.readEnum("format", Format.class, Format.RGBA8);
width = capsule.readInt("width", 0);
height = capsule.readInt("height", 0);
depth = capsule.readInt("depth", 0);
mipMapSizes = capsule.readIntArray("mipMapSizes", null);
multiSamples = capsule.readInt("multiSamples", 1);
data = (ArrayList<ByteBuffer>) capsule.readByteBufferArrayList("data", null);
colorSpace = capsule.readEnum("colorSpace", ColorSpace.class, null);
if (mipMapSizes != null) {
needGeneratedMips = false;
mipsWereGenerated = true;
}
}
示例2: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter e) throws IOException {
InputCapsule cap = e.getCapsule(this);
m00 = cap.readFloat("m00", 1);
m01 = cap.readFloat("m01", 0);
m02 = cap.readFloat("m02", 0);
m03 = cap.readFloat("m03", 0);
m10 = cap.readFloat("m10", 0);
m11 = cap.readFloat("m11", 1);
m12 = cap.readFloat("m12", 0);
m13 = cap.readFloat("m13", 0);
m20 = cap.readFloat("m20", 0);
m21 = cap.readFloat("m21", 0);
m22 = cap.readFloat("m22", 1);
m23 = cap.readFloat("m23", 0);
m30 = cap.readFloat("m30", 0);
m31 = cap.readFloat("m31", 0);
m32 = cap.readFloat("m32", 0);
m33 = cap.readFloat("m33", 1);
}
示例3: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
pointSprite = ic.readBoolean("pointSprite", false);
wireframe = ic.readBoolean("wireframe", false);
cullMode = ic.readEnum("cullMode", FaceCullMode.class, FaceCullMode.Back);
depthWrite = ic.readBoolean("depthWrite", true);
depthTest = ic.readBoolean("depthTest", true);
colorWrite = ic.readBoolean("colorWrite", true);
blendMode = ic.readEnum("blendMode", BlendMode.class, BlendMode.Off);
alphaTest = ic.readBoolean("alphaTest", false);
alphaFallOff = ic.readFloat("alphaFallOff", 0);
offsetEnabled = ic.readBoolean("offsetEnabled", false);
offsetFactor = ic.readFloat("offsetFactor", 0);
offsetUnits = ic.readFloat("offsetUnits", 0);
stencilTest = ic.readBoolean("stencilTest", false);
frontStencilStencilFailOperation = ic.readEnum("frontStencilStencilFailOperation", StencilOperation.class, StencilOperation.Keep);
frontStencilDepthFailOperation = ic.readEnum("frontStencilDepthFailOperation", StencilOperation.class, StencilOperation.Keep);
frontStencilDepthPassOperation = ic.readEnum("frontStencilDepthPassOperation", StencilOperation.class, StencilOperation.Keep);
backStencilStencilFailOperation = ic.readEnum("backStencilStencilFailOperation", StencilOperation.class, StencilOperation.Keep);
backStencilDepthFailOperation = ic.readEnum("backStencilDepthFailOperation", StencilOperation.class, StencilOperation.Keep);
backStencilDepthPassOperation = ic.readEnum("backStencilDepthPassOperation", StencilOperation.class, StencilOperation.Keep);
frontStencilFunction = ic.readEnum("frontStencilFunction", TestFunction.class, TestFunction.Always);
backStencilFunction = ic.readEnum("backStencilFunction", TestFunction.class, TestFunction.Always);
}
示例4: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
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);
}
示例5: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter im) throws IOException {
InputCapsule input = im.getCapsule(this);
Savable[] boneRootsAsSav = input.readSavableArray("rootBones", null);
rootBones = new Bone[boneRootsAsSav.length];
System.arraycopy(boneRootsAsSav, 0, rootBones, 0, boneRootsAsSav.length);
Savable[] boneListAsSavable = input.readSavableArray("boneList", null);
boneList = new Bone[boneListAsSavable.length];
System.arraycopy(boneListAsSavable, 0, boneList, 0, boneListAsSavable.length);
createSkinningMatrices();
for (Bone rootBone : rootBones) {
rootBone.update();
rootBone.setBindingPose();
}
}
示例6: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException {
InputCapsule input = im.getCapsule(this);
name = input.readString("name", null);
initialPos = (Vector3f) input.readSavable("initialPos", null);
initialRot = (Quaternion) input.readSavable("initialRot", null);
initialScale = (Vector3f) input.readSavable("initialScale", new Vector3f(1.0f, 1.0f, 1.0f));
attachNode = (Node) input.readSavable("attachNode", null);
localPos.set(initialPos);
localRot.set(initialRot);
ArrayList<Bone> childList = input.readSavableArrayList("children", null);
for (int i = childList.size() - 1; i >= 0; i--) {
this.addChild(childList.get(i));
}
// NOTE: Parent skeleton will call update() then setBindingPose()
// after Skeleton has been de-serialized.
// Therefore, worldBindInversePos and worldBindInverseRot
// will be reconstructed based on that information.
}
示例7: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
InputCapsule capsule = im.getCapsule(this);
wheelSpatial = (Spatial) capsule.readSavable("wheelSpatial", null);
frontWheel = capsule.readBoolean("frontWheel", false);
location = (Vector3f) capsule.readSavable("wheelLocation", new Vector3f());
direction = (Vector3f) capsule.readSavable("wheelDirection", new Vector3f());
axle = (Vector3f) capsule.readSavable("wheelAxle", new Vector3f());
suspensionStiffness = capsule.readFloat("suspensionStiffness", 20.0f);
wheelsDampingRelaxation = capsule.readFloat("wheelsDampingRelaxation", 2.3f);
wheelsDampingCompression = capsule.readFloat("wheelsDampingCompression", 4.4f);
frictionSlip = capsule.readFloat("frictionSlip", 10.5f);
rollInfluence = capsule.readFloat("rollInfluence", 1.0f);
maxSuspensionTravelCm = capsule.readFloat("maxSuspensionTravelCm", 500f);
maxSuspensionForce = capsule.readFloat("maxSuspensionForce", 6000f);
radius = capsule.readFloat("wheelRadius", 0.5f);
restLength = capsule.readFloat("restLength", 1f);
}
示例8: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
@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);
}
示例9: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
location = (Vector3f) capsule.readSavable("location", Vector3f.ZERO.clone());
rotation = (Quaternion) capsule.readSavable("rotation", Quaternion.DIRECTION_Z.clone());
frustumNear = capsule.readFloat("frustumNear", 1);
frustumFar = capsule.readFloat("frustumFar", 2);
frustumLeft = capsule.readFloat("frustumLeft", -0.5f);
frustumRight = capsule.readFloat("frustumRight", 0.5f);
frustumTop = capsule.readFloat("frustumTop", 0.5f);
frustumBottom = capsule.readFloat("frustumBottom", -0.5f);
coeffLeft = capsule.readFloatArray("coeffLeft", new float[2]);
coeffRight = capsule.readFloatArray("coeffRight", new float[2]);
coeffBottom = capsule.readFloatArray("coeffBottom", new float[2]);
coeffTop = capsule.readFloatArray("coeffTop", new float[2]);
viewPortLeft = capsule.readFloat("viewPortLeft", 0);
viewPortRight = capsule.readFloat("viewPortRight", 1);
viewPortTop = capsule.readFloat("viewPortTop", 1);
viewPortBottom = capsule.readFloat("viewPortBottom", 0);
width = capsule.readInt("width", 1);
height = capsule.readInt("height", 1);
name = capsule.readString("name", null);
onFrustumChange();
onViewPortChange();
onFrameChange();
}
示例10: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter im) throws IOException {
InputCapsule in = im.getCapsule(this);
meshBound = (BoundingVolume) in.readSavable("modelBound", null);
vertCount = in.readInt("vertCount", -1);
elementCount = in.readInt("elementCount", -1);
maxNumWeights = in.readInt("max_num_weights", -1);
mode = in.readEnum("mode", Mode.class, Mode.Triangles);
elementLengths = in.readIntArray("elementLengths", null);
modeStart = in.readIntArray("modeStart", null);
collisionTree = (BIHTree) in.readSavable("collisionTree", null);
elementLengths = in.readIntArray("elementLengths", null);
modeStart = in.readIntArray("modeStart", null);
pointSize = in.readFloat("pointSize", 1f);
// in.readStringSavableMap("buffers", null);
buffers = (IntMap<VertexBuffer>) in.readIntSavableMap("buffers", null);
for (Entry<VertexBuffer> entry : buffers){
buffersList.add(entry.getValue());
}
Savable[] lodLevelsSavable = in.readSavableArray("lodLevels", null);
if (lodLevelsSavable != null) {
lodLevels = new VertexBuffer[lodLevelsSavable.length];
System.arraycopy( lodLevelsSavable, 0, lodLevels, 0, lodLevels.length);
}
}
示例11: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
cellSize = ic.readFloat("cellSize", 1f);
cellHeight = ic.readFloat("cellHeight", 1.5f);
minTraversableHeight = ic.readFloat("minTraversableHeight", 7.5f);
maxTraversableStep = ic.readFloat("maxTraversableStep", 1f);
maxTraversableSlope = ic.readFloat("maxTraversableSlope", 48f);
clipLedges = ic.readBoolean("clipLedges", false);
traversableAreaBorderSize = ic.readFloat("traversableAreaBorderSize", 1.2f);
smoothingThreshold = (int) ic.readFloat("smoothingThreshold", 2);
useConservativeExpansion = ic.readBoolean("useConservativeExpansion", true);
minUnconnectedRegionSize = (int) ic.readFloat("minUnconnectedRegionSize", 3);
mergeRegionSize = (int) ic.readFloat("mergeRegionSize", 10);
maxEdgeLength = ic.readFloat("maxEdgeLength", 0);
edgeMaxDeviation = ic.readFloat("edgeMaxDeviation", 2.4f);
maxVertsPerPoly = (int) ic.readFloat("maxVertsPerPoly", 6);
contourSampleDistance = ic.readFloat("contourSampleDistance", 25);
contourMaxDeviation = ic.readFloat("contourMaxDeviation", 25);
}
示例12: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
@Override
public void read(JmeImporter e) throws IOException {
super.read(e);
InputCapsule capsule = e.getCapsule(this);
float mass = capsule.readFloat("mass", 1.0f);
this.mass = mass;
rebuildRigidBody();
setGravity((Vector3f) capsule.readSavable("gravity", Vector3f.ZERO.clone()));
setFriction(capsule.readFloat("friction", 0.5f));
setKinematic(capsule.readBoolean("kinematic", false));
setRestitution(capsule.readFloat("restitution", 0));
setAngularFactor(capsule.readFloat("angularFactor", 1));
setDamping(capsule.readFloat("linearDamping", 0), capsule.readFloat("angularDamping", 0));
setSleepingThresholds(capsule.readFloat("linearSleepingThreshold", 0.8f), capsule.readFloat("angularSleepingThreshold", 1.0f));
setCcdMotionThreshold(capsule.readFloat("ccdMotionThreshold", 0));
setCcdSweptSphereRadius(capsule.readFloat("ccdSweptSphereRadius", 0));
setPhysicsLocation((Vector3f) capsule.readSavable("physicsLocation", new Vector3f()));
setPhysicsRotation((Matrix3f) capsule.readSavable("physicsRotation", new Matrix3f()));
joints = capsule.readSavableArrayList("joints", null);
}
示例13: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
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;
}
}
示例14: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
trisPerPixel = ic.readFloat("trisPerPixel", 1f);
distTolerance = ic.readFloat("distTolerance", 1f);
numLevels = ic.readInt("numLevels", 0);
numTris = ic.readIntArray("numTris", null);
}
示例15: read
import com.jme3.export.InputCapsule; //导入依赖的package包/类
@Override
public void read(@NotNull final JmeImporter importer) throws IOException {
final InputCapsule capsule = importer.getCapsule(this);
sceneNode = (SceneNode) capsule.readSavable("sceneNode", null);
threadingType = capsule.readEnum("threadingType", ThreadingType.class, ThreadingType.SEQUENTIAL);
broadphaseType = capsule.readEnum("broadphaseType", BroadphaseType.class, BroadphaseType.DBVT);
worldMin = (Vector3f) capsule.readSavable("worldMin", null);
worldMax = (Vector3f) capsule.readSavable("worldMax", null);
speed = capsule.readFloat("speed", 0);
debugEnabled = capsule.readBoolean("debugEnabled", false);
}