/** * Instantiate a collision shape based on the specified JME mesh. For best * performance and stability, use the mesh should have no more than 100 * vertices. * * @param mesh a mesh on which to base the shape (not null, at least one * vertex) */ public HullCollisionShape(Mesh mesh) { this.points = getPoints(mesh); createShape(); }
public HullCollisionShape(Mesh mesh) { this.points = getPoints(mesh); createShape(this.points); }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); // for backwards compatability Mesh mesh = (Mesh) capsule.readSavable("hullMesh", null); if (mesh != null) { this.points = getPoints(mesh); } else { this.points = capsule.readFloatArray("points", null); } createShape(this.points); }
/** * De-serialize this shape, 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 capsule = im.getCapsule(this); // for backwards compatability Mesh mesh = (Mesh) capsule.readSavable("hullMesh", null); if (mesh != null) { this.points = getPoints(mesh); } else { this.points = capsule.readFloatArray("points", null); } // fbuf = ByteBuffer.allocateDirect(points.length * 4).asFloatBuffer(); // fbuf.put(points); // fbuf = FloatBuffer.wrap(points).order(ByteOrder.nativeOrder()).asFloatBuffer(); createShape(); }
public HullCollisionShape(Mesh mesh) { this.points = getPoints(mesh); createShape(); }
public HullCollisionShape(Mesh mesh) { this.points = getPoints(mesh); createShape(this.points); }
public HullCollisionShape(Mesh mesh) { this.points = getPoints(mesh); createShape(); }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); // for backwards compatability Mesh mesh = (Mesh) capsule.readSavable("hullMesh", null); if (mesh != null) { this.points = getPoints(mesh); } else { this.points = capsule.readFloatArray("points", null); } createShape(this.points); }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); // for backwards compatability Mesh mesh = (Mesh) capsule.readSavable("hullMesh", null); if (mesh != null) { this.points = getPoints(mesh); } else { this.points = capsule.readFloatArray("points", null); } // fbuf = ByteBuffer.allocateDirect(points.length * 4).asFloatBuffer(); // fbuf.put(points); // fbuf = FloatBuffer.wrap(points).order(ByteOrder.nativeOrder()).asFloatBuffer(); createShape(); }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); // for backwards compatability Mesh mesh = (Mesh) capsule.readSavable("hullMesh", null); if (mesh != null) { this.points = getPoints(mesh); } else { this.points = capsule.readFloatArray("points", null); } // fbuf = ByteBuffer.allocateDirect(points.length * 4).asFloatBuffer(); // fbuf.put(points); // fbuf = FloatBuffer.wrap(points).order(ByteOrder.nativeOrder()).asFloatBuffer(); createShape(); }