/** * creates a cylinder shape from the given halfextents * @param halfExtents the halfextents to use */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }
/** * Instantiate the configured shape in Bullet. */ protected void createShape() { objectId = createShape(axis, halfExtents); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // switch (axis) { // case 0: // objectId = new CylinderShapeX(Converter.convert(halfExtents)); // break; // case 1: // objectId = new CylinderShape(Converter.convert(halfExtents)); // break; // case 2: // objectId = new CylinderShapeZ(Converter.convert(halfExtents)); // break; // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
protected void createShape() { switch (axis) { case 0: cShape = new CylinderShapeX(Converter.convert(halfExtents)); break; case 1: cShape = new CylinderShape(Converter.convert(halfExtents)); break; case 2: cShape = new CylinderShapeZ(Converter.convert(halfExtents)); break; } cShape.setLocalScaling(Converter.convert(getScale())); cShape.setMargin(margin); }
Node physicsCylinder = PhysicsTestHelper.createPhysicsTestNode(assetManager, new CylinderCollisionShape(new Vector3f(1f, 1f, 1.5f)), 1); physicsCylinder.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(2, 2, 0)); rootNode.attachChild(physicsCylinder);
protected void createShape() { switch (axis) { case 0: cShape = new CylinderShapeX(Converter.convert(halfExtents)); break; case 1: cShape = new CylinderShape(Converter.convert(halfExtents)); break; case 2: cShape = new CylinderShapeZ(Converter.convert(halfExtents)); break; } cShape.setLocalScaling(Converter.convert(getScale())); cShape.setMargin(margin); }
Node physicsCylinder = PhysicsTestHelper.createPhysicsTestNode(assetManager, new CylinderCollisionShape(new Vector3f(1f, 1f, 1.5f)), 1); physicsCylinder.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(2, 2, 0)); rootNode.attachChild(physicsCylinder);
/** * Creates a cylinder shape around the given axis from the given halfextents * @param halfExtents the halfextents to use * @param axis (0=X,1=Y,2=Z) */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }
protected void createShape() { objectId = createShape(axis, halfExtents); Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Created Shape {0}", Long.toHexString(objectId)); // switch (axis) { // case 0: // objectId = new CylinderShapeX(Converter.convert(halfExtents)); // break; // case 1: // objectId = new CylinderShape(Converter.convert(halfExtents)); // break; // case 2: // objectId = new CylinderShapeZ(Converter.convert(halfExtents)); // break; // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
Node physicsCylinder = PhysicsTestHelper.createPhysicsTestNode(assetManager, new CylinderCollisionShape(new Vector3f(1f, 1f, 1.5f)), 1); physicsCylinder.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(2, 2, 0)); physicsCylinder.getControl(RigidBodyControl.class).setApplyPhysicsLocal(true);
/** * Instantiate a Z-axis cylinder shape with the specified half extents. * * @param halfExtents the desired unscaled half extents (not null, no * negative component, alias created) */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }
protected void createShape() { objectId = createShape(axis, halfExtents); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // switch (axis) { // case 0: // objectId = new CylinderShapeX(Converter.convert(halfExtents)); // break; // case 1: // objectId = new CylinderShape(Converter.convert(halfExtents)); // break; // case 2: // objectId = new CylinderShapeZ(Converter.convert(halfExtents)); // break; // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
/** * Instantiate a cylinder shape around the specified axis. * * @param halfExtents the desired unscaled half extents (not null, no * negative component, alias created) * @param axis which local axis: 0→X, 1→Y, 2→Z */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); halfExtents = (Vector3f) capsule.readSavable("halfExtents", new Vector3f(0.5f, 0.5f, 0.5f)); axis = capsule.readInt("axis", 1); 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); halfExtents = (Vector3f) capsule.readSavable("halfExtents", new Vector3f(0.5f, 0.5f, 0.5f)); axis = capsule.readInt("axis", 1); createShape(); }
/** * Creates a cylinder shape around the given axis from the given halfextents * @param halfExtents the halfextents to use * @param axis (0=X,1=Y,2=Z) */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }
/** * Creates a cylinder shape around the given axis from the given halfextents * @param halfExtents the halfextents to use * @param axis (0=X,1=Y,2=Z) */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }
/** * creates a cylinder shape from the given halfextents * @param halfExtents the halfextents to use */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }
/** * creates a cylinder shape from the given halfextents * @param halfExtents the halfextents to use */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }
/** * creates a cylinder shape from the given halfextents * @param halfExtents the halfextents to use */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }
/** * Creates a cylinder shape around the given axis from the given halfextents * @param halfExtents the halfextents to use * @param axis (0=X,1=Y,2=Z) */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }