/** * Creates a capsule shape around the given axis (0=X,1=Y,2=Z). * @param radius * @param height * @param axis */ public CapsuleCollisionShape(float radius, float height, int axis) { this.radius=radius; this.height=height; this.axis=axis; createShape(); }
/** * Instantiate a Y-axis capsule shape with the specified radius and height. * * @param radius the desired radius (≥0) * @param height the desired height (of the cylindrical portion) (≥0) */ public CapsuleCollisionShape(float radius, float height) { this.radius=radius; this.height=height; this.axis=1; createShape(); }
/** * Instantiate a capsule shape around the specified main (height) axis. * * @param radius the desired radius (≥0) * @param height the desired height (of the cylindrical portion) (≥0) * @param axis which local axis: 0→X, 1→Y, 2→Z */ public CapsuleCollisionShape(float radius, float height, int axis) { this.radius=radius; this.height=height; this.axis=axis; 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)); setScale(scale); setMargin(margin); // switch(axis){ // case 0: // objectId=new CapsuleShapeX(radius,height); // break; // case 1: // objectId=new CapsuleShape(radius,height); // break; // case 2: // objectId=new CapsuleShapeZ(radius,height); // break; // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.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", 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); radius = capsule.readFloat("radius", 0.5f); height = capsule.readFloat("height", 0.5f); axis = capsule.readInt("axis", 1); createShape(); }
/** * creates a capsule shape around the given axis (0=X,1=Y,2=Z) * @param radius * @param height * @param axis */ public CapsuleCollisionShape(float radius, float height, int axis) { this.radius=radius; this.height=height; this.axis=axis; createShape(); }
/** * creates a new CapsuleCollisionShape with the given radius and height * @param radius the radius of the capsule * @param height the height of the capsule */ public CapsuleCollisionShape(float radius, float height) { this.radius=radius; this.height=height; this.axis=1; createShape(); }
/** * Creates a capsule shape around the given axis (0=X,1=Y,2=Z). * @param radius * @param height * @param axis */ public CapsuleCollisionShape(float radius, float height, int axis) { this.radius=radius; this.height=height; this.axis=axis; createShape(); }
/** * creates a new CapsuleCollisionShape with the given radius and height * @param radius the radius of the capsule * @param height the height of the capsule */ public CapsuleCollisionShape(float radius, float height) { this.radius=radius; this.height=height; this.axis=1; createShape(); }
/** * creates a capsule shape around the given axis (0=X,1=Y,2=Z) * @param radius * @param height * @param axis */ public CapsuleCollisionShape(float radius, float height, int axis) { this.radius=radius; this.height=height; this.axis=axis; createShape(); }
protected void createShape(){ objectId = createShape(axis, radius, height); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); setScale(scale); setMargin(margin); // switch(axis){ // case 0: // objectId=new CapsuleShapeX(radius,height); // break; // case 1: // objectId=new CapsuleShape(radius,height); // break; // case 2: // objectId=new CapsuleShapeZ(radius,height); // break; // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); }
protected void createShape(){ objectId = createShape(axis, radius, height); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); setScale(scale); setMargin(margin); // switch(axis){ // case 0: // objectId=new CapsuleShapeX(radius,height); // break; // case 1: // objectId=new CapsuleShape(radius,height); // break; // case 2: // objectId=new CapsuleShapeZ(radius,height); // break; // } // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.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", 1); 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", 1); 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", 1); createShape(); }