/** * Instantiate the configured shape in Bullet. */ protected void createShape() { bbuf = BufferUtils.createByteBuffer(heightfieldData.length * 4); // fbuf = bbuf.asFloatBuffer();//FloatBuffer.wrap(heightfieldData); // fbuf.rewind(); // fbuf.put(heightfieldData); for (int i = 0; i < heightfieldData.length; i++) { float f = heightfieldData[i]; bbuf.putFloat(f); } // fbuf.rewind(); objectId = createShape(heightStickWidth, heightStickLength, bbuf, heightScale, minHeight, maxHeight, upAxis, flipQuadEdges); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); setScale(scale); setMargin(margin); }
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(); }
/** * De-serialize this shape, for example when loading from a J3O file. * * @param im importer (not null) * @throws IOException from importer */ 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(); } }
protected void createShape() { bbuf = BufferUtils.createByteBuffer(heightfieldData.length * 4); // fbuf = bbuf.asFloatBuffer();//FloatBuffer.wrap(heightfieldData); // fbuf.rewind(); // fbuf.put(heightfieldData); for (int i = 0; i < heightfieldData.length; i++) { float f = heightfieldData[i]; bbuf.putFloat(f); } // fbuf.rewind(); objectId = createShape(heightStickWidth, heightStickLength, bbuf, heightScale, minHeight, maxHeight, upAxis, flipQuadEdges); Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Created Shape {0}", Long.toHexString(objectId)); setScale(scale); setMargin(margin); }
protected void createShape() { bbuf = BufferUtils.createByteBuffer(heightfieldData.length * 4); // fbuf = bbuf.asFloatBuffer();//FloatBuffer.wrap(heightfieldData); // fbuf.rewind(); // fbuf.put(heightfieldData); for (int i = 0; i < heightfieldData.length; i++) { float f = heightfieldData[i]; bbuf.putFloat(f); } // fbuf.rewind(); objectId = createShape(heightStickWidth, heightStickLength, bbuf, heightScale, minHeight, maxHeight, upAxis, flipQuadEdges); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); setScale(scale); setMargin(margin); }
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(); } }
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(); }
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(); } }