/** * Creates a new cone collision shape with the given height, radius and default Y axis. * * @param radius The radius of the cone in world units. * @param height The height of the cone in world units. */ public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = height; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
/** * Instantiate a cone shape oriented along the Y axis. * * @param radius the desired radius (≥0) * @param height the desired height (≥0) */ public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = height; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
/** * Instantiate a cone shape around the specified main (height) axis. * * @param radius the desired radius (≥0) * @param height the desired height (≥0) * @param axis which local axis: 0→X, 1→Y, 2→Z */ public ConeCollisionShape(float radius, float height, int axis) { this.radius = radius; this.height = height; this.axis = axis; createShape(); }
/** * Creates a new cone collision shape with the given height, radius, and axis. * * @param radius The radius of the cone in world units. * @param height The height of the cone in world units. * @param The axis towards which the cone faces, see the PhysicsSpace.AXIS_* constants. */ public ConeCollisionShape(float radius, float height, int axis) { this.radius = radius; this.height = height; this.axis = axis; if (axis < PhysicsSpace.AXIS_X || axis > PhysicsSpace.AXIS_Z) { throw new UnsupportedOperationException("axis must be one of the PhysicsSpace.AXIS_* constants!"); } createShape(); }
/** * Instantiate the configured shape in Bullet. */ protected void createShape() { objectId = createShape(axis, radius, height); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // if (axis == PhysicsSpace.AXIS_X) { // objectId = new ConeShapeX(radius, height); // } else if (axis == PhysicsSpace.AXIS_Y) { // objectId = new ConeShape(radius, height); // } else if (axis == PhysicsSpace.AXIS_Z) { // objectId = new ConeShapeZ(radius, height); // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); radius = capsule.readFloat("radius", 0.5f); height = capsule.readFloat("height", 0.5f); axis = capsule.readInt("axis", PhysicsSpace.AXIS_Y); 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); radius = capsule.readFloat("radius", 0.5f); height = capsule.readFloat("height", 0.5f); axis = capsule.readInt("axis", PhysicsSpace.AXIS_Y); createShape(); }
/** * Creates a new cone collision shape with the given height, radius and default Y axis. * * @param radius The radius of the cone in world units. * @param height The height of the cone in world units. */ public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = height; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = radius; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
public ConeCollisionShape(float radius, float height, int axis) { this.radius = radius; this.height = height; this.axis = axis; createShape(); }
public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = height; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
public ConeCollisionShape(float radius, float height, int axis) { this.radius = radius; this.height = radius; this.axis = axis; createShape(); }
/** * Creates a new cone collision shape with the given height, radius, and axis. * * @param radius The radius of the cone in world units. * @param height The height of the cone in world units. * @param The axis towards which the cone faces, see the PhysicsSpace.AXIS_* constants. */ public ConeCollisionShape(float radius, float height, int axis) { this.radius = radius; this.height = height; this.axis = axis; if (axis < PhysicsSpace.AXIS_X || axis > PhysicsSpace.AXIS_Z) { throw new UnsupportedOperationException("axis must be one of the PhysicsSpace.AXIS_* constants!"); } createShape(); }
protected void createShape() { objectId = createShape(axis, radius, height); Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Created Shape {0}", Long.toHexString(objectId)); // if (axis == PhysicsSpace.AXIS_X) { // objectId = new ConeShapeX(radius, height); // } else if (axis == PhysicsSpace.AXIS_Y) { // objectId = new ConeShape(radius, height); // } else if (axis == PhysicsSpace.AXIS_Z) { // objectId = new ConeShapeZ(radius, height); // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
protected void createShape() { objectId = createShape(axis, radius, height); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // if (axis == PhysicsSpace.AXIS_X) { // objectId = new ConeShapeX(radius, height); // } else if (axis == PhysicsSpace.AXIS_Y) { // objectId = new ConeShape(radius, height); // } else if (axis == PhysicsSpace.AXIS_Z) { // objectId = new ConeShapeZ(radius, height); // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); radius = capsule.readFloat("radius", 0.5f); radius = capsule.readFloat("height", 0.5f); radius = capsule.readFloat("axis", 0.5f); createShape(); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); radius = capsule.readFloat("radius", 0.5f); height = capsule.readFloat("height", 0.5f); axis = capsule.readInt("axis", PhysicsSpace.AXIS_Y); createShape(); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); radius = capsule.readFloat("radius", 0.5f); height = capsule.readFloat("height", 0.5f); axis = capsule.readInt("axis", PhysicsSpace.AXIS_Y); createShape(); }